com.verisign.epp.interfaces

## Class EPPHost

- java.lang.Object
- - com.verisign.epp.interfaces.EPPHost

- Direct Known Subclasses:
    NSHost

      public class EPPHost
      extends java.lang.Object

  `EPPHost` is the primary client interface class used for host management. An instance of `EPPHost` is created with an initialized `EPPSession`, and can be used for more than one request within a single thread. A set of setter methods are provided to set the attributes before a call to one of the send action methods. The responses returned from the send action methods are either instances of `EPPResponse` or instances of response classes in the `com.verisign.epp.codec.host` package.
  Version:
    $Revision: 1.5 $
  Author:
    $Author: jim $
  See Also:
    `EPPResponse`, `EPPHostCreateResp`, `EPPHostInfoResp`, `EPPHostCheckResp`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_LANG` Default language for status descriptions
    `static java.lang.String` | `STAT_CLIENT_DELETE_PROHIBITED` DOCUMENT ME!
    `static java.lang.String` | `STAT_CLIENT_UPDATE_PROHIBITED` DOCUMENT ME!
    `static java.lang.String` | `STAT_LINKED` DOCUMENT ME!
    `static java.lang.String` | `STAT_OK` DOCUMENT ME!
    `static java.lang.String` | `STAT_PENDING_CREATE` DOCUMENT ME!
    `static java.lang.String` | `STAT_PENDING_DELETE` DOCUMENT ME!
    `static java.lang.String` | `STAT_PENDING_TRANSFER` DOCUMENT ME!
    `static java.lang.String` | `STAT_PENDING_UPDATE` DOCUMENT ME!
    `static java.lang.String` | `STAT_SERVER_DELETE_PROHIBITED` DOCUMENT ME!
    `static java.lang.String` | `STAT_SERVER_UPDATE_PROHIBITED` DOCUMENT ME!

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EPPHost(EPPSession newSession)` Constructs an `EPPHost` given an initialized EPP session.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addExtension(EPPCodecComponent aExtension)` Adds a command extension object.
    `void` | `addHostName(java.lang.String newHostName)` Adds a host name for use with a `send` method.
    `void` | `addIPV4Address(java.lang.String newIPV4Address)` Adds an IPV4 IP Address to the host.
    `void` | `addIPV6Address(java.lang.String newIPV6Address)` Adds an IPV6 address to the host
    `void` | `addStatus(java.lang.String aStatus)` Adds a status to the host.
    `void` | `addStatus(java.lang.String aStatus, java.lang.String aDesc, java.lang.String aLang)` Adds a status to the host with a description.
    `java.util.Vector` | `getExtensions()` Gets the command extensions.
    `java.lang.String` | `getNewName()` Gets the new name for the host.
    `EPPResponse` | `getResponse()` Gets the response associated with the last command.
    `void` | `removeIPV4Address(java.lang.String newIPV4Address)` Removes an IPV4 IP Address from the host.
    `void` | `removeIPV6Address(java.lang.String newIPV6Address)` Removes an IPV6 address from the host
    `void` | `removeStatus(java.lang.String aStatus)` Removes a status from the host.
    `void` | `removeStatus(java.lang.String aStatus, java.lang.String aDesc, java.lang.String aLang)` Removes a status from the host with a description.
    `protected void` | `resetHost()` Resets the host instance to its initial state.
    `EPPHostCheckResp` | `sendCheck()` Sends a Host Check Command to the server.
    `EPPResponse` | `sendCreate()` Sends a Host Create Command to the server.
    `EPPResponse` | `sendDelete()` Sends a Host Delete Command to the server.
    `EPPHostInfoResp` | `sendInfo()` Sends a Host Info Command to the server.
    `EPPResponse` | `sendUpdate()` Sends a Host Update Command to the server.
    `void` | `setExtension(EPPCodecComponent aExtension)` Deprecated. Replaced by `addExtension(EPPCodecComponent)`. This method will add the extension as is done in `addExtension(EPPCodecComponent)`.
    `void` | `setExtensions(java.util.Vector aExtensions)` Sets the command extension objects.
    `void` | `setNewName(java.lang.String aNewName)` Sets the new name for the host.
    `void` | `setTransId(java.lang.String newTransId)` Sets the client transaction identifier.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### STAT_OK

          public static final java.lang.String STAT_OK

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_PENDING_DELETE

          public static final java.lang.String STAT_PENDING_DELETE

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_PENDING_TRANSFER

          public static final java.lang.String STAT_PENDING_TRANSFER

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_PENDING_CREATE

          public static final java.lang.String STAT_PENDING_CREATE

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_PENDING_UPDATE

          public static final java.lang.String STAT_PENDING_UPDATE

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_CLIENT_DELETE_PROHIBITED

          public static final java.lang.String STAT_CLIENT_DELETE_PROHIBITED

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_CLIENT_UPDATE_PROHIBITED

          public static final java.lang.String STAT_CLIENT_UPDATE_PROHIBITED

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_LINKED

          public static final java.lang.String STAT_LINKED

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_SERVER_DELETE_PROHIBITED

          public static final java.lang.String STAT_SERVER_DELETE_PROHIBITED

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### STAT_SERVER_UPDATE_PROHIBITED

          public static final java.lang.String STAT_SERVER_UPDATE_PROHIBITED

      DOCUMENT ME!
      See Also:
        Constant Field Values

    - #### DEFAULT_LANG

          public static final java.lang.String DEFAULT_LANG

      Default language for status descriptions
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EPPHost

          public EPPHost(EPPSession newSession)

      Constructs an `EPPHost` given an initialized EPP session.
      Parameters:
        `newSession` - Server session to use.

  - ### Method Detail

    - #### addExtension

          public void addExtension(EPPCodecComponent aExtension)

      Adds a command extension object.
      Parameters:
        `aExtension` - command extension object associated with the command

    - #### setExtension

          public void setExtension(EPPCodecComponent aExtension)

      Deprecated. Replaced by `addExtension(EPPCodecComponent)`. This method will add the extension as is done in `addExtension(EPPCodecComponent)`.
      Sets a command extension object.
      Parameters:
        `aExtension` - command extension object associated with the command

    - #### setExtensions

          public void setExtensions(java.util.Vector aExtensions)

      Sets the command extension objects.
      Parameters:
        `aExtensions` - command extension objects associated with the command

    - #### getExtensions

          public java.util.Vector getExtensions()

      Gets the command extensions.
      Returns:
        `Vector` of concrete `EPPCodecComponent` associated with the command if exists; `null` otherwise.

    - #### addHostName

          public void addHostName(java.lang.String newHostName)

      Adds a host name for use with a `send` method. Adding more than one host name is only supported by `sendCheck`.
      Parameters:
        `newHostName` - Host name to add

    - #### getNewName

          public java.lang.String getNewName()

      Gets the new name for the host.
      Returns:
        New host name if defined; `null` otherwise.

    - #### setNewName

          public void setNewName(java.lang.String aNewName)

      Sets the new name for the host.
      Parameters:
        `aNewName` - New host name

    - #### addIPV4Address

          public void addIPV4Address(java.lang.String newIPV4Address)

      Adds an IPV4 IP Address to the host.
      Parameters:
        `newIPV4Address` - IPV4 IP Address

    - #### removeIPV4Address

          public void removeIPV4Address(java.lang.String newIPV4Address)

      Removes an IPV4 IP Address from the host.
      Parameters:
        `newIPV4Address` - IPV4 IP Address

    - #### addIPV6Address

          public void addIPV6Address(java.lang.String newIPV6Address)

      Adds an IPV6 address to the host
      Parameters:
        `newIPV6Address` - IPV6 Address

    - #### removeIPV6Address

          public void removeIPV6Address(java.lang.String newIPV6Address)

      Removes an IPV6 address from the host
      Parameters:
        `newIPV6Address` - IPV6 Address

    - #### addStatus

          public void addStatus(java.lang.String aStatus)

      Adds a status to the host.
      Parameters:
        `aStatus` - One of the `STAT_` constants

    - #### removeStatus

          public void removeStatus(java.lang.String aStatus)

      Removes a status from the host.
      Parameters:
        `aStatus` - One of the `STAT_` constants

    - #### addStatus

          public void addStatus(java.lang.String aStatus,
                                java.lang.String aDesc,
                                java.lang.String aLang)

      Adds a status to the host with a description.
      Parameters:
        `aStatus` - One of the `STAT_` constants
        `aDesc` - Description of the rationale for the status change
        `aLang` - Language of `aDesc` Use `DEFAULT_LANG` for the default language ("us").

    - #### removeStatus

          public void removeStatus(java.lang.String aStatus,
                                   java.lang.String aDesc,
                                   java.lang.String aLang)

      Removes a status from the host with a description.
      Parameters:
        `aStatus` - One of the `STAT_` constants
        `aDesc` - Description of the rationale for the status change
        `aLang` - Language of `aDesc` Use `DEFAULT_LANG` for the default language ("us").

    - #### setTransId

          public void setTransId(java.lang.String newTransId)

      Sets the client transaction identifier.
      Parameters:
        `newTransId` - Client transaction identifier

    - #### getResponse

          public EPPResponse getResponse()

      Gets the response associated with the last command. This method can be used to retrieve the server error response in the catch block of EPPCommandException.
      Returns:
        Response associated with the last command

    - #### sendCreate

          public EPPResponse sendCreate()
                                 throws EPPCommandException

      Sends a Host Create Command to the server.
      The required attributes have been set with the following methods:
      - `addHostName` - Sets the host name to create. Only one host name is valid.
      The optional attributes have been set with the following:
      - `setTransId` - Sets the client transaction identifier
      - `addIPV4Address` - Add an IPV4 Address
      - `addIPV6Address` - Add an IPV6 Address
      Returns:
        `EPPResponse` containing the Host create result.
      Throws:
        `EPPCommandException` - Error executing the create command. Use `getResponse` to get the associated server error response.

    - #### sendCheck

          public EPPHostCheckResp sendCheck()
                                     throws EPPCommandException

      Sends a Host Check Command to the server.
      The required attributes have been set with the following methods:
      - `addHostName` - Adds a host name to check. More than one host name can be checked in `sendCheck`
      The optional attributes have been set with the following:
      - `setTransId` - Sets the client transaction identifier
      Returns:
        `EPPHostCheckResp` containing the Host check information.
      Throws:
        `EPPCommandException` - Error executing the check command. Use `getResponse` to get the associated server error response.

    - #### sendInfo

          public EPPHostInfoResp sendInfo()
                                   throws EPPCommandException

      Sends a Host Info Command to the server.
      The required attributes have been set with the following methods:
      - `addHostName` - Sets the host name to get info for. Only one host name is valid.
      The optional attributes have been set with the following:
      - `setTransId` - Sets the client transaction identifier
      Returns:
        `EPPHostInfoResp` containing the Host information.
      Throws:
        `EPPCommandException` - Error executing the info command. Use `getResponse` to get the associated server error response.

    - #### sendUpdate

          public EPPResponse sendUpdate()
                                 throws EPPCommandException

      Sends a Host Update Command to the server.
      The required attributes have been set with the following methods:
      - `addHostName` - Sets the domain name to update. Only one domain name is valid.
      The optional attributes have been set with the following:
      - `setTransId` - Sets the client transaction identifier
      - `addIPV4Address` - Adds IPV4 Address
      - `addIPV6Address` - Adds IPV6 Address
      - `removeIPV4Address` - Removes IPV4 Address
      - `removeIPV6Address` - Removes IPV6 Address
      - `addStatus` - Add status
      - `removeStatus` - Remove status
      - `setNewName` - Renames the host
      At least one update attribute needs to be set.
      Returns:
        `EPPResponse` containing the Host update result.
      Throws:
        `EPPCommandException` - Error executing the update command. Use `getResponse` to get the associated server error response.

    - #### sendDelete

          public EPPResponse sendDelete()
                                 throws EPPCommandException

      Sends a Host Delete Command to the server.
      The required attributes have been set with the following methods:
      - `addHostName` - Sets the host name to delete. Only one host name is valid.
      The optional attributes have been set with the following:
      - `setTransId` - Sets the client transaction identifier
      Returns:
        `EPPResponse` containing the delete result information.
      Throws:
        `EPPCommandException` - Error executing the delete command. Use `getResponse` to get the associated server error response.

    - #### resetHost

          protected void resetHost()

      Resets the host instance to its initial state.

Copyright © VeriSign Inc. All Rights Reserved.