Package com.verisign.epp.codec.loginsec.v1_0

## Class EPPLoginSec

- java.lang.Object
- - com.verisign.epp.codec.loginsec.v1_0.EPPLoginSec

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

      public class EPPLoginSec
      extends java.lang.Object
      implements EPPCodecComponent

  Login Security Extension that extends an `EPPLoginCmd` to support passing a longer password (`pw`) or new password (`newPW`).
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `ELM_LOCALNAME` | XML local name for `EPPLoginSec`.
    `static java.lang.String` | `ELM_NAME` | XML root tag for `EPPLoginSec`.
    `static java.lang.String` | `LOGIN_SECURITY_PASSWORD` | Password set in the `pw` or `newPW` fields of the login command if overridden the password with the password in the extension.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EPPLoginSec()` | Default constructor for `EPPLoginSec`.
    `EPPLoginSec​(EPPLoginSecUserAgent aUserAgent)` | `EPPLoginSec` constructor that takes the client user agent.
    `EPPLoginSec​(EPPLoginSecUserAgent aUserAgent, java.lang.String aPassword)` | `EPPLoginSec` constructor that takes the password.
    `EPPLoginSec​(EPPLoginSecUserAgent aUserAgent, java.lang.String aPassword, java.lang.String aNewPassword)` | `EPPLoginSec` constructor that takes all attributes (user agent, password, and new password).

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `clone()` | Clone an `EPPCodecComponent` instance.
    `void` | `decode​(org.w3c.dom.Element aElement)` | Decode a DOM element tree to initialize the instance attributes.
    `org.w3c.dom.Element` | `encode​(org.w3c.dom.Document aDocument)` | Encode instance into a DOM element tree.
    `boolean` | `equals​(java.lang.Object aObject)` | Compare an instance of `EPPLoginSec` with this instance.
    `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.
    `EPPLoginSecUserAgent` | `getUserAgent()` | Gets the user agent.
    `boolean` | `hasNewPassword()` | Is a new password defined?
    `boolean` | `hasPassword()` | Is a password defined?
    `boolean` | `hasUserAgent()` | Is a user agent defined?
    `void` | `setNewPassword​(java.lang.String aNewPassword)` | Sets the new client password.
    `void` | `setPassword​(java.lang.String aPassword)` | Sets the client password.
    `void` | `setUserAgent​(EPPLoginSecUserAgent aUserAgent)` | Sets the user agent.
    `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

    - #### LOGIN_SECURITY_PASSWORD

          public static final java.lang.String LOGIN_SECURITY_PASSWORD

      Password set in the `pw` or `newPW` fields of the login command if overridden the password with the password in the extension.
      See Also:
        Constant Field Values

    - #### ELM_LOCALNAME

          public static final java.lang.String ELM_LOCALNAME

      XML local name for `EPPLoginSec`.
      See Also:
        Constant Field Values

    - #### ELM_NAME

          public static final java.lang.String ELM_NAME

      XML root tag for `EPPLoginSec`.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EPPLoginSec

          public EPPLoginSec()

      Default constructor for `EPPLoginSec`.

    - #### EPPLoginSec

          public EPPLoginSec​(EPPLoginSecUserAgent aUserAgent)

      `EPPLoginSec` constructor that takes the client user agent.
      Parameters:
        `aUserAgent` - Client user agent

    - #### EPPLoginSec

          public EPPLoginSec​(EPPLoginSecUserAgent aUserAgent,
                             java.lang.String aPassword)

      `EPPLoginSec` constructor that takes the password.
      Parameters:
        `aUserAgent` - Client user agent. Set to `null` if undefined.
        `aPassword` - Client password

    - #### EPPLoginSec

          public EPPLoginSec​(EPPLoginSecUserAgent aUserAgent,
                             java.lang.String aPassword,
                             java.lang.String aNewPassword)

      `EPPLoginSec` constructor that takes all attributes (user agent, password, and new password).
      Parameters:
        `aUserAgent` - Client user agent. Set to `null` if undefined.
        `aPassword` - Client password
        `aNewPassword` - New client password

  - ### Method Detail

    - #### hasUserAgent

          public boolean hasUserAgent()

      Is a user agent defined?
      Returns:
        `true` if the user agent is defined; `false` otherwise.

    - #### getUserAgent

          public EPPLoginSecUserAgent getUserAgent()

      Gets the user agent.
      Returns:
        User agent if defined; `null` otherwise.

    - #### setUserAgent

          public void setUserAgent​(EPPLoginSecUserAgent aUserAgent)

      Sets the user agent.
      Parameters:
        `aUserAgent` - User agent. Set to `null` to unset the user agent.

    - #### hasPassword

          public boolean hasPassword()

      Is a password defined?
      Returns:
        `true` if the password is defined; `false` otherwise.

    - #### 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.

    - #### hasNewPassword

          public boolean hasNewPassword()

      Is a new password defined?
      Returns:
        `true` if the new password is defined; `false` otherwise.

    - #### 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.

    - #### encode

          public org.w3c.dom.Element encode​(org.w3c.dom.Document aDocument)
                                     throws EPPEncodeException

      Encode instance into a DOM element tree. A DOM Document is passed as an argument and functions as a factory for DOM objects. The root element associated with the instance is created and each instance attribute is appended as a child node.
      Specified by:
        `encode` in interface `EPPCodecComponent`
      Parameters:
        `aDocument` - DOM Document, which acts is an Element factory
      Returns:
        Element Root element associated with the object
      Throws:
        `EPPEncodeException` - Error encoding `EPPLoginSec`

    - #### decode

          public void decode​(org.w3c.dom.Element aElement)
                      throws EPPDecodeException

      Decode a DOM element tree to initialize the instance attributes. The `aElement` argument represents the root DOM element and is used to traverse the DOM nodes for instance attribute values.
      Specified by:
        `decode` in interface `EPPCodecComponent`
      Parameters:
        `aElement` - `Element` to decode
      Throws:
        `EPPDecodeException` - Error decoding `Element`

    - #### equals

          public boolean equals​(java.lang.Object aObject)

      Compare an instance of `EPPLoginSec` with this instance.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `aObject` - Object to compare with.
      Returns:
        `true` if equal; `false` otherwise.

    - #### clone

          public java.lang.Object clone()
                                 throws java.lang.CloneNotSupportedException

      Clone an `EPPCodecComponent` instance.
      Specified by:
        `clone` in interface `EPPCodecComponent`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        clone of concrete `EPPLoginSec`
      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`.