Class EPPHostCreateCmd

All Implemented Interfaces:
EPPCodecComponent, EPPMessage, Serializable, Cloneable

public class EPPHostCreateCmd extends EPPCreateCmd
Represents an EPP Host <create> command, which provides a transform operation that allows a client to create a host object. The <host:create> element MUST contain the following child elements:

  • A <host:name> element that contains the fully qualified host name of the object to be created. Use getName and setName to get and set the element.
  • Zero or more <host:addr> elements that contain the IP addresses to be associated with the host. If the host name exists in a name space for which the server is not authoritative, then the superordinate domain of the host MUST be known to the server before the host object can be created. For example, if the server is authoritative for the ".com" name space and the name of the server is "ns1.example.com.au", the server is not required to produce DNS glue records for the name server and IP addresses for the server are not required by the DNS.

It is important to note that the transaction identifier associated with successful creation of a host object becomes the authorization identifier return in the <info-data> of a EPP Host <info> response and most likely will be required for future transform operations. A client MUST retain all transaction identifiers associated with host object creation and protect them from disclosure. A client MUST also provide a copy of the transaction identifier information to the host registrant, who will need this information to request a host transfer through a different client.

EPPReponse is the response associated with EPPHostCreateCmd.
See Also:
  • Field Details

  • Constructor Details

    • EPPHostCreateCmd

      public EPPHostCreateCmd()
      Allocates a new EPPHostCreateCmd with default attribute values. the defaults include the following:

      • name is set to null
      • addresses is set to to null
      • transaction id is set to null.

      The name must be set before invoking encode.
    • EPPHostCreateCmd

      public EPPHostCreateCmd(String aTransId, String aName)
      Allocates a new EPPHostCreateCmd with a host name. The other attributes are initialized as follows:

      • addresses is set to null
      Parameters:
      aTransId - Transaction Id associated with command.
      aName - Host name
    • EPPHostCreateCmd

      public EPPHostCreateCmd(String aTransId, String aName, Vector<EPPHostAddress> aAddresses)
      Allocates a new EPPHostCreateCmd with all attributes specified by the arguments.
      Parameters:
      aTransId - Transaction Id associated with command.
      aName - Host name
      aAddresses - Vector of EPPHostAddress instances.
  • Method Details

    • getNamespace

      public String getNamespace()
      Get the EPP command Namespace associated with EPPHostCreateCmd.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Specified by:
      getNamespace in interface EPPMessage
      Specified by:
      getNamespace in class EPPCommand
      Returns:
      EPPHostMapFactory.NS
    • getKey

      public String getKey()
      Gets the key for the host object, which is the host name.
      Overrides:
      getKey in class EPPCommand
      Returns:
      The host name if set; null otherwise.
    • doEncode

      protected Element doEncode(Document aDocument) throws EPPEncodeException
      Encode a DOM Element tree from the attributes of the EPPHostCreateCmd instance.
      Specified by:
      doEncode in class EPPCreateCmd
      Parameters:
      aDocument - - DOM Document that is being built. Used as an Element factory.
      Returns:
      Root DOM Element representing the EPPHostCreateCmd instance.
      Throws:
      EPPEncodeException - Unable to encode EPPHostCreateCmd instance.
    • doDecode

      protected void doDecode(Element aElement) throws EPPDecodeException
      Decode the EPPHostCreateCmd attributes from the aElement DOM Element tree.
      Specified by:
      doDecode in class EPPCreateCmd
      Parameters:
      aElement - - Root DOM Element to decode EPPHostCreateCmd from.
      Throws:
      EPPDecodeException - Unable to decode aElement
    • getName

      public String getName()
      Get the host name to create.
      Returns:
      Host Name
    • setName

      public void setName(String aName)
      Set the host name to create.
      Parameters:
      aName - Host Name
    • hasAddresses

      public boolean hasAddresses()
      Are addresses set?
      Returns:
      true if addresses are set; false otherwise.
    • addAddress

      public void addAddress(EPPHostAddress aAddress)
      Add an address to the list of addresses.
      Parameters:
      aAddress - Address to add
    • getAddresses

      public Vector<EPPHostAddress> getAddresses()
      Gets the host addresses.
      Returns:
      Vector of EPPHostAddress instances if defined; null otherwise.
    • setAddresses

      public void setAddresses(Vector<EPPHostAddress> aAddresses)
      Sets the host addresses.
      Parameters:
      aAddresses - Vector of EPPHostAddress instances.
    • equals

      public boolean equals(Object aObject)
      Compare an instance of EPPHostCreateCmd with this instance.
      Overrides:
      equals in class EPPCreateCmd
      Parameters:
      aObject - Object to compare with.
      Returns:
      true if equal; false otherwise.
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPHostCreateCmd.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class EPPCommand
      Returns:
      clone of EPPHostCreateCmd
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • toString

      public String toString()
      Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
      Overrides:
      toString in class EPPCommand
      Returns:
      Indented XML String if successful; ERROR otherwise.