Class EPPHost

java.lang.Object
com.verisign.epp.interfaces.EPPHost
Direct Known Subclasses:
NSHost, RZHost

public class EPPHost extends Object
EPPHost is the primary client interface class used for host management. An instance of EPPHost 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.host package.
See Also:
  • Field Details

  • Constructor Details

    • EPPHost

      public EPPHost(EPPSession newSession)
      Constructs an EPPHost given an initialized EPP session.
      Parameters:
      newSession - 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
    • setExtension

      @Deprecated public void setExtension(EPPCodecComponent aExtension)
      Deprecated.
      Replaced by addExtension(EPPCodecComponent). This method will add the extension as is done in addExtension(EPPCodecComponent).
      Sets a command extension object.
      Parameters:
      aExtension - command extension object associated with the command
    • setExtensions

      public void setExtensions(Vector<EPPCodecComponent> aExtensions)
      Sets the command extension objects.
      Parameters:
      aExtensions - command extension objects associated with the command
    • getExtensions

      public Vector<EPPCodecComponent> getExtensions()
      Gets the command extensions.
      Returns:
      Vector of concrete EPPCodecComponent associated with the command if exists; null otherwise.
    • addHostName

      public void addHostName(String newHostName)
      Adds a host name for use with a send method. Adding more than one host name is only supported by sendCheck.
      Parameters:
      newHostName - Host name to add
    • getNewName

      public String getNewName()
      Gets the new name for the host.
      Returns:
      New host name if defined; null otherwise.
    • setNewName

      public void setNewName(String aNewName)
      Sets the new name for the host.
      Parameters:
      aNewName - New host name
    • addIPV4Address

      public void addIPV4Address(String newIPV4Address)
      Adds an IPV4 IP Address to the host.
      Parameters:
      newIPV4Address - IPV4 IP Address
    • removeIPV4Address

      public void removeIPV4Address(String newIPV4Address)
      Removes an IPV4 IP Address from the host.
      Parameters:
      newIPV4Address - IPV4 IP Address
    • addIPV6Address

      public void addIPV6Address(String newIPV6Address)
      Adds an IPV6 address to the host
      Parameters:
      newIPV6Address - IPV6 Address
    • removeIPV6Address

      public void removeIPV6Address(String newIPV6Address)
      Removes an IPV6 address from the host
      Parameters:
      newIPV6Address - IPV6 Address
    • addStatus

      public void addStatus(String aStatus)
      Adds a status to the host.
      Parameters:
      aStatus - One of the STAT_ constants
    • removeStatus

      public void removeStatus(String aStatus)
      Removes a status from the host.
      Parameters:
      aStatus - One of the STAT_ constants
    • addStatus

      public void addStatus(String aStatus, String aDesc, String aLang)
      Adds a status to the host with a description.
      Parameters:
      aStatus - One of the STAT_ constants
      aDesc - Description of the rationale for the status change
      aLang - Language of aDesc Use DEFAULT_LANG for the default language ("us").
    • removeStatus

      public void removeStatus(String aStatus, String aDesc, String aLang)
      Removes a status from the host with a description.
      Parameters:
      aStatus - One of the STAT_ constants
      aDesc - Description of the rationale for the status change
      aLang - Language of aDesc Use DEFAULT_LANG for the default language ("us").
    • setTransId

      public void setTransId(String newTransId)
      Sets the client transaction identifier.
      Parameters:
      newTransId - Client transaction identifier
    • 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
    • sendCreate

      public EPPResponse sendCreate() throws EPPCommandException
      Sends a Host Create Command to the server.

      The required attributes have been set with the following methods:

      • addHostName - Sets the host name to create. Only one host name is valid.


      The optional attributes have been set with the following:

      • setTransId - Sets the client transaction identifier
      • addIPV4Address - Add an IPV4 Address
      • addIPV6Address - Add an IPV6 Address
      Returns:
      EPPResponse containing the Host create result.
      Throws:
      EPPCommandException - Error executing the create command. Use getResponse to get the associated server error response.
    • sendCheck

      public EPPHostCheckResp sendCheck() throws EPPCommandException
      Sends a Host Check Command to the server.

      The required attributes have been set with the following methods:

      • addHostName - Adds a host name to check. More than one host name can be checked in sendCheck


      The optional attributes have been set with the following:

      • setTransId - Sets the client transaction identifier
      Returns:
      EPPHostCheckResp containing the Host check information.
      Throws:
      EPPCommandException - Error executing the check command. Use getResponse to get the associated server error response.
    • sendInfo

      public EPPHostInfoResp sendInfo() throws EPPCommandException
      Sends a Host Info Command to the server.

      The required attributes have been set with the following methods:

      • addHostName - Sets the host name to get info for. Only one host name is valid.


      The optional attributes have been set with the following:

      • setTransId - Sets the client transaction identifier
      Returns:
      EPPHostInfoResp containing the Host information.
      Throws:
      EPPCommandException - Error executing the info command. Use getResponse to get the associated server error response.
    • sendUpdate

      public EPPResponse sendUpdate() throws EPPCommandException
      Sends a Host Update Command to the server.

      The required attributes have been set with the following methods:

      • addHostName - Sets the domain name to update. Only one domain name is valid.


      The optional attributes have been set with the following:

      • setTransId - Sets the client transaction identifier
      • addIPV4Address - Adds IPV4 Address
      • addIPV6Address - Adds IPV6 Address
      • removeIPV4Address - Removes IPV4 Address
      • removeIPV6Address - Removes IPV6 Address
      • addStatus - Add status
      • removeStatus - Remove status
      • setNewName - Renames the host
      At least one update attribute needs to be set.
      Returns:
      EPPResponse containing the Host update result.
      Throws:
      EPPCommandException - Error executing the update command. Use getResponse to get the associated server error response.
    • sendDelete

      public EPPResponse sendDelete() throws EPPCommandException
      Sends a Host Delete Command to the server.

      The required attributes have been set with the following methods:

      • addHostName - Sets the host name to delete. Only one host name is valid.


      The optional attributes have been set with the following:

      • setTransId - Sets the client transaction identifier
      Returns:
      EPPResponse containing the delete result information.
      Throws:
      EPPCommandException - Error executing the delete command. Use getResponse to get the associated server error response.
    • resetHost

      protected void resetHost()
      Resets the host instance to its initial state.