Class EPPDomainAddRemove

java.lang.Object
com.verisign.epp.codec.domain.EPPDomainAddRemove
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable

public class EPPDomainAddRemove extends Object implements EPPCodecComponent
Represents attributes to add, remove or change with a EPPDomainUpdateCmd. In EPPDomainUpdateCmd, an instance of EPPDomainAddRemove is used to specify the attributes to add; an instance of EPPDomainAddRemove is used to specify the attributes to remove, and an instance of EPPDomainAddRemove is used to specify the attributes to change

The Domain Mapping Specification describes the following attributes:
  • Zero or more <domain:ns> elements that contain the fully qualified host name of a known host object. Use getServers and setServers to get and set the element.
  • Zero or more <domain:contact> elements that contain the registrant, administrative, technical, and billing contact identifiers to be associated with the domain. Use getContacts and setContacts to get and set the element. This attribute will only be allowed if the Contact Mapping is supported.
  • One or two <domain:status> elements that contain status values to be applied to or removed from the domain object. Use getStatuses and setStatuses to get and set the element.
  • For change only, A <domain:registrant> element that contains the identifier for the human or organizational social information (contact) object to be associated with the domain object as the object registrant. This object identifier MUST be known to the server before the contact object can be associated with the domain object. Use getRegistrant and setRegistrant to get and set the element.

It is important to note that the maximum number of domain attribute elements is subject to the number of values currently associated with the domain object. EPPDomainAddRemove will delegate the validation of the cardinality of the domain attributes elements to the EPP Server.
See Also:
  • Field Details

    • MODE_ADD

      public static final short MODE_ADD
      mode of EPPDomainAddRemove is to add attributes.
      See Also:
    • MODE_REMOVE

      public static final short MODE_REMOVE
      mode of EPPDomainAddRemove is to remove attributes.
      See Also:
  • Constructor Details

    • EPPDomainAddRemove

      public EPPDomainAddRemove()
      Default constructor for EPPDomainAddRemove. All of the attribute default to null to indicate no modification.
    • EPPDomainAddRemove

      public EPPDomainAddRemove(Vector<?> aServers, Vector<EPPDomainContact> aContacts, Vector<EPPDomainStatus> aStatuses)
      Constructor for EPPDomainAddRemove that includes the attributes as arguments.
      Parameters:
      aServers - Vector of Name Server that are either name server String or EPPHostAttr objects. Is null or empty for no modifications.
      aContacts - Vector of EPPDomainContact instances. Is null or empty for no modifications. If the Contact Mapping is not supported, this value should be null.
      aStatuses - Vector of EPPDomainStatus instances. Is null or empty for no modifications.
    • EPPDomainAddRemove

      public EPPDomainAddRemove(String aRegistrant, EPPAuthInfo aAuthInfo)
      Constructor for EPPDomainAddRemove that includes the attributes as arguments.
      Parameters:
      aRegistrant - String registrant for the change mode
      aAuthInfo - EPPAuthInfo authorization information for the change mode
  • Method Details

    • hasServers

      public boolean hasServers()
      Are name servers set?
      Returns:
      true if name servers are set; false otherwise.
    • addServer

      public void addServer(String aServer)
      Add a name server to the list of name servers.
      Parameters:
      aServer - Name server to add
    • addServer

      public void addServer(EPPHostAttr aServer)
      Add a name server host attribute to the list of name servers.
      Parameters:
      aServer - Name server to add
    • getServers

      public Vector<?> getServers()
      Gets the name servers. The name servers can either be String instances containing the fully qualified name of a known name server host object, or EPPHostAttr instances containing the fully qualified name of a host and optionally the host IP addresses.
      Returns:
      Vector of name server String instances for host object references or EPPHostAttr instances for host attribute values if exists; null otherwise.
    • setServers

      public void setServers(Vector<?> aServers)
      Sets the name servers. The name servers can either be String instances containing the fully qualified name of a known name server host object, or EPPHostAttr instances containing the fully qualified name of a host and optionally the host IP addresses.
      Parameters:
      aServers - Vector of name server String instances for host object references or EPPHostAttr instances for host attribute values.
    • hasContacts

      public boolean hasContacts()
      Are contacts set?
      Returns:
      true if contacts are set; false otherwise.
    • addContact

      public void addContact(EPPDomainContact aContact)
      Add a contact to the list of contacts.
      Parameters:
      aContact - Contact to add
    • getContacts

      public Vector<EPPDomainContact> getContacts()
      Gets the contacts to add or remove.
      Returns:
      Vector of EPPDomainContact instances if set; null otherwise.
    • setContacts

      public void setContacts(Vector<EPPDomainContact> aContacts)
      Sets the contacts to add or remove.
      Parameters:
      aContacts - The contacts to add or remove.
    • hasStatuses

      public boolean hasStatuses()
      Are statuses set?
      Returns:
      true if statuses are set; false otherwise.
    • addStatus

      public void addStatus(EPPDomainStatus aStatus)
      Add a status to the list of statuses.
      Parameters:
      aStatus - Status to add
    • getStatuses

      public Vector<EPPDomainStatus> getStatuses()
      Gets the statuses to add or remove.
      Returns:
      Vector of status EPPDomainStatus instances if set; null otherwise.
    • setStatuses

      public void setStatuses(Vector<EPPDomainStatus> aStatuses)
      Sets the statuses to add or remove.
      Parameters:
      aStatuses - Vector of status EPPDomainStatus instances.
    • contactsSupported

      public boolean contactsSupported()
      Return if Domain Contacts is supported.
      Returns:
      true if contacts are supported; false otherwise.
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Encode a DOM Element tree from the attributes of the EPPDomainAddRemove instance.
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - DOM Document that is being built. Used as an Element factory.
      Returns:
      Root DOM Element representing the EPPDomainAddRemove instance.
      Throws:
      EPPEncodeException - Unable to encode EPPDomainAddRemove instance.
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Decode the EPPDomainAddRemove attributes from the aElement DOM Element tree.
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - Root DOM Element to decode EPPDomainAddRemove from.
      Throws:
      EPPDecodeException - Unable to decode aElement.
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPDomainAddRemove compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPDomainAddRemove instance to compare with
      Returns:
      true when equal; false otherwise.
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPDomainAddRemove.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPDomainAddRemove
      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 Object
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • hasAuthInfo

      public boolean hasAuthInfo()
      Is the authorization information set?
      Returns:
      true if the authorization information is set; false otherwise.
    • getAuthInfo

      public EPPAuthInfo getAuthInfo()
      Get authorization information for the change mode
      Returns:
      EPPAuthInfo if set; null otherwise.
    • setAuthInfo

      public void setAuthInfo(EPPAuthInfo aAuthInfo)
      Set authorization information for the change mode
      Parameters:
      aAuthInfo - EPPAuthInfo instance. Pass null to unset it.
    • hasRegistrant

      public boolean hasRegistrant()
      is the registrant set?
      Returns:
      true if the registrant is set; false otherwise.
    • getRegistrant

      public String getRegistrant()
      Get registrant for the change mode
      Returns:
      Registrant if set; null otherwise.
    • setRegistrant

      public void setRegistrant(String aRegistrant)
      Set registrant for the change mode.
      Parameters:
      aRegistrant - Registrant to set. Pass null to unset it.
    • isEmpty

      public boolean isEmpty()
      Is the EPPDomainAddRemove empty?
      Returns:
      true if all of the attributes are not set; false otherwise.
    • getNamespace

      public String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Returns:
      XML namespace for the EPPCodecComponent.