Class EPPCredentials

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

public class EPPCredentials extends Object implements EPPCodecComponent
Represents the optional <creds> element in an EPP Command. A "cred" element SHALL contain the following child elements:
  • A "clID" element that contains the client identifier assigned to the client by the server. The value of this element is case insensitive. Use getClientId and setClientId to get and set the element.
  • A "pw" element that contains the client's plain text password. Use getPassword and setPassword to get and set the element.
  • An OPTIONAL "newPW" element that contains a new plain text password to be assigned to the client for use with subsequent "login" commands. The value of this element is case sensitive. Use getNewPassword and setNewPassword to get and set the element.
  • An "options" element that contains the "version" and "lang" elements. Use getVersion and setVersion to get and set the version. Use getLang and setLang to get and set the language.
See Also:
  • Field Details

    • MIN_PASSWORD_LEN

      public static final int MIN_PASSWORD_LEN
      Minimum length of a password.
      See Also:
    • MAX_PASSWORD_LEN

      public static final int MAX_PASSWORD_LEN
      Maximum length of a password.
      See Also:
  • Constructor Details

    • EPPCredentials

      public EPPCredentials()
      Allocates a new EPPCredentials with the following default attribute values:
      • client id - Default of null. Set with setClientId
      • password - Default of null. Set with setPassword
      • new password - Default of null. Set with setNewPassword
      • version - Default of EPPCodec.VERSION. Set with setVersion
      • language - Default of "en". Set with setLang
    • EPPCredentials

      public EPPCredentials(String aClientId, String aPassword)
      Allocates a new EPPCredentials with the required attributes. The other attributes are initialized as follows:

      • new password - Default of null. Set with setNewPassword
      • version - Default of EPPCodec.VERSION. Set with setVersion
      • language - Default of "en". Set with setLang
      Parameters:
      aClientId - Client login id
      aPassword - Client password
    • EPPCredentials

      public EPPCredentials(String aClientId, String aPassword, String aNewPassword)
      Allocates a new EPPCredentials with client id, password, and new password. The other attributes are initialized as follows:

      • version - Default of EPPCodec.VERSION. Set with setVersion
      • language - Default of "en". Set with setLang
      Parameters:
      aClientId - Client login id
      aPassword - Client password
      aNewPassword - Client new password
    • EPPCredentials

      public EPPCredentials(String aClientId, String aPassword, String aNewPassword, String aVersion, String aLang)
      Allocates a new EPPCredentials with all attributes.
      Parameters:
      aClientId - Client login id
      aPassword - Client password
      aNewPassword - Client new password
      aVersion - EPP protocol version desired by Client
      aLang - Desired language for result messages
  • Method Details

    • getClientId

      public String getClientId()
      Gets the client login identifier.
      Returns:
      Client login identifier if defined; null otherwise.
    • setClientId

      public void setClientId(String aClientId)
      Sets the client login identifier.
      Parameters:
      aClientId - Client login identifier.
    • getPassword

      public String getPassword()
      Gets the client password.
      Returns:
      Client password if defined; null otherwise.
    • setPassword

      public void setPassword(String aPassword)
      Sets the client password.
      Parameters:
      aPassword - Client password.
    • getNewPassword

      public String getNewPassword()
      Gets the new client password.
      Returns:
      New client password if defined; null otherwise.
    • setNewPassword

      public void setNewPassword(String aNewPassword)
      Sets the new client password.
      Parameters:
      aNewPassword - New client password.
    • hasNewPassword

      public boolean hasNewPassword()
      Is a new password defined?
      Returns:
      true if the new password is defined; false otherwise.
    • getVersion

      public String getVersion()
      Gets the desired EPP version. The default version is set to EPPCodec.VERSION.
      Returns:
      EPP version identifier if defined; null otherwise.
    • setVersion

      public void setVersion(String aVersion)
      Sets the desired EPP version. The default version is set to EPPCodec.VERSION.
      Parameters:
      aVersion - EPP version identifier
    • getLang

      public String getLang()
      Gets the desired EPP language. The EPP language determines the language of the error description strings and should be one of the supported languages of the EPPGreeting. The default language is "en".
      Returns:
      The desired EPP language if defined; null otherwise.
    • setLang

      public void setLang(String aLang)
      Sets the desired EPP language. The EPP language determines the language of the error description strings and should be one of the supported languages of the EPPGreeting. The default language is "en".
      Parameters:
      aLang - The desired EPP language
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      encode EPPCredentials into a DOM element tree.
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - DOM document used as a factory of DOM objects.
      Returns:
      Encoded DOM element.
      Throws:
      EPPEncodeException - Error encoding the DOM element tree.
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      decode EPPCredentials from a DOM element tree. The aElement argument needs to be the "trans-id" element, or an element that conforms to the XML structure of "trans-id".
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - The "trans-id" XML element.
      Throws:
      EPPDecodeException - Error decoding the DOM element tree.
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPCredentials compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPCredentials instance to compare with
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPCredentials.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      Deep copy clone of EPPCredentials
      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.
    • getNamespace

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