Class EPPCredentials

  • All Implemented Interfaces:
    EPPCodecComponent, java.io.Serializable, java.lang.Cloneable

    public class EPPCredentials
    extends java.lang.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:
    EPPCommand, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MAX_PASSWORD_LEN
      Maximum length of a password.
      static int MIN_PASSWORD_LEN
      Minimum length of a password.
    • Constructor Summary

      Constructors 
      Constructor Description
      EPPCredentials()
      Allocates a new EPPCredentials with the following default attribute values:
      client id - Default of null.
      EPPCredentials​(java.lang.String aClientId, java.lang.String aPassword)
      Allocates a new EPPCredentials with the required attributes.
      EPPCredentials​(java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword)
      Allocates a new EPPCredentials with client id, password, and new password.
      EPPCredentials​(java.lang.String aClientId, java.lang.String aPassword, java.lang.String aNewPassword, java.lang.String aVersion, java.lang.String aLang)
      Allocates a new EPPCredentials with all attributes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Clone EPPCredentials.
      void decode​(org.w3c.dom.Element aElement)
      decode EPPCredentials from a DOM element tree.
      org.w3c.dom.Element encode​(org.w3c.dom.Document aDocument)
      encode EPPCredentials into a DOM element tree.
      boolean equals​(java.lang.Object aObject)
      implements a deep EPPCredentials compare.
      java.lang.String getClientId()
      Gets the client login identifier.
      java.lang.String getLang()
      Gets the desired EPP language.
      java.lang.String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      java.lang.String getNewPassword()
      Gets the new client password.
      java.lang.String getPassword()
      Gets the client password.
      java.lang.String getVersion()
      Gets the desired EPP version.
      boolean hasNewPassword()
      Is a new password defined?
      void setClientId​(java.lang.String aClientId)
      Sets the client login identifier.
      void setLang​(java.lang.String aLang)
      Sets the desired EPP language.
      void setNewPassword​(java.lang.String aNewPassword)
      Sets the new client password.
      void setPassword​(java.lang.String aPassword)
      Sets the client password.
      void setVersion​(java.lang.String aVersion)
      Sets the desired EPP version.
      java.lang.String toString()
      Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • MIN_PASSWORD_LEN

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

        public static final int MAX_PASSWORD_LEN
        Maximum length of a password.
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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​(java.lang.String aClientId,
                              java.lang.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​(java.lang.String aClientId,
                              java.lang.String aPassword,
                              java.lang.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​(java.lang.String aClientId,
                              java.lang.String aPassword,
                              java.lang.String aNewPassword,
                              java.lang.String aVersion,
                              java.lang.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 Detail

      • getClientId

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

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

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

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

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

        public void setNewPassword​(java.lang.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 java.lang.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​(java.lang.String aVersion)
        Sets the desired EPP version. The default version is set to EPPCodec.VERSION.
        Parameters:
        aVersion - EPP version identifier
      • getLang

        public java.lang.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​(java.lang.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 org.w3c.dom.Element encode​(org.w3c.dom.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​(org.w3c.dom.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​(java.lang.Object aObject)
        implements a deep EPPCredentials compare.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        aObject - EPPCredentials instance to compare with
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Clone EPPCredentials.
        Specified by:
        clone in interface EPPCodecComponent
        Overrides:
        clone in class java.lang.Object
        Returns:
        Deep copy clone of EPPCredentials
        Throws:
        java.lang.CloneNotSupportedException - standard Object.clone exception
      • toString

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

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