Class ExampleApplication


  • public class ExampleApplication
    extends java.lang.Object

    An example application provided with the Dedistributed PTR (SAAS) Java SDK. This simple Java application illustrates how to integrate a Client into an application to perform PTR lookups using the Dedistributed PTR (SAAS) service.

    To try it out, you will need to have a Dedistributed PTR (SAAS) access key and secret pair. Once you have these available (after you complete registration and enrollment through the AWS Marketplace), you can edit the source of this class, compile, and run it.

    The source for this class is located below the SDK root directory in example/src/java. Edit the values assigned to the access key and secret String variables at the top of the establishSession() method. These are located at or about line 110 in the source file.

    When compiled and executed, the embedded Client establishes a session with a PLS instance. It then sends a query consisting of a set of randomly chosen IP addresses. These are resolved to PTR values by the PLS, returned, and then written to standard out.

    Visit Developer Resources for additional resources that may be of help as you integrate the service into your applications.

    See Also:
    Client, ThreadSafeClient
    • Method Summary

      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      Example main.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExampleApplication

        public ExampleApplication()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Example main. After editing and compiling the source, you can invoke the JVM from the command line. Assuming your current working directory is top directory of the SDK, you would invoke as follows:
         $ java -cp "dedistributed-ptr-saas-sdk-1.0.jar:lib/ptr-protocol.jar:example/src/java" com.dedistributed.sdk.ptr.ExampleApplication
         
        Parameters:
        args - command line arguments (none expected)
        Throws:
        java.lang.Exception - on exception