Package com.verisign.epp.interfaces.registry.v02

## Class EPPRegistry

- java.lang.Object
- - com.verisign.epp.interfaces.registry.v02.EPPRegistry

-     public class EPPRegistry
      extends java.lang.Object

  Interface class for the EPP Registry Object that complies with v01 (urn:ietf:params:xml:ns:registry-0.1) of the XML schema. This class can be used to prepare and send the supported EPP Registry Object commands. `EPPRegistry` requires an established `EPPSession` that is used to send the commands and read the responses from a server.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EPPRegistry​(EPPSession aSession)` | Constructs an `EPPRegistry` given an initialized EPP session.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addExtension​(EPPCodecComponent aExtension)` | Adds a command extension object.
    `void` | `addZone​(EPPRegistryZoneName aZone)` | Add a zone name to the list of zone names.
    `void` | `addZone​(java.lang.String aZone)` | Add an aLabel zone name to the list of zone names.
    `EPPRegistryInfoCmd.Scope` | `getAllScope()` | Gets the zone scope used with the info all option.
    `java.util.Vector<EPPCodecComponent>` | `getExtensions()` | Gets the command extensions.
    `EPPRegistryInfoCmd.Mode` | `getInfoMode()` | Gets the info mode.
    `EPPResponse` | `getResponse()` | Gets the response associated with the last command.
    `EPPSession` | `getSession()` | Gets the session to use to send commands through.
    `java.lang.String` | `getTransId()` | Gets the OPTIONAL client transaction identifier.
    `java.util.List<EPPRegistryZoneName>` | `getZoneList()` | Gets the list of zone names.
    `boolean` | `hasInfoMode()` | Is the info mode defined?
    `EPPRegistryCheckResp` | `sendCheck()` | Sends a check command to the server. The required attributes have been set with the following methods: `addZone(EPPRegistryZoneName)`, `addZone(String)`, or `setZoneList(List)` - To set the zone names to check.
    `EPPRegistryCreateResp` | `sendCreate()` | Sends a create command to the server to create a zone. The required attributes have been set with the following methods: `setZone(EPPRegistryZone)` - Contains the attributes of the zone to create. The optional attributes have been set with the following: `setTransId(String)` - Sets the client transaction identifier `addExtension(EPPCodecComponent)` or `setExtensions(Vector)` - Set extensions to include with the command.
    `EPPResponse` | `sendDelete()` | Sends a delete command to the server to delete a zone by name. The required attributes have been set with the following methods: `addZone(EPPRegistryZoneName)`, `addZone(String)`, or `setZoneList(List)` - To set a single zone name to delete.
    `EPPRegistryInfoResp` | `sendInfo()` | Sends an info command to the server.
    `EPPResponse` | `sendUpdate()` | Sends an update command to the server to update a zone. The required attributes have been set with the following methods: `setZone(EPPRegistryZone)` - Contains the attributes of the zone to update. The optional attributes have been set with the following: `setTransId(String)` - Sets the client transaction identifier `addExtension(EPPCodecComponent)` or `setExtensions(Vector)` - Set extensions to include with the command.
    `void` | `setAllScope​(EPPRegistryInfoCmd.Scope aScope)` | Sets the zone scope used with the info all mode.
    `void` | `setExtensions​(java.util.Vector<EPPCodecComponent> aExtensions)` | Sets the command extensions.
    `void` | `setInfoMode​(EPPRegistryInfoCmd.Mode aInfoMode)` | Sets the info mode.
    `void` | `setSession​(EPPSession aSession)` | Sets the session to use to send commands through.
    `void` | `setTransId​(java.lang.String aTransId)` | Sets the OPTIONAL client transaction identifier.
    `void` | `setZone​(EPPRegistryZone aZone)` | Sets the zone to use with `sendCreate()` or `sendUpdate()`.
    `void` | `setZoneList​(java.util.List<EPPRegistryZoneName> aZoneList)` | Sets the list of zone names to use in a command.

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

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

