Class EPPEmailFwd


  • public class EPPEmailFwd
    extends java.lang.Object
    EPPEmailFwd is the primary client interface class used for email forward management. An instance of EPPEmailFwd 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.emailFwd package.

    See Also:
    EPPResponse, EPPEmailFwdCreateResp, EPPEmailFwdInfoResp, EPPEmailFwdCheckResp, EPPEmailFwdTransferResp
    • Constructor Detail

      • EPPEmailFwd

        public EPPEmailFwd​(EPPSession newSession)
        Constructs an EPPEmailFwd 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

        @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​(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.
      • addEmailFwdName

        public void addEmailFwdName​(java.lang.String newEmailFwd)
        Adds an email forward for use with a send method. Adding more than one email forward is only supported by sendCheck.
        Parameters:
        newEmailFwd - Email Forward name to add
      • addContact

        public void addContact​(java.lang.String newName,
                               java.lang.String newType)
        Will add a new contact which includes a name and a type.
        Parameters:
        newName - Contact Name
        newType - Contact Type, which should be a EPPEmailFwd.CONTACT_ constant.
      • setExpirationDate

        public void setExpirationDate​(java.util.Date newExpirationDate)
        Sets the Email Forward expiration date.
        Parameters:
        newExpirationDate - Email Forward expiration date
      • getExpirationDate

        public java.util.Date getExpirationDate()
        Gets the Email Forward expiration date.
        Returns:
        Email Forward expiration date
      • setTransferOpCode

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

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

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

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

        public java.lang.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​(java.lang.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
      • setForwardTo

        public void setForwardTo​(java.lang.String newForwardTo)
        Sets the forward to e-mail address associated with sendCreate and sendUpdate.
        Parameters:
        newForwardTo - Forward to e-mail address
      • getForwardTo

        public java.lang.String getForwardTo()
        Gets the forward to e-mail address associated with sendCreate and sendUpdate.
        Returns:
        Forward to e-mail address
      • getRegistrant

        public java.lang.String getRegistrant()
        Gets the Email Forward Registrant Contact Identifier.
        Returns:
        Email Forward Registrant Contact Identifier if defined; null otherwise.
      • setRegistrant

        public void setRegistrant​(java.lang.String aRegistrant)
        Sets the Email Forward Registrant Contact Identifier.
        Parameters:
        aRegistrant - Email Forward Registrant Contact Identifier.
      • sendCreate

        public EPPEmailFwdCreateResp sendCreate()
                                         throws EPPCommandException
        Sends an Email Forward Create Command to the server.

        The required attributes have been set with the following methods:

        • addEmailFwdName - Sets the email forward to create. Only one email forward is valid.
        • setForwardTo - Sets the forward to e-mail address
        • setAuthString - Sets the email forward 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)
        • setRegistrant - Sets the Registrant for the email forward. This is required for thick registries.
        • addContact - Add email forward contact
        Returns:
        EPPEmailFwdCreateResp containing the Email Forward 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 an Email Forward Update Command to the server.

        The required attributes have been set with the following methods:

        • addEmailFwdName - Sets the email forward to update. Only one email forward is valid.


        The optional attributes have been set with the following:

        • setTransId - Sets the client transaction identifier
        • setForwardTo - Sets the forward to e-mail address
        • setUpdateAttrib(int,EmailFwdStatus,int) - Adds/removes statuses
        • setUpdateAttrib(int,String,String,int) - Adds/removes contacts
        • setRegistrant - Sets the Registrant for the email forward.
        • setAuthString - Sets the email forward authorization string.
        At least one update attribute needs to be set.
        Returns:
        EPPResponse containing the Email Forward update result.
        Throws:
        EPPCommandException - Error executing the update command. Use getResponse to get the associated server error response.
      • sendTransfer

        public EPPEmailFwdTransferResp sendTransfer()
                                             throws EPPCommandException
        Sends an Email Forward Transfer Command to the server.

        The required attributes have been set with the following methods:

        • addEmailFwdName - Sets the email forward for transfer command. Only one email forward is valid.
        • setTransferOpCode - Sets the email forward transfer operation.
        • setAuthString - Sets the email forward 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:
        EPPEmailFwdTransferResp containing the Email Forward transfer result.
        Throws:
        EPPCommandException - Error executing the create command. Use getResponse to get the associated server error response.
      • sendRenew

        public EPPEmailFwdRenewResp sendRenew()
                                       throws EPPCommandException
        Sends an Email Forward Renew Command to the server.

        The required attributes have been set with the following methods:

        • addEmailFwdName - Sets the email forward to renew. Only one email forward is valid.
        • 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:
        EPPEmailFwdRenewResp containing the Email Forward renew result.
        Throws:
        EPPCommandException - Error executing the renew command. Use getResponse to get the associated server error response.
      • sendInfo

        public EPPEmailFwdInfoResp sendInfo()
                                     throws EPPCommandException
        Sends an Email Forward Info Command to the server.

        The required attributes have been set with the following methods:

        • addEmailFwdName - Sets the email forward to get info for. Only one email forward is valid.


        The optional attributes have been set with the following:

        • setTransId - Sets the client transaction identifier
        Returns:
        EPPEmailFwdInfoResp containing the Email Forward information.
        Throws:
        EPPCommandException - Error executing the info command. Use getResponse to get the associated server error response.
      • sendCheck

        public EPPEmailFwdCheckResp sendCheck()
                                       throws EPPCommandException
        Sends an Email Forward Check Command to the server.

        The required attributes have been set with the following methods:

        • addEmailFwdName - Adds an email forward to check. More than one email forward can be checked in sendCheck


        The optional attributes have been set with the following:

        • setTransId - Sets the client transaction identifier
        Returns:
        EPPEmailFwdCheckResp containing the Email Forward 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 an Email Forward Delete Command to the server.

        The required attributes have been set with the following methods:

        • addEmailFwdName - Sets the email forward to delete. Only one email forward 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.
      • setUpdateAttrib

        public void setUpdateAttrib​(int newType,
                                    EPPEmailFwdStatus newName,
                                    int newOp)
                             throws EPPCommandException
        Sets an update to an email forward status. Email Forward statuses can be either added or removed.
        Parameters:
        newType - Must be set to STATUS
        newName - Name of status, which can use one of the STATUS_ constants
        newOp - Either ADD or REMOVE
        Throws:
        EPPCommandException - Invalid type or operation
      • setUpdateAttrib

        public void setUpdateAttrib​(int newType,
                                    java.lang.String newVal,
                                    java.lang.String newValType,
                                    int newOp)
                             throws EPPCommandException
        Sets an update to an email forward contact. Email Forward contacts can be either added or removed.
        Parameters:
        newType - Must be set to CONTACT
        newVal - Contact Identifier
        newValType - Contact Type, which should be one of the CONTACT_ constants.
        newOp - Either ADD or REMOVE
        Throws:
        EPPCommandException - Invalid type or operation
      • 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.
        Returns:
        Registration period; null otherwise.
      • setPeriodLength

        public void setPeriodLength​(int newPeriodLength)
        Gets the registration period.
        Parameters:
        newPeriodLength - Registration period
      • getPeriodUnit

        public java.lang.String getPeriodUnit()
        Gets the registration period unit.
        Returns:
        Registration period unit if defined; null otherwise.
      • setPeriodUnit

        public void setPeriodUnit​(java.lang.String newPeriodUnit)
        Sets the registration period unit to either PERIOD_MONTH or PERIOD_YEAR.
        Parameters:
        newPeriodUnit - Registration period unit