com.verisign.epp.codec.gen

## Class EPPGreeting

- java.lang.Object
- - com.verisign.epp.codec.gen.EPPGreeting

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

      public class EPPGreeting
      extends java.lang.Object
      implements EPPMessage

  Represents an EPP Greeting message, which an EPP server uses in response to a successful connection from an EPP client. The EPP Greeting contains the following elements:
  - A <greeting> element that identifies the start of the greeting.
  - A <svID> element that contains the name of the server. Use `getServer` and `setServer` to get and set the element.
  - A <svDate> element that contains the server's current date and time in UTC. Use `getServerDate` and `setServerData` to get and set the element.
  - A <svcMenu> element that identifies the features supported by the server. Use `getServiceMenu` and `setServiceMenu` to get and set the element.
  See Also:
    `EPPFactory`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static short` | `MAX_SERVER_LEN` Maximum length of the server attribute.
    `static short` | `MIN_SERVER_LEN` Minimum length of the server attribute.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EPPGreeting()` Allocates a new `EPPGreeting` with default attribute values.
    `EPPGreeting(java.lang.String aServer, java.util.Date aServerDate, EPPServiceMenu aServiceMenu)` Allocates a new `EPPGreeting` and sets all of the instance attributes with the arguments.
    `EPPGreeting(java.lang.String aServer, java.util.Date aServerDate, EPPServiceMenu aServiceMenu, EPPDcp aDcp)` Allocates a new `EPPGreeting` and sets the name and service menu instance attributes with the arguments.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `clone()` Clone `EPPGreeting`.
    `void` | `decode(org.w3c.dom.Element aElement)` decode `EPPGreeting` from a DOM element tree.
    `org.w3c.dom.Element` | `encode(org.w3c.dom.Document aDocument)` encode `EPPGreeting` into a DOM element tree.
    `boolean` | `equals(java.lang.Object aObject)` implements a deep `EPPGreeting` compare.
    `EPPDcp` | `getDcp()` Gets the DataCollection policy associated with the server
    `java.lang.String` | `getNamespace()` Gets the associated EPP namespace.
    `java.lang.String` | `getServer()` Gets the name of the server.
    `java.util.Date` | `getServerDate()` Gets the server current date and time.
    `EPPServiceMenu` | `getServiceMenu()` Gets the service menu associated with the greeting, which defines the features supported by the server.
    `boolean` | `hasExtensionService(java.lang.String aNamespaceURI)` Does the greeting extension services include a specified extension service based on the Namespace URI?
    `boolean` | `hasService(java.lang.String aNamespaceURI)` Does the greeting include a specified service based on the Namespace URI?
    `void` | `setDcp(EPPDcp aDcp)` Sets the DataCollectionPolciy associated with the greeting, which defines the access and statement supported by the server.
    `void` | `setServer(java.lang.String aServer)` Sets the name of the server.
    `void` | `setServerDate(java.util.Date aServerDate)` Sets the server current date and time.
    `void` | `setServiceMenu(EPPServiceMenu aServiceMenu)` Sets the service menu associated with the greeting, which defines the features supported by the server.
    `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_SERVER_LEN

          public static final short MIN_SERVER_LEN

      Minimum length of the server attribute.
      See Also:
        Constant Field Values

    - #### MAX_SERVER_LEN

          public static final short MAX_SERVER_LEN

      Maximum length of the server attribute.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EPPGreeting

          public EPPGreeting()

      Allocates a new `EPPGreeting` with default attribute values. The defaults include the following:
      - server is set to `null`
      - server date is set to now
      - service menu is allocated with the default `EPPServiceMenu` constructor
      `setServer` needs to be called before `encode` when using this constructor.

    - #### EPPGreeting

          public EPPGreeting(java.lang.String aServer,
                             java.util.Date aServerDate,
                             EPPServiceMenu aServiceMenu,
                             EPPDcp aDcp)

      Allocates a new `EPPGreeting` and sets the name and service menu instance attributes with the arguments. The server date is defaulted to now.
      Parameters:
        `aServer` - name of the server
        `aServerDate` - current server date and time
        `aServiceMenu` - service menu instance associated with the greeting
        `aDcp` - Dcp instance associated with the greeting

    - #### EPPGreeting

          public EPPGreeting(java.lang.String aServer,
                             java.util.Date aServerDate,
                             EPPServiceMenu aServiceMenu)

      Allocates a new `EPPGreeting` and sets all of the instance attributes with the arguments.
      Parameters:
        `aServer` - name of the server
        `aServerDate` - current server date and time
        `aServiceMenu` - service menu instance associated with the greeting

  - ### Method Detail

    - #### getNamespace

          public java.lang.String getNamespace()

      Gets the associated EPP namespace. The general EPP namespace is returned, which is defined as `EPPCodec.NS`.
      Specified by:
        `getNamespace` in interface `EPPCodecComponent`
      Specified by:
        `getNamespace` in interface `EPPMessage`
      Returns:
        namespace URI

    - #### getServer

          public java.lang.String getServer()

      Gets the name of the server. The server length is >= `MIN_SERVER_LEN` and <= `MAX_SERVER_LEN`.
      Returns:
        server `String` instance if defined; null otherwise.

    - #### setServer

          public void setServer(java.lang.String aServer)

      Sets the name of the server. The server must be >= `MIN_SERVER_LEN` and <= `MAX_SERVER_LEN`.
      Parameters:
        `aServer` - unique server name.

    - #### getServerDate

          public java.util.Date getServerDate()

      Gets the server current date and time.
      Returns:
        Current server data and time.

    - #### setServerDate

          public void setServerDate(java.util.Date aServerDate)

      Sets the server current date and time.
      Parameters:
        `aServerDate` - Current server data and time.

    - #### getServiceMenu

          public EPPServiceMenu getServiceMenu()

      Gets the service menu associated with the greeting, which defines the features supported by the server.
      Returns:
        service menu instance associated with the greeting.

    - #### hasService

          public boolean hasService(java.lang.String aNamespaceURI)

      Does the greeting include a specified service based on the Namespace URI?
      Parameters:
        `aNamespaceURI` - Service Namespace URI to search for
      Returns:
        `true` if the greeting includes the service Namespace URI; `false` otherwise.

    - #### hasExtensionService

          public boolean hasExtensionService(java.lang.String aNamespaceURI)

      Does the greeting extension services include a specified extension service based on the Namespace URI?
      Parameters:
        `aNamespaceURI` - Extension service Namespace URI to search for
      Returns:
        `true` if the greeting extension services include the extension service Namespace URI; `false` otherwise.

    - #### setServiceMenu

          public void setServiceMenu(EPPServiceMenu aServiceMenu)

      Sets the service menu associated with the greeting, which defines the features supported by the server.
      Parameters:
        `aServiceMenu` - service menu instance to associate with the greeting.

    - #### setDcp

          public void setDcp(EPPDcp aDcp)

      Sets the DataCollectionPolciy associated with the greeting, which defines the access and statement supported by the server.
      Parameters:
        `aDcp` - service menu instance to associate with the greeting.

    - #### getDcp

          public EPPDcp getDcp()

      Gets the DataCollection policy associated with the server
      Returns:
        DataCollectionPolicy instance associated with the greeting.

    - #### encode

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

      encode `EPPGreeting` into a DOM element tree. The <greeting> element is created and the attribute nodes are appended as children.
      Specified by:
        `encode` in interface `EPPCodecComponent`
      Parameters:
        `aDocument` - DOM Document to create elements from
      Returns:
        <greeting> root element tree.
      Throws:
        `EPPEncodeException` - Error encoding the DOM element tree.

    - #### decode

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

      decode `EPPGreeting` from a DOM element tree. The "greeting" element needs to be the value of the `aElement` argument.
      Specified by:
        `decode` in interface `EPPCodecComponent`
      Parameters:
        `aElement` - <greeting> root element tree.
      Throws:
        `EPPDecodeException` - Error decoding the DOM element tree.

    - #### equals

          public boolean equals(java.lang.Object aObject)

      implements a deep `EPPGreeting` compare.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `aObject` - `EPPGreeting` instance to compare with
      Returns:
        `true` if equal; `false` otherwise.

    - #### clone

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

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