- - ### Constructor Detail

    - #### EPPRegistry

          public EPPRegistry​(EPPSession aSession)

      Constructs an `EPPRegistry` given an initialized EPP session.
      Parameters:
        `aSession` - Server session to use.

  - ### Method Detail

    - #### sendCheck

          public EPPRegistryCheckResp sendCheck()
                                         throws EPPCommandException

      Sends a check command to the server.
      The required attributes have been set with the following methods:
      - `addZone(EPPRegistryZoneName)`, `addZone(String)`, or `setZoneList(List)` - To set the zone names to check. More than one zone name can be checked in `sendCheck`.
      The optional attributes have been set with the following:
      - `setTransId(String)` - Sets the client transaction identifier
      - `addExtension(EPPCodecComponent)` or `setExtensions(Vector)` - Set extensions to include with the command.
      Returns:
        `EPPRegistryCheckResp` containing the zone check information.
      Throws:
        `EPPCommandException` - Error executing the check command. Use `getResponse()` to get the associated server error response.

    - #### sendDelete

          public EPPResponse sendDelete()
                                 throws EPPCommandException

      Sends a delete command to the server to delete a zone by name.
      The required attributes have been set with the following methods:
      - `addZone(EPPRegistryZoneName)`, `addZone(String)`, or `setZoneList(List)` - To set a single zone name to delete. More than one zone name will result in an `EPPCommandException`.
      The optional attributes have been set with the following:
      - `setTransId(String)` - Sets the client transaction identifier
      - `addExtension(EPPCodecComponent)` or `setExtensions(Vector)` - Set extensions to include with the command.
      Returns:
        `EPPResponse` containing the result of the delete command
      Throws:
        `EPPCommandException` - Error executing the delete command. Use `getResponse()` to get the associated server error response.

    - #### sendInfo

          public EPPRegistryInfoResp sendInfo()
                                       throws EPPCommandException

      Sends an info command to the server. There are three forms of the info command that include get all zone summary information, get detailed information for an individual zone, or get system information.
      The required attributes have been set with the following methods:
      - `addZone(EPPRegistryZoneName)`, `addZone(String)`, or `setZoneList(List)` - To set a single zone name to get the detailed information for. This is used to send the "get detailed information for an individual zone" form. More than one zone name will result in an `EPPCommandException`. OR
      - `setAllScope(EPPRegistryInfoCmd.Scope)` - "get all zone summary information" form of info command. OR
      - `setInfoMode(EPPRegistryInfoCmd.Mode)` - Used to explicitly set the info mode to `EPPRegistryInfoCmd.Mode.system`.
      The optional attributes have been set with the following:
      - `setTransId(String)` - Sets the client transaction identifier
      - `addExtension(EPPCodecComponent)` or `setExtensions(Vector)` - Set extensions to include with the command.
      Returns:
        `EPPRegistryInfoResp` containing the requested information from the server based on the form of the info command.
      Throws:
        `EPPCommandException` - Error executing the info command. Use `getResponse()` to get the associated server error response.

    - #### sendCreate

          public EPPRegistryCreateResp sendCreate()
                                           throws EPPCommandException

      Sends a create command to the server to create a zone.
      The required attributes have been set with the following methods:
      - `setZone(EPPRegistryZone)` - Contains the attributes of the zone to create.
      The optional attributes have been set with the following:
      - `setTransId(String)` - Sets the client transaction identifier
      - `addExtension(EPPCodecComponent)` or `setExtensions(Vector)` - Set extensions to include with the command.
      Returns:
        `EPPRegistryCreateResp` containing the result of the create command
      Throws:
        `EPPCommandException` - Error executing the create command. Use `getResponse()` to get the associated server error response.

    - #### sendUpdate

          public EPPResponse sendUpdate()
                                 throws EPPCommandException

      Sends an update command to the server to update a zone.
      The required attributes have been set with the following methods:
      - `setZone(EPPRegistryZone)` - Contains the attributes of the zone to update.
      The optional attributes have been set with the following:
      - `setTransId(String)` - Sets the client transaction identifier
      - `addExtension(EPPCodecComponent)` or `setExtensions(Vector)` - Set extensions to include with the command.
      Returns:
        `EPPResponse` containing the result of the update command
      Throws:
        `EPPCommandException` - Error executing the update command. Use `getResponse()` to get the associated server error response.

    - #### getSession

          public EPPSession getSession()

      Gets the session to use to send commands through.
      Returns:
        Active EPP session to send commands through if defined; `null` otherwise.

    - #### setSession

          public void setSession​(EPPSession aSession)

      Sets the session to use to send commands through.
      Parameters:
        `aSession` - Active EPP session to send commands through

    - #### getTransId

          public java.lang.String getTransId()

      Gets the OPTIONAL client transaction identifier.
      Returns:
        The client transaction identifier if set; `null` otherwise.

    - #### setTransId

          public void setTransId​(java.lang.String aTransId)

      Sets the OPTIONAL client transaction identifier.
      Parameters:
        `aTransId` - Client transaction identifier

    - #### getZoneList

          public java.util.List<EPPRegistryZoneName> getZoneList()

      Gets the list of zone names.
      Returns:
        List of zone names

    - #### setZoneList

          public void setZoneList​(java.util.List<EPPRegistryZoneName> aZoneList)

      Sets the list of zone names to use in a command. The mode is set to `EPPRegistryInfoCmd.Mode.all`.
      Parameters:
        `aZoneList` - List of zone names

    - #### addZone

          public void addZone​(java.lang.String aZone)

      Add an aLabel zone name to the list of zone names. The mode is set to `EPPRegistryInfoCmd.Mode.all`.
      Parameters:
        `aZone` - ALabel zone name to add to the list of zone names.

    - #### addZone

          public void addZone​(EPPRegistryZoneName aZone)

      Add a zone name to the list of zone names. The mode is set to `EPPRegistryInfoCmd.Mode.name`.
      Parameters:
        `aZone` - Zone name to add to the list of zone names.

    - #### getAllScope

          public EPPRegistryInfoCmd.Scope getAllScope()

      Gets the zone scope used with the info all option.
      Returns:
        info all scope if defined; `null` otherwise.

    - #### setAllScope

          public void setAllScope​(EPPRegistryInfoCmd.Scope aScope)

      Sets the zone scope used with the info all mode. The mode is set to `EPPRegistryInfoCmd.Mode.all`.
      Parameters:
        `aScope` - Scope used for the info all mode.

    - #### hasInfoMode

          public boolean hasInfoMode()

      Is the info mode defined?
      Returns:
        `true` if the info mode is defined; `false` otherwise.

    - #### getInfoMode

          public EPPRegistryInfoCmd.Mode getInfoMode()

      Gets the info mode.
      Returns:
        The info mode if defined; `null` otherwise.

    - #### setInfoMode

          public void setInfoMode​(EPPRegistryInfoCmd.Mode aInfoMode)

      Sets the info mode. This is needed when using the `EPPRegistryInfoCmd.Mode.system` mode, where the other modes are automatically set using the other associated methods.
      Parameters:
        `aInfoMode` - Info mode to use

    - #### setZone

          public void setZone​(EPPRegistryZone aZone)

      Sets the zone to use with `sendCreate()` or `sendUpdate()`.
      Parameters:
        `aZone` - The zone to use with `sendCreate()` or `sendUpdate()`.

    - #### getExtensions

          public java.util.Vector<EPPCodecComponent> getExtensions()

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

    - #### setExtensions

          public void setExtensions​(java.util.Vector<EPPCodecComponent> aExtensions)

      Sets the command extensions.
      Parameters:
        `aExtensions` - Command extensions associated with the command. Setting to `null` clears the extensions.

    - #### addExtension

          public void addExtension​(EPPCodecComponent aExtension)

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

    - #### 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:
        `EPPResponse` associated with the last command if defined; `null` otherwise.