Class EPPPollCmd

java.lang.Object
com.verisign.epp.codec.gen.EPPCommand
com.verisign.epp.codec.gen.EPPPollCmd
All Implemented Interfaces:
EPPCodecComponent, EPPMessage, Serializable, Cloneable

public class EPPPollCmd extends EPPCommand
The EPP <pollgt; command is used to discover and retrieve client service messages from a server. Information that MAY be made available to a client using service messages includes notification of object transfer requests and anticipated server outages; other messages types MAY be defined as a matter of server policy.

Service messages are queued by the server for client retrieval. A <pollgt; command MUST return the first message from the message queue. Each message returned from the server includes a server-unique message identifier that MUST be provided to acknowledge receipt of the message, and a counter that indicates the number of messages in the queue. As a message is received by the client, the client MUST respond to the message with an explicit acknowledgement to confirm that the message has been received. A server MUST dequeue a message and decrement the queue counter after receiving acknowledgement from the client, making the next message in the queue (if any) available for retrieval.

Some of the information returned in response to a <pollgt; command MAY be object-specific, so some child elements of the <pollgt; response MAY be specified using the EPP extension framework. In addition to the standard EPP command elements, the <pollgt; command SHALL contain no child elements and an op attribute with value req to retrieve the first message from the server message queue, or both an op attribute with value ack and a msgID attribute whose value corresponds to the value of id attribute copied from the <msggt; element in the response that is being acknowledged.

See Also:
  • Field Details

    • OP_REQ

      public static final String OP_REQ
      Poll operation type indicating that the client is requesting information from the server.
      See Also:
    • OP_ACK

      public static final String OP_ACK
      Poll operation type indicating that the client has received a message and that the server can remove the message.
      See Also:
    • op

      protected String op
      Operation "op" associated with the EPPPollCmd. This should be equal to one of the EPPPollCmd.OP_ constants.
    • msgID

      protected String msgID
      msgID attribute whose value corresponds to the value of id attribute copied from the msg element in the response that is being acknowledged.
  • Constructor Details

    • EPPPollCmd

      public EPPPollCmd()
      Default constructor. Will set both op and msgId to null.
    • EPPPollCmd

      public EPPPollCmd(String aTransId, String aOp)
      EPPPollCmd that takes all required attributes as arguments for a EPPPollCmd.OP_REQ poll command. If aOp is EPPPollCmd.OP_ACK, the message id must be set with setMsgId before calling encode.
      Parameters:
      aTransId - Transaction Id associated with command.
      aOp - One of the EPPPollCmd.OP_ constants.
    • EPPPollCmd

      public EPPPollCmd(String aTransId, String aOp, String aMsgID)
      EPPPollCmd that takes attributes as arguments.
      Parameters:
      aTransId - Transaction Id associated with command.
      aOp - One of the EPPPollCmd.OP_ constants.
      aMsgID - Message Id when operation isEPPPollCmd.OP_ACK.
  • Method Details

    • getType

      public String getType()
      Gets the EPP command type associated with EPPPollCmd.
      Specified by:
      getType in class EPPCommand
      Returns:
      EPPCommand.TYPE_POLL
    • getOp

      public String getOp()
      Gets the EPP command operation attribute associated with EPPPollCmd.
      Overrides:
      getOp in class EPPCommand
      Returns:
      One of the EPPCommand.OP_ constants associated with the poll command.
    • equals

      public boolean equals(Object aObject)
      Compares an instance of EPPPollCmd with this instance.
      Overrides:
      equals in class EPPCommand
      Parameters:
      aObject - Object to compare with.
      Returns:
      true if equal; false otherwise.
    • doGenEncode

      protected Element doGenEncode(Document aDocument) throws EPPEncodeException
      Encodes a DOM Element tree from the attributes of the EPPPollCmd instance. This method is a member of the Template Design Pattern. EPPCommand.encode is a Template Method and this method is a Primitive Operation within the Template Method Design Pattern.
      Specified by:
      doGenEncode in class EPPCommand
      Parameters:
      aDocument - - DOM Document that is being built. Used as an Element factory.
      Returns:
      Root DOM Element representing the EPPPollCmd instance.
      Throws:
      EPPEncodeException - Unable to encode EPPPollCmd instance.
    • doGenDecode

      protected void doGenDecode(Element aElement) throws EPPDecodeException
      Decodes the EPPPollCmd attributes from the aElement DOM Element tree. This method is a member of the Template Design Pattern. EPPCommand.decode is a Template Method and this method is a Primitive Operation within the Template Method Design Pattern.
      Specified by:
      doGenDecode in class EPPCommand
      Parameters:
      aElement - - Root DOM Element to decode EPPPollCmd from.
      Throws:
      EPPDecodeException - Unable to decode aElement
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPPollCmd.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class EPPCommand
      Returns:
      clone of EPPPollCmd
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • doEncode

      protected Element doEncode(Document aDocument) throws EPPEncodeException
      Must be defined by EPPPollCmd extensions (Command Mappings) to encode the attributes to a DOM Element tree. doGenEncode is a Template Method and this method is a Primitive Operation within the Template Method Design Pattern.
      Parameters:
      aDocument - - DOM Document that is being built. Used as an Element factory.
      Returns:
      Root DOM Element representing the EPPPollCmd extension instance.
      Throws:
      EPPEncodeException - Unable to encode EPPPollCmd extension instance.
    • doDecode

      protected void doDecode(Element aElement) throws EPPDecodeException
      Must be defined by EPPPollCmd extensions (Command Mappings) to decode the attributes to a DOM Element tree. doGenDecode is a Template Method and this method is a Primitive Operation within the Template Method Design Pattern.
      Parameters:
      aElement - Root DOM Element representing the EPPPollCmd extension instance.
      Throws:
      EPPDecodeException - Unable to decode aElement.
    • getMsgID

      public String getMsgID()
      Gets the poll Message Id.
      Returns:
      Message Id if defined; null otherwise.
    • getNamespace

      public String getNamespace()
      Gets the associated EPP namespace. The general EPP namespace is returned, which is defined as EPPCodec.NS.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Specified by:
      getNamespace in interface EPPMessage
      Specified by:
      getNamespace in class EPPCommand
      Returns:
      namespace URI
    • setMsgID

      public void setMsgID(String aMsgID)
      Sets the poll Message Id.
      Parameters:
      aMsgID - Message Id