com.verisign.epp.namestore.interfaces

## Class NSHost

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

-     public class NSHost
      extends EPPHost

  NameStore Host interface that extends that standard `EPPHost` by adding new methods like @link{#setSubProductID(String)}. `EPPHost` could be used directly, but `NSHost` can be enhanced independent of the EPP specification.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ADD` Used to specify the addition of an attribute with `addUpdateOrgId`.
    `static int` | `CHANGE` Used to specify the change of an attribute with `addUpdateOrgId`.
    `static int` | `REMOVE` Used to specify the removal of an attribute with `addUpdateOrgId`.

    - ### Fields inherited from class com.verisign.epp.interfaces.EPPHost

      `DEFAULT_LANG, STAT_CLIENT_DELETE_PROHIBITED, STAT_CLIENT_UPDATE_PROHIBITED, STAT_LINKED, STAT_OK, STAT_PENDING_CREATE, STAT_PENDING_DELETE, STAT_PENDING_TRANSFER, STAT_PENDING_UPDATE, STAT_SERVER_DELETE_PROHIBITED, STAT_SERVER_UPDATE_PROHIBITED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NSHost(EPPSession aSession)` Creates an `NSHost` with an established `EPPSession` .

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOrgId(EPPOrgExtId aOrgId)` Adds an org identifier for use with `sendCreate()`.
    `void` | `addUpdateOrgId(int aAction, EPPOrgExtId aOrgId)` Updates the org identifier used with `sendUpdate()`.
    `protected void` | `resetHost()` Resets the host attributes for the next command.
    `EPPResponse` | `sendCreate()` 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.
    `EPPResponse` | `sendUpdate()` 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.
    `void` | `setSubProductID(java.lang.String aSubProductID)` Sets the host sub-product id which specifies which is the target registry for the host operation.

    - ### Methods inherited from class com.verisign.epp.interfaces.EPPHost

      `addExtension, addHostName, addIPV4Address, addIPV6Address, addStatus, addStatus, getExtensions, getNewName, getResponse, removeIPV4Address, removeIPV6Address, removeStatus, removeStatus, sendCheck, sendDelete, sendInfo, setExtension, setExtensions, setNewName, setTransId`

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

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

- - ### Field Detail

    - #### ADD

          public static final int ADD

      Used to specify the addition of an attribute with `addUpdateOrgId`.
      See Also:
        Constant Field Values

    - #### REMOVE

          public static final int REMOVE

      Used to specify the removal of an attribute with `addUpdateOrgId`.
      See Also:
        Constant Field Values

    - #### CHANGE

          public static final int CHANGE

      Used to specify the change of an attribute with `addUpdateOrgId`.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NSHost

          public NSHost(EPPSession aSession)

      Creates an `NSHost` with an established `EPPSession` .
      Parameters:
        `aSession` - Established session

  - ### Method Detail

    - #### setSubProductID

          public void setSubProductID(java.lang.String aSubProductID)

      Sets the host sub-product id which specifies which is the target registry for the host operation. Some possible values include dotCC, dotTV, dotBZ, dotCOM, dotNET. This results in a `EPPNamestoreExtNamestoreExt` extension being added to the command.
      Parameters:
        `aSubProductID` - Sub-product id of host operation. Should use one of the @link{NSSubProduct} constants. Passing `null` will not add any extension.

    - #### addOrgId

          public void addOrgId(EPPOrgExtId aOrgId)

      Adds an org identifier for use with `sendCreate()`.
      Parameters:
        `aOrgId` - Org identifier with role to add

    - #### addUpdateOrgId

          public void addUpdateOrgId(int aAction,
                                     EPPOrgExtId aOrgId)

      Updates the org identifier used with `sendUpdate()`. There are three possible actions that can be used including `NSHost.ADD`, `NSHost.REMOVE`, and `NSHost.CHANGE` for the org identifier.
      Parameters:
        `aAction` - One of the `NSHost.ADD`, `NSHost.REMOVE`, and `NSHost.CHANGE` for the org identifier.
        `aOrgId` - Org identifier to add, remove, or change

    - #### 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
      - `addOrgId` - Add an organization identifier with a role
      Overrides:
        `sendCreate` in class `EPPHost`
      Returns:
        `EPPResponse` containing the Host create result.
      Throws:
        `EPPCommandException` - Error executing the create 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
      - `addUpdateOrgId` - Add an update to organization identifier
      At least one update attribute needs to be set.
      Overrides:
        `sendUpdate` in class `EPPHost`
      Returns:
        `EPPResponse` containing the Host update result.
      Throws:
        `EPPCommandException` - Error executing the update command. Use `getResponse` to get the associated server error response.

    - #### resetHost

          protected void resetHost()

      Resets the host attributes for the next command.
      Overrides:
        `resetHost` in class `EPPHost`