Class EPPNameWatch

java.lang.Object
com.verisign.epp.interfaces.EPPNameWatch

public class EPPNameWatch extends Object
EPPNameWatch is the primary client interface class used for nameWatch management. An instance of EPPNameWatch 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.nameWatch package.

See Also:
  • Field Details

  • Constructor Details

    • EPPNameWatch

      public EPPNameWatch(EPPSession newSession)
      Constructs an EPPNameWatch given an initialized EPP session.
      Parameters:
      newSession - Server session to use.
  • Method Details

    • addExtension

      public void addExtension(EPPCodecComponent aExtension)
      Adds a command extension object.
      Parameters:
      aExtension - command extension object associated with the command
    • setExtension

      @Deprecated public void setExtension(EPPCodecComponent aExtension)
      Deprecated.
      Replaced by addExtension(EPPCodecComponent). This method will add the extension as is done in addExtension(EPPCodecComponet).
      Sets a command extension object.
      Parameters:
      aExtension - command extension object associated with the command
    • setExtensions

      public void setExtensions(Vector aExtensions)
      Sets the command extension objects.
      Parameters:
      aExtensions - command extension objects associated with the command
    • getExtensions

      public Vector getExtensions()
      Gets the command extensions.
      Returns:
      Vector of concrete EPPCodecComponent associated with the command if exists; null otherwise.
    • setRoid

      public void setRoid(String newRoid)
      Sets the NameWatch roid
      Parameters:
      newRoid - NameWatch roid
    • getRoid

      public String getRoid()
      Gets the NameWatch Roid
      Returns:
      NameWatch Roid
    • setExpirationDate

      public void setExpirationDate(Date newExpirationDate)
      Sets the NameWatch expiration date.
      Parameters:
      newExpirationDate - NameWatch expiration date
    • getExpirationDate

      public Date getExpirationDate()
      Gets the NameWatch expiration date.
      Returns:
      NameWatch expiration date
    • getName

      public String getName()
      Gets the NameWatch Name
      Returns:
      NameWatch Name
    • setName

      public void setName(String newName)
      Sets the NameWatch Name
      Parameters:
      newName - NameWatch Name
    • setTransferOpCode

      public void setTransferOpCode(String newTransferOpCode)
      Sets the transfer operation for a call to encodeTransfer. The transfer code must be set to one of the EPPNameWatch.TRANSFER_ constants.
      Parameters:
      newTransferOpCode - One of the EPPNameWatch.TRANSFER_ constants
    • setTransId

      public void setTransId(String newTransId)
      Sets the client transaction identifier.
      Parameters:
      newTransId - Client transaction identifier
    • setAuthString

      public void setAuthString(String newAuthString)
      Sets the authorization string associated with an sendCreate and sendTransfer.
      Parameters:
      newAuthString - Authorization string
    • getAuthString

      public String getAuthString()
      Sets the authorization string associated with an sendCreate and sendTransfer.
      Returns:
      Authorization string if defined; null otherwise.
    • getAuthRoid

      public String getAuthRoid()
      Sets the authorization roid that is used to identify the registrant or contact object if and only if the value of authInfo, set by setAuthString(String), is associated with the registrant or contact object. This can be used with sendTransfer along with setting the authInfo with the setAuthString(String) method.
      Returns:
      Roid of registrant or contact object if defined; null otherwise.
    • setAuthRoid

      public void setAuthRoid(String aAuthRoid)
      Gets the authorization roid that is used to identify the registrant or contact object if and only if the value of authInfo, set by setAuthString(String), is associated with the registrant or contact object. This can be used with sendTransfer along with setting the authInfo with the setAuthString(String) method.
      Parameters:
      aAuthRoid - Roid of registrant or contact object
    • getRegistrant

      public String getRegistrant()
      Gets the registrant.
      Returns:
      registrant if defined; null otherwise.
    • setRegistrant

      public void setRegistrant(String newRegistrant)
      Sets the registrant.
      Parameters:
      newRegistrant - NameWatch registrant
    • getRptTo

      public String getRptTo()
      Gets NameWatch e-mail address to report to.
      Returns:
      E-mail address if defined; null otherwise.
    • setRptTo

      public void setRptTo(String aRptTo)
      Sets NameWatch e-mail address to report to.
      Parameters:
      aRptTo - addressString.
    • getFreq

      public String getFreq()
      Gets NameWatch report frequency, which should be one of the FREQ_ constant values.
      Returns:
      Report frequency if defined; null otherwise.
    • setFreq

      public void setFreq(String aFreq)
      Sets the NameWatch report frequency, which should be one of the FREQ_ constant values.
      Parameters:
      aFreq - One of the FREQ_ constant values.
    • sendCreate

      public EPPNameWatchCreateResp sendCreate() throws EPPCommandException
      Sends a NameWatch Create Command to the server.

      The required attributes have been set with the following methods:

      • setName- Sets the namewatch name to create.
      • setAuthString- Sets the namewatch authorization
      • setRegistrant- Sets the Registrant for the namewatch. string.
      • setRptTo- Sets e-mail address to report to.
      • setFreq- Sets the frequency of the report


      The optional attributes have been set with the following:

      • setTransId- Sets the client transaction identifier
      • setPeriodLength- Sets the registration period (default = 1)
      • setPeriodUnit- Sets the registration period unit (default =PERIOD_YEAR)
      Returns:
      EPPNameWatchCreateResp containing the namewatch create result. Use EPPNameWatchCreateResp.getRoid to get the ROID required for the rest of the EPPNameWatch operations.
      Throws:
      EPPCommandException - Error executing the create command. Use getResponse to get the associated server error response.
    • sendUpdate

      public EPPResponse sendUpdate() throws EPPCommandException
      Sends a NameWatch Update Command to the server.

      The required attributes have been set with the following methods:

      • setRoid- Sets the namewatch ROID. string.


      The optional attributes have been set with the following:

      • setTransId- Sets the client transaction identifier
      • addStatus- Adds a status to the namewatch. More than one status can be added.
      • removeStatus- Removes a status from the namewatch. More than one status can be removed.
      • setRegistrant- Sets the Registrant for the namewatch.
      • setAuthString- Sets the namewatch authorization
      • setRptTo- Sets e-mail address to report to.
      • setFreq- Sets the frequency of the report
      Returns:
      EPPNameWatchCreateResp containing the namewatch create result. Use EPPNameWatchCreateResp.getRoid to get the ROID required for the rest of the EPPNameWatch operations.
      Throws:
      EPPCommandException - Error executing the create command. Use getResponse to get the associated server error response.
    • sendTransfer

      public EPPNameWatchTransferResp sendTransfer() throws EPPCommandException
      Sends a NameWatch Transfer Command to the server.

      The required attributes have been set with the following methods:

      • setRoid- Sets the namewatch ROID.
      • setTransferOpCode- Sets the namewatch transfer operation.
      • setAuthString- Sets the namewatch authorization string.

        The optional attributes have been set with the following:

      • setTransId- Sets the client transaction identifier
      • setPeriodLength- Sets the registration period (default = 1)
      • setPeriodUnit- Sets the registration period unit (default =PERIOD_YEAR)
      Returns:
      EPPNameWatchTransferResp containing the namewatch transfer result.
      Throws:
      EPPCommandException - Error executing the create command. Use getResponse to get the associated server error response.
    • sendRenew

      public EPPNameWatchRenewResp sendRenew() throws EPPCommandException
      Sends a NameWatch Renew Command to the server.

      The required attributes have been set with the following methods:

      • setRoid- Sets the namewatch ROID.
      • setExpirationDate- Sets current expiration date.


      The optional attributes have been set with the following:

      • setTransId- Sets the client transaction identifier
      • setPeriodLength- Sets the registration period (default = 1)
      • setPeriodUnit- Sets the registration period unit (default =PERIOD_YEAR)
      Returns:
      EPPNameWatchRenewResp containing the namewatch renew result.
      Throws:
      EPPCommandException - Error executing the renew command. Use getResponse to get the associated server error response.
    • sendInfo

      public EPPNameWatchInfoResp sendInfo() throws EPPCommandException
      Sends a NameWatch Info Command to the server.

      The required attributes have been set with the following methods:

      • setRoid- Sets the namewatch ROID.


      The optional attributes have been set with the following:

      • setTransId- Sets the client transaction identifier
      Returns:
      EPPNameWatchInfoResp containing the namewatch information.
      Throws:
      EPPCommandException - Error executing the info command. Use getResponse to get the associated server error response.
    • sendDelete

      public EPPResponse sendDelete() throws EPPCommandException
      Sends a NameWatch Delete Command to the server.

      The required attributes have been set with the following methods:

      • setRoid- Sets the namewatch ROID.


      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.
    • 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
    • getPeriodLength

      public int getPeriodLength()
      Gets the registration period. The unit can be retrieved by calling getPeriodUnit.
      Returns:
      registration period if defined; 0 otherwise
    • setPeriodLength

      public void setPeriodLength(int newPeriodLength)
      Sets the registration period. The default unit is years, but this can be overriden by calling setPeriodUnit.
      Parameters:
      newPeriodLength - DOCUMENT ME!
    • getPeriodUnit

      public String getPeriodUnit()
      Gets the registration period unit. If defined, this should be either PERIOD_MONTH or PERIOD_YEAR.
      Returns:
      registration period unit if defined; 0 otherwise
    • setPeriodUnit

      public void setPeriodUnit(String newPeriodUnit)
      Sets the registration period unit.
      Parameters:
      newPeriodUnit - DOCUMENT ME!
    • addStatus

      public void addStatus(EPPNameWatchStatus aStatus)
      Adds a status for use in calling sendUpdate.
      Parameters:
      aStatus - Status to add to namewatch.
    • removeStatus

      public void removeStatus(EPPNameWatchStatus aStatus)
      Removes a status for use in calling sendUpdate.
      Parameters:
      aStatus - Status to add to namewatch.