Class EPPAuthToken

java.lang.Object
com.verisign.epp.interfaces.authtoken.v01.EPPAuthToken

public class EPPAuthToken extends Object
EPPAuthToken is the primary client interface class used for authToken management. An instance of EPPAuthToken is created with an initialized EPPSession, and can be used for more than one request within a single thread. A set of setter methods are provided to set the attributes before a call to one of the send action methods. The responses returned from the send action methods are either instances of EPPResponse or instances of response classes in the com.verisign.epp.codec.authtoken.v01 package.
  • Constructor Details

    • EPPAuthToken

      public EPPAuthToken(EPPSession session)
      Constructs an EPPAuthToken given an initialized session.
      Parameters:
      session - Server session to use.
  • Method Details

    • addExtension

      public void addExtension(EPPCodecComponent aExtension)
      Adds a command extension object.
      Parameters:
      aExtension - command extension object associated with the command
    • setPayload

      public void setPayload(EPPAuthTokenPayload aPayload)
      Sets the payload for this auth token.
      Parameters:
      aPayload - Payload associated with the auth token message
    • getPayload

      public EPPAuthTokenPayload getPayload()
      Returns the payload that was set
      Returns:
      instance of EPPAuthTokenPayload object
    • getHeader

      public EPPAuthTokenHeader getHeader()
      Returns get header that was set.
      Returns:
      instance of EPPAuthTokenHeader object.
    • setHeader

      public void setHeader(EPPAuthTokenHeader aHeaderStr)
      Sets the header for this auth token.
      Parameters:
      aHeaderStr - instance of EPPAuthTokenHeader object
    • hasAuthTokenData

      public boolean hasAuthTokenData()
      Is there any AuthTokenData contained in EPPAuthTokenCreateCmd?
      Returns:
      true if list of EPPAuthTokenData is not null and not empty; false otherwise.
    • getAuthTokenDataList

      public List<EPPAuthTokenData> getAuthTokenDataList()
      Returns the AuthTokenData list.
      Returns:
      List of auth tokens EPPAuthTokenData instances if defined; null otherwise.
    • setAuthTokenDataList

      public void setAuthTokenDataList(List<EPPAuthTokenData> aAuthTokenData)
      Sets the List of auth token data EPPAuthTokenData instances to send
      Parameters:
      aAuthTokenData - List of EPPAuthTokenData instances
    • getCredential

      public EPPAuthTokenCredential getCredential()
      Returns credential data that was set
      Returns:
    • setCredential

      public void setCredential(EPPAuthTokenCredential credential)
      Set an instance of EPPAuthTokenCredential data
      Parameters:
      credential -
    • setTransId

      public void setTransId(String aTransId)
      Sets the client transaction identifier.
      Parameters:
      aTransId - Client transaction identifier
    • addAuthTokenData

      public void addAuthTokenData(EPPAuthTokenData aData)
      Appends to the List of auth token data EPPAuthTokenData instances to send.
      Parameters:
      aData - EPPAuthTokenData instance
    • getRevokedReason

      public String getRevokedReason()
      Get the reason to revoke this token
      Returns:
      Reason
    • setRevokedReason

      public void setRevokedReason(String revokedReason)
      Sets the reason to revoke this token
      Parameters:
      revokedReason - reason as a string
    • getDomains

      public List<String> getDomains()
      Returns set of domains for which this auth token is scoped to.
      Returns:
      java.util.List of domain name strings.
    • setDomains

      public void setDomains(List<String> domains)
      Set domains for which this auth token is scoped to.
      Parameters:
      domains - java.util.List of domain name strings.
    • getSystems

      public List<String> getSystems()
      Returns set of systems for which this auth token is scoped to.
      Returns:
      java.util.List of system name strings.
    • setSystems

      public void setSystems(List<String> systems)
      Set systems for which this auth token is scoped to.
      Parameters:
      systems - java.util.List of system name strings.
    • sendCheck

      public EPPAuthTokenCheckResp sendCheck() throws EPPCommandException
      Sends a Auth Token Check Command to the server.

      The required attributes have been set with the following methods:



      The optional attributes can be set with the following:

      Returns:
      EPPAuthTokenCheckResp containing the auth token check information.
      Throws:
      EPPCommandException - Error executing the check command. Use getResponse to get the associated server error response.
    • sendInfo

      public EPPAuthTokenInfoResp sendInfo() throws EPPCommandException
      Sends an Auth Token Info Command to the server.

      The required attributes have been set with the following methods:



      The optional attributes have been set with the following:

      Returns:
      EPPAuthTokenInfoResp containing the auth token information.
      Throws:
      EPPCommandException - Error executing the info command. Use getResponse to get the associated server error response.
    • sendDelete

      public EPPResponse sendDelete() throws EPPCommandException
      Sends an Auth Token Delete Command to the server.

      The required attributes have been set with the following methods:



      The optional attributes have been set with the following:

      Returns:
      EPPResponse containing the delete result information.
      Throws:
      EPPCommandException - Error executing the delete command. Use getResponse to get the associated server error response.
    • sendCreate

      public EPPAuthTokenCreateResp sendCreate() throws EPPCommandException
      Sends an Auth Token Create Command to the server.

      The required attributes have been set with the following methods:

      • setCredential - Sets the credential information to authorize creation of the auth token data


      The optional attributes have been set with the following:

      • setTransId - Sets the client transaction identifier
      Returns:
      EPPAuthTokenCreateResp containing the result of inserting the auth token data
      Throws:
      EPPCommandException - Error executing the create command. Use getResponse to get the associated server error response.
    • resetAuthToken

      protected void resetAuthToken()
      Resets the auth token instance to its initial state.
    • getResponse

      public EPPResponse getResponse()
      Gets the response associated with the last command. This method can be used to retrieve the server error response in the catch block of EPPCommandException.
      Returns:
      Response associated with the last command