Package com.discoverydns.dnsapiclient

Examples of com.discoverydns.dnsapiclient.DNSAPIClient


        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        ZoneCreateCommand command = null;
        try {
            command = new ZoneCreateCommand.Builder()
                        .withName("myzone.com")
                        .withDnssecSigned(Boolean.FALSE)
                        .withBrandedNameServers(Boolean.TRUE)
                        .withGroup("mygroup")
                        .withNameServerSetId("<my-nss-id>")
                        .withPlanId("<my-plan-id>")
                        .withResourceRecords(
                                Sets.newHashSet(
                                        (Record) new ARecord(Name.fromString("myzone.com."), DClass.IN, 3600,
                                                InetAddress.getByName("1.2.3.4"))))
                        .build();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Send command to server and receive response
        try {
            Response<ZoneCreateResponse> response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here


        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        final AccountGetCommand command =
                new AccountGetCommand.Builder()
                        .withIdOrIdentifier("system")
                        .build();

        //Send command to server and receive response
        try {
            Response<AccountGetResponse> response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here

        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        final ZoneGetCommand command =
                new ZoneGetCommand.Builder()
                        .withId("<my-zone-id>")
                        .build();

        //Send command to server and receive response
        try {
            Response<ZoneGetResponse> response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here

        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        final NameServerSetGetCommand command =
                new NameServerSetGetCommand.Builder()
                        .withIdOrName("<my-nss-id>")
                        .build();

        //Send command to server and receive response
        try {
            Response<NameServerSetGetResponse> response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here

        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        final MessageAcknowledgeCommand command
                = new MessageAcknowledgeCommand.Builder()
                    .withId("<my-message-id>")
                    .build();

        //Send command to server and receive response
        try {
            Response<MessageAcknowledgeResponse>  response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here

    final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
    final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

    // Instantiate client instance from DNSAPIClientFactory
    final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
    DNSAPIClient client = null;
    try {
      client = dnsapiClientFactory.createInstanceFromDefaultProviders(
          config, sslConfig, logConfig);
    } catch (final Exception e) {
      e.printStackTrace();
      System.exit(1);
    }

    // Create command
    final MessagePollCommand command = new MessagePollCommand.Builder()
        .build();

    // Send command to server and receive response
    try {
      Response<MessagePollResponse> response = client.process(command);

      System.out.println("== Successful response ==");
      System.out.println("== Server transaction id: "
          + response.getServerTransactionId());
      System.out.println("== Client transaction id: "
View Full Code Here

        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        final ZoneGetZoneFileCommand command
          = new ZoneGetZoneFileCommand.Builder()
            .withId("<my-zone-id>")
          .build();
       
      //Send command to server and receive response
        try {
          Response<ZoneGetZoneFileResponse> response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here

        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        final ZoneGetQueryUsageCommand command =
                new ZoneGetQueryUsageCommand.Builder()
                        .withId("<my-zone-id>")
                        .withSearchStartDate(LocalDateTime.now(DateTimeZone.UTC))
                        .withSearchEndDate(LocalDateTime.now(DateTimeZone.UTC))
                        .withSearchGranularity(ZoneQueryUsageGranularity.hourly)
                        .withSearchGroupUsage(false)
                        .build();

        //Send command to server and receive response
        try {
            Response<ZoneGetQueryUsageResponse> response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here

    final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
    final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

    // Instantiate client instance from DNSAPIClientFactory
    final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
    DNSAPIClient client = null;
    try {
      client = dnsapiClientFactory.createInstanceFromDefaultProviders(
          config, sslConfig, logConfig);
    } catch (final Exception e) {
      e.printStackTrace();
      System.exit(1);
    }

    // Create command
    final MessageGetCommand command = new MessageGetCommand.Builder()
        .withId("<my-message-id>").build();

    // Send command to server and receive response
    try {
      Response<MessageGetResponse> response = client.process(command);

      System.out.println("== Successful response ==");
      System.out.println("== Server transaction id: "
          + response.getServerTransactionId());
      System.out.println("== Client transaction id: "
View Full Code Here

        final DefaultSSLContextFactoryConfig sslConfig = new ExampleDefaultSSLContextFactoryConfig();
        final DefaultTransactionLogHandlerConfig logConfig = new ExampleDefaultTransactionLogHandlerConfig();

        //Instantiate client instance from DNSAPIClientFactory
        final DNSAPIClientFactory dnsapiClientFactory = new DNSAPIClientFactory();
        DNSAPIClient client = null;
        try {
            client = dnsapiClientFactory.createInstanceFromDefaultProviders(config, sslConfig, logConfig);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Create command
        ZoneUpdateResourceRecordsCommand command = null;
        try {
            command = new ZoneUpdateResourceRecordsCommand.Builder()
                    .withId("<my-zone-id>")
                    .withVersion(1L)
                    .withResourceRecords(
                            Sets.newHashSet(
                                    (Record) new ARecord(Name.fromString("myzone.com."), DClass.IN, 3600,
                                            InetAddress.getByName("1.2.3.4"))))
                    .build();
        } catch (TextParseException | UnknownHostException e) {
            e.printStackTrace();
            System.exit(1);
        }

        //Send command to server and receive response
        try {
            Response<ZoneUpdateResourceRecordsResponse> response = client.process(command);

            System.out.println("== Successful response ==");
            System.out.println("== Server transaction id: " + response.getServerTransactionId());
            System.out.println("== Client transaction id: " + response.getClientTransactionId());
            System.out.println("== Processing time: " + response.getTransactionProcessingTime() + "ms");
View Full Code Here

TOP

Related Classes of com.discoverydns.dnsapiclient.DNSAPIClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.