Class EPPHttpSession

  • Direct Known Subclasses:
    EPPPooledGenericHttpSession

    public class EPPHttpSession
    extends EPPSession
    EPPHttpSession provides behavior for communicating with an EPP Server using the HTTP protocol as the transport.
    • Constructor Detail

      • EPPHttpSession

        public EPPHttpSession​(java.lang.String aUrl)
                       throws EPPCommandException
        Construct an EPPHttpSession instance that points to the given URL. An example is https://test.vgrs.com:8080/.
        Parameters:
        aUrl - URL to connect to
        Throws:
        EPPCommandException - Error initializing the session
      • EPPHttpSession

        public EPPHttpSession​(java.lang.String aUrl,
                              EPPSSLContext aSSLContext)
                       throws EPPCommandException
        Construct an EPPHttpSession instance that points to the given URL and an EPPSSLContext. An example is https://test.vgrs.com:8080/.
        Parameters:
        aUrl - URL to connect to
        aSSLContext - Optional specific SSL context to use. Set to null if undefined.
        Throws:
        EPPCommandException - Error initializing the session
      • EPPHttpSession

        public EPPHttpSession()
                       throws EPPCommandException
        Contact an EPPHttpSession instance using the URL defined in the "EPP.ServerURL" configuration property.
        Throws:
        EPPCommandException - Error initializing the EPPHttpSession
    • Method Detail

      • getHttpClient

        public java.net.http.HttpClient getHttpClient()
        Gets the HttpClient instance.
        Returns:
        the HttpClient instance if set; null otherwise.
      • setHttpClient

        public void setHttpClient​(java.net.http.HttpClient aHttpClient)
        Sets the HttpClient instance.
        Parameters:
        aHttpClient - The HttpClient instance. Setting to null will not apply.
      • postMessage

        public EPPMessage postMessage​(EPPMessage aMessage)
                               throws EPPCommandException
        Send the message in an HTTP POST method.
        Parameters:
        aMessage - Message to send
        Returns:
        The EPP message returned, which could be an EPPGreeting or an EPPResponse.
        Throws:
        EPPCommandException - Error posting the aXml
      • processDocument

        public EPPResponse processDocument​(EPPCommand aCommand,
                                           java.lang.Class aExpectedResponse)
                                    throws EPPCommandException
        Process an EPPCommand instance posting the command and processing the response. The only mode supported is EPPSession.MODE_SYNC.
        Overrides:
        processDocument in class EPPSession
        Parameters:
        aCommand - Command to post to the server
        aExpectedResponse - Expected type of EPPResponse. If aExpectedResponse is non-null and the response is not of the specified type, than an EPPCommandException will be thrown.
        Returns:
        Response associated with passed in command
        Throws:
        EPPCommandException - error processing the command. This can include an error specified from the server or encountered while attempting to process the command. If the exception contains an EPPResponse than it was a server specified error.
      • sendDocument

        public void sendDocument​(org.w3c.dom.Document aDocument,
                                 EPPMessage aMessage)
                          throws EPPCommandException
        A no-op for the EPPHttpSession implementation.
        Overrides:
        sendDocument in class EPPSession
        Parameters:
        aDocument - Document to send
        aMessage - Message associated with newDoc that is used for packet logging logic. Set to null if unavailable.
        Throws:
        EPPCommandException - Error processing the command
      • getHttpVersion

        public static java.net.http.HttpClient.Version getHttpVersion()
                                                               throws EPPEnvException
        Returns the HTTP version to use, with the default being HTTP/2 with HttpClient.Version.HTTP_2.
        Returns:
        HTTPClient.Version value
        Throws:
        EPPEnvException - The "EPP.ServerName" property does not exist.
      • getUrl

        public java.lang.String getUrl()
        Gets the server URL to connect to.
        Returns:
        Gets the server URL to connection to if set; null otherwise.
      • setUrl

        public void setUrl​(java.lang.String aUrl)
        Sets the server URL to connect to.
        Parameters:
        aUrl - Server URL to
      • getGreeting

        public EPPGreeting getGreeting()
        Gets the EPP Greeting received when making the connection.
        Returns:
        The EPP Greeting if set; null otherwise.