655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
|
# File 'lib/nicinfo/nicinfo_main.rb', line 655
def display_rdap_query json_data, show_help = true
if @config.options.output_json
@config.logger.raw( DataAmount::TERSE_DATA, JSON.generate( json_data ), false )
elsif @config.options.json_values
@config.options.json_values.each do |value|
@config.logger.raw( DataAmount::TERSE_DATA, JSON.generate( eval_json_value( value, json_data) ), false )
end
else
@config.factory.new_notices.display_notices json_data, @config.options.query_type == QueryType::BY_SERVER_HELP
if @config.options.query_type != QueryType::BY_SERVER_HELP
result_type = get_query_type_from_result( json_data )
if result_type != nil
if result_type != @config.options.query_type
@config.logger.mesg( "Query type is " + @config.options.query_type + ". Result type is " + result_type + "." )
else
@config.logger.mesg( "Result type is " + result_type + "." )
end
@config.options.query_type = result_type
elsif json_data[ "errorCode" ] == nil
@config.conf_msgs << "Response has no result type."
end
data_tree = DataTree.new( )
case @config.options.query_type
when QueryType::BY_IP4_ADDR
NicInfo::display_ip( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NETWORK )
when QueryType::BY_IP6_ADDR
NicInfo::display_ip( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NETWORK )
when QueryType::BY_IP4_CIDR
NicInfo::display_ip( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NETWORK )
when QueryType::BY_IP6_CIDR
NicInfo::display_ip( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NETWORK )
when QueryType::BY_IP
NicInfo::display_ip( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NETWORK )
when QueryType::BY_AS_NUMBER
NicInfo::display_autnum( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_AUTNUM )
when "NicInfo::DsData"
NicInfo::display_ds_data( json_data, @config, data_tree )
when "NicInfo::KeyData"
NicInfo::display_key_data( json_data, @config, data_tree )
when QueryType::BY_DOMAIN
NicInfo::display_domain( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_DOMAIN )
when QueryType::BY_NAMESERVER
NicInfo::display_ns( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NAMESERVER )
when QueryType::BY_ENTITY_HANDLE
NicInfo::display_entity( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_ENTITY )
when QueryType::SRCH_DOMAINS
NicInfo::display_domains( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_DOMAIN_SEARCH )
when QueryType::SRCH_DOMAIN_BY_NAME
NicInfo::display_domains( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_DOMAIN_SEARCH )
when QueryType::SRCH_DOMAIN_BY_NSNAME
NicInfo::display_domains( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_DOMAIN_SEARCH )
when QueryType::SRCH_DOMAIN_BY_NSIP
NicInfo::display_domains( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_DOMAIN_SEARCH )
when QueryType::SRCH_ENTITY_BY_NAME
NicInfo::display_entities( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_ENTITY_SEARCH )
when QueryType::SRCH_NS
NicInfo::display_nameservers( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NAMESERVER_SEARCH )
when QueryType::SRCH_NS_BY_NAME
NicInfo::display_nameservers( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NAMESERVER_SEARCH )
when QueryType::SRCH_NS_BY_IP
NicInfo::display_nameservers( json_data, @config, data_tree )
do_jcr( json_data, NicInfo::JCR_ROOT_NAMESERVER_SEARCH )
end
@config.save_as_yaml( NicInfo::LASTTREE_YAML, data_tree ) if !data_tree.empty?
show_search_results_truncated json_data
show_conformance_messages
show_helpful_messages json_data, data_tree if show_help
end
end
@config.logger.end_run
end
|