Package com.verisign.epp.namestore.interfaces

## Class NSContact

- java.lang.Object
- - com.verisign.epp.interfaces.EPPContact
  - - com.verisign.epp.namestore.interfaces.NSContact

-     public class NSContact
      extends EPPContact

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

- - ### Field Summary

    Fields
    Modifier and Type | Field | 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.EPPContact

      `STAT_CLIENT_DELETE_PROHIBITED, STAT_CLIENT_TRANSFER_PROHIBITED, STAT_CLIENT_UPDATE_PROHIBITED, STAT_OK, STAT_PENDING_DELETE, STAT_PENDING_TRANSFER, STAT_SERVER_DELETE_PROHIBITED, STAT_SERVER_TRANSFER_PROHIBITED, STAT_SERVER_UPDATE_PROHIBITED, STAT_STATUS_LINKED, TRANSFER_APPROVE, TRANSFER_CANCEL, TRANSFER_QUERY, TRANSFER_REJECT, TRANSFER_REQUEST`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NSContact​(EPPSession aSession)` | Creates an `NSContact` with an established `EPPSession`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | 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` | `resetContact()` | Resets the contact attributes for the next command.
    `EPPResponse` | `sendCreate()` | Sends a Contact Create Command to the server. The required attributes have been set with the following methods: `addContactId` - Sets the contact to update.
    `EPPResponse` | `sendUpdate()` | Sends a Contact Update Command to the server. The required attributes have been set with the following methods: `addContactId` - Sets the contact to update.
    `void` | `setSubProductID​(java.lang.String aSubProductID)` | Sets the contact sub-product id which specifies which is the target registry for the contact operation.

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

      `addContactId, addExtension, addPostalInfo, addStatus, addStatus, getAddStatus, getAuthorizationId, getDisclose, getEmail, getExtensions, getFaxExt, getFaxNumber, getFirstPostalInfo, getPostalInfo, getRemoveStatus, getResponse, getTransId, getVoicePhone, removeStatus, removeStatus, sendCheck, sendDelete, sendInfo, sendTransfer, setAuthorizationId, setDisclose, setEmail, setExtension, setExtensions, setFaxExt, setFaxNumber, setPostalInfo, setTransferOpCode, setTransId, setVoiceExt, setVoicePhone`

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

    - #### NSContact

          public NSContact​(EPPSession aSession)

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

  - ### Method Detail

    - #### setSubProductID

          public void setSubProductID​(java.lang.String aSubProductID)

      Sets the contact sub-product id which specifies which is the target registry for the contact operation. Some possible values included in @link{NSSubProduct}. 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 or using the TLD value. 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 `NSContact.ADD`, `NSContact.REMOVE`, and `NSContact.CHANGE` for the org identifier.
      Parameters:
        `aAction` - One of the `NSContact.ADD`, `NSContact.REMOVE`, and `NSContact.CHANGE` for the org identifier.
        `aOrgId` - Org identifier to add, remove, or change

    - #### sendCreate

          public EPPResponse sendCreate()
                                 throws EPPCommandException

      Sends a Contact Create Command to the server.
      The required attributes have been set with the following methods:
      - `addContactId` - Sets the contact to update. Only one contact is valid.
      - `setPostalContact` - Set the postal information
      - `setEmail` - Set the email address
      - `setAuthString` - Sets the contact authorization string.
      The optional attributes have been set with the following:
      - `setTransId` - Sets the client transaction identifier
      - `setExtension` - Command extension to send with command
      - `setVoicePhone` - Set the voice phone
      - `setFaxNumber` - Set the fax number
      - `setInterPostalPostalContact` - Set the international postal information
      - `addOrgId` - Add an organization identifier with a role
      Overrides:
        `sendCreate` in class `EPPContact`
      Returns:
        `EPPContactCreateResp` containing the contact create result.
      Throws:
        `EPPCommandException` - Error executing the update command. Use `getResponse` to get the associated server error response.

    - #### sendUpdate

          public EPPResponse sendUpdate()
                                 throws EPPCommandException

      Sends a Contact Update Command to the server.
      The required attributes have been set with the following methods:
      - `addContactId` - Sets the contact to update. Only one contact is valid.
      The optional attributes have been set with the following:
      - `setTransId` - Sets the client transaction identifier
      - `setExtension` - Command extension to send with command
      - `addStatus` - Add status
      - `removeStatus` - Remove status
      - `setPostalContact` - Set the postal information
      - `setVoicePhone` - Set the voice phone
      - `setFaxNumber` - Set the fax number
      - `setEmail` - Set the email address
      - `setInterPostalPostalContact` - Set the international postal information
      - `setAuthString` - Sets the contact authorization string.
      - `addUpdateOrgId` - Add an update to organization identifier
      At least one update attribute needs to be set.
      Overrides:
        `sendUpdate` in class `EPPContact`
      Returns:
        `EPPResponse` containing the contact update result.
      Throws:
        `EPPCommandException` - Error executing the update command. Use `getResponse` to get the associated server error response.

    - #### resetContact

          protected void resetContact()

      Resets the contact attributes for the next command.
      Overrides:
        `resetContact` in class `EPPContact`