Class: NicInfo::Domain
- Inherits:
-
Object
- Object
- NicInfo::Domain
- Defined in:
- lib/nicinfo/domain.rb
Overview
deals with RDAP nameserver structures
Instance Attribute Summary collapse
-
#asEventActors ⇒ Object
Returns the value of attribute asEventActors.
-
#ds_data_objs ⇒ Object
Returns the value of attribute ds_data_objs.
-
#entities ⇒ Object
Returns the value of attribute entities.
-
#key_data_objs ⇒ Object
Returns the value of attribute key_data_objs.
-
#nameservers ⇒ Object
Returns the value of attribute nameservers.
-
#network ⇒ Object
Returns the value of attribute network.
-
#objectclass ⇒ Object
Returns the value of attribute objectclass.
Instance Method Summary collapse
- #display ⇒ Object
- #get_cn ⇒ Object
-
#initialize(config) ⇒ Domain
constructor
A new instance of Domain.
- #process(json_data) ⇒ Object
- #to_node ⇒ Object
Constructor Details
#initialize(config) ⇒ Domain
Returns a new instance of Domain.
100 101 102 103 104 105 106 107 108 |
# File 'lib/nicinfo/domain.rb', line 100 def initialize config @config = config @common = CommonJson.new config @entities = Array.new @asEventActors = Array.new @nameservers = Array.new @ds_data_objs = Array.new @key_data_objs = Array.new end |
Instance Attribute Details
#asEventActors ⇒ Object
Returns the value of attribute asEventActors.
98 99 100 |
# File 'lib/nicinfo/domain.rb', line 98 def asEventActors @asEventActors end |
#ds_data_objs ⇒ Object
Returns the value of attribute ds_data_objs.
98 99 100 |
# File 'lib/nicinfo/domain.rb', line 98 def ds_data_objs @ds_data_objs end |
#entities ⇒ Object
Returns the value of attribute entities.
98 99 100 |
# File 'lib/nicinfo/domain.rb', line 98 def entities @entities end |
#key_data_objs ⇒ Object
Returns the value of attribute key_data_objs.
98 99 100 |
# File 'lib/nicinfo/domain.rb', line 98 def key_data_objs @key_data_objs end |
#nameservers ⇒ Object
Returns the value of attribute nameservers.
98 99 100 |
# File 'lib/nicinfo/domain.rb', line 98 def nameservers @nameservers end |
#network ⇒ Object
Returns the value of attribute network.
98 99 100 |
# File 'lib/nicinfo/domain.rb', line 98 def network @network end |
#objectclass ⇒ Object
Returns the value of attribute objectclass.
98 99 100 |
# File 'lib/nicinfo/domain.rb', line 98 def objectclass @objectclass end |
Instance Method Details
#display ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/nicinfo/domain.rb', line 140 def display @config.logger.start_data_item @config.logger.data_title "[ DOMAIN ]" @config.logger.terse "Handle", NicInfo::get_handle( @objectclass ), NicInfo::AttentionType::SUCCESS @config.logger.extra "Object Class Name", NicInfo::get_object_class_name( @objectclass, "domain", @config ) @config.logger.terse "Domain Name", NicInfo::get_ldhName( @objectclass ), NicInfo::AttentionType::SUCCESS @config.logger.datum "I18N Domain Name", NicInfo::get_unicodeName( @objectclass ), NicInfo::AttentionType::SUCCESS variants = @objectclass[ "variants" ] variant_no = 1 variants.each do |variant| relation = variant[ "relation" ] item_value = "" if relation arr = Array.new relation.each do |rel| arr << NicInfo.capitalize( rel ) end item_value = arr.join( ", " ) end @config.logger.extra "Variant #{variant_no}", item_value @config.logger.extra "IDN Table", variant[ "idnTable" ] variant_names = variant[ "variantNames" ] variant_names.each do |variant_name| @config.logger.extra "Variant Domain", NicInfo::get_ldhName( variant_name ) @config.logger.extra "Variant IDN", NicInfo::get_unicodeName( variant_name ) end if variant_names variant_no = variant_no + 1 end if variants @common.display_public_ids @objectclass @common.display_status @objectclass @common.display_events @objectclass @common.display_as_events_actors @asEventActors @common.display_port43 @objectclass @common.display_remarks @objectclass @common.display_links( get_cn, @objectclass ) secure_dns = NicInfo::get_secure_dns( @objectclass ) if secure_dns.instance_of? Array secure_dns = secure_dns[ 0 ] end if secure_dns @config.logger.terse "Zone Signed", secure_dns[ "zoneSigned" ] @config.logger.terse "Delegation Signed", secure_dns[ "delegationSigned" ] @config.logger.terse "Max Signature Life", secure_dns[ "maxSigLife" ] end @config.logger.end_data_item end |
#get_cn ⇒ Object
187 188 189 190 191 192 193 194 195 |
# File 'lib/nicinfo/domain.rb', line 187 def get_cn handle = NicInfo::get_handle @objectclass handle = NicInfo::get_ldhName @objectclass if !handle handle = "(unidentifiable domain #{object_id})" if !handle if (name = NicInfo::get_ldhName( @objectclass ) ) != nil return "#{name} ( #{handle} )" end return handle end |
#process(json_data) ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/nicinfo/domain.rb', line 110 def process json_data @objectclass = json_data @entities = @common.process_entities @objectclass json_nses = NicInfo::get_nameservers json_data json_nses.each do |json_ns| ns = @config.factory.new_ns ns.process( json_ns ) @nameservers << ns end if json_nses json_net = NicInfo::get_network json_data if json_net ip = @config.factory.new_ip ip.process json_net @network = ip end json_ds_data_objs = NicInfo::get_ds_data_objs @objectclass json_ds_data_objs.each do |json_ds| dsData = DsData.new( @config ) dsData.process( json_ds ) @ds_data_objs << dsData end if json_ds_data_objs json_key_data_objs = NicInfo::get_key_data_objs @objectclass json_key_data_objs.each do |json_key| keyData = KeyData.new( @config ) keyData.process( json_key ) @key_data_objs << keyData end if json_key_data_objs return self end |