Package com.verisign.epp.codec.gen
Class EPPCommand
java.lang.Object
com.verisign.epp.codec.gen.EPPCommand
- All Implemented Interfaces:
EPPCodecComponent,EPPMessage,Serializable,Cloneable
- Direct Known Subclasses:
EPPCheckCmd,EPPCreateCmd,EPPDeleteCmd,EPPInfoCmd,EPPLoginCmd,EPPLogoutCmd,EPPPollCmd,EPPRenewCmd,EPPTransferCmd,EPPUpdateCmd
Represents an EPP command that is sent by an EPP Client and received by an
EPP Server. An
Every EPP command must extend
EPPCommand can be encoded and decoded by
EPPCodec. Every EPP command must extend
EPPCommand and implement the Template
Method Design Pattern doGenEncode and doGenDecode methods. An
EPPCommand client will call encode or decode, which
in turn will call doGenEncode or doGenDecode, respectively.
There is one derived EPPCommand for each type of command defined in
the general EPP Specification.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector<EPPCodecComponent> Extension objects associated with the command.static final Stringcommand approve operation currently associated with a <transfer> command.static final Stringcommand cancel operation associated with a <transfer> command.static final Stringcommand query operation associated with a <transfer> command.static final Stringcommand reject operation associated with a <transfer> command.static final Stringcommand request operation associated with a <transfer> command.protected StringClient Transaction id associated with the commandstatic final Stringcommand type associated with the general EPP <check> command.static final Stringcommand type associated with the general EPP <create> command.static final Stringcommand type associated with the general EPP <delete> command.static final Stringcommand type associated with the general EPP <info> command.static final Stringcommand type associated with the general EPP <login> command.static final Stringcommand type associated with the general EPP <logout> command.static final Stringcommand type associated with the general EPP <poll> command.static final Stringcommand type associated with the general EPP <renew> command.static final Stringcommand type associated with the general EPP <transfer> command.static final Stringcommand type associated with the general EPP <update> command. -
Constructor Summary
ConstructorsConstructorDescriptionAllocates a newEPPCommandwith default attribute values.EPPCommand(String aTransId) Allocates a newEPPCommandsetting the client transaction id. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(EPPCodecComponent aExtension) Adds a command extension object.clone()CloneEPPCommand.voiddecodeEPPCommandfrom a DOM element tree.protected abstract voiddoGenDecode(Element aElement) Decodes the atributes of a general extension ofEPPCommand.protected abstract ElementdoGenEncode(Document aDocument) Encodes the atributes of a general extension ofEPPCommand.encodeEPPCommandinto a DOM element tree.booleanimplements a deepEPPCommandcompare.Find the set of duplicate EPP extension XML namespaces based on the list of EPP extensions set in the command.findExtNamespaces(List<String> aFilterExtNamespaces) Find the set of unique EPP extension XML namespaces based on the list of EPP extensions set in the command.findExtNamespaceSuffixes(List<String> aFilterExtNamespaceSuffixes) Find the set of unique EPP extension XML namespace suffixes based on the list of EPP extensions set in the command and the optional use of a list of XML namespace suffixes to filter.findUnsupportedExtNamespaces(List<String> aSupportedExtNamespaces) Find the set of unsupported EPP extension XML namespaces based the passed in supported extension XML namespaces and on the list of EPP extensions set in the command.findUnsupportedExtNamespaceSuffixes(List<String> aSupportedExtNamespaceSuffixes) Find the set of unsupported EPP extensions based on passing the list of supported extension XML namespace suffixes and the list of EPP extensions set in the command.getExtension(Class aExtensionClass) Gets the command extension object with the specified class.getExtension(Class aExtensionClass, boolean aFailOnDuplicate) Gets the command extension object with the specified class with the option to fail when a duplicate extension is found.Gets the command extensions.getKey()Gets the key of the command object.abstract StringGets the EPP namespace associated with theEPPCommand.getOp()Gets the string operation of the concreteEPPCommand.Gets the Client Transaction Id associated with theEPPCommand.abstract StringgetType()Gets command type of theEPPCommand.booleanhasExtension(Class aExtensionClass) Does the command have a command extension object of a specified class? If so, the command extension object can be retrieved with a call togetExtensions(Class).booleanDoes the command have a command extension objects? If so, the command extension objects can be retrieved with a call togetExtensions.booleanhasKey()Has the key been set?booleanDoes the command have a client transaction id? If so, the transaction id can be retrieved with a call togetTransId.voidsetExtension(EPPCodecComponent aExtension) Deprecated.voidsetExtensions(Vector<EPPCodecComponent> aExtensions) Sets the command extension objects.voidsetTransId(String aTransId) Sets the Client Transaction Id associated with the EPPCommand.toString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
Field Details
-
TYPE_LOGIN
command type associated with the general EPP <login> command.- See Also:
-
TYPE_LOGOUT
command type associated with the general EPP <logout> command.- See Also:
-
TYPE_INFO
command type associated with the general EPP <info> command.- See Also:
-
TYPE_CHECK
command type associated with the general EPP <check> command.- See Also:
-
TYPE_TRANSFER
command type associated with the general EPP <transfer> command.- See Also:
-
TYPE_CREATE
command type associated with the general EPP <create> command.- See Also:
-
TYPE_DELETE
command type associated with the general EPP <delete> command.- See Also:
-
TYPE_RENEW
command type associated with the general EPP <renew> command.- See Also:
-
TYPE_UPDATE
command type associated with the general EPP <update> command.- See Also:
-
TYPE_POLL
command type associated with the general EPP <poll> command.- See Also:
-
OP_APPROVE
command approve operation currently associated with a <transfer> command.- See Also:
-
OP_CANCEL
command cancel operation associated with a <transfer> command.- See Also:
-
OP_QUERY
command query operation associated with a <transfer> command.- See Also:
-
OP_REJECT
command reject operation associated with a <transfer> command.- See Also:
-
OP_REQUEST
command request operation associated with a <transfer> command.- See Also:
-
transId
Client Transaction id associated with the command -
extensions
Extension objects associated with the command. The extension object is associated with a unique XML Namespace, XML Schema, and can be any simple or complex object that implements theEPPCodecComponentinterface.
-
-
Constructor Details
-
EPPCommand
public EPPCommand()Allocates a newEPPCommandwith default attribute values. The defaults include the following:
- transaction id is set to
null. This attribute can be set usingsetTransIdbefore invokingencode.
- transaction id is set to
-
EPPCommand
Allocates a newEPPCommandsetting the client transaction id.- Parameters:
aTransId- Client Transaction id associated with the command.
-
-
Method Details
-
hasTransId
public boolean hasTransId()Does the command have a client transaction id? If so, the transaction id can be retrieved with a call togetTransId.- Returns:
trueif this is a transaction id;falseotherwise.
-
getTransId
Gets the Client Transaction Id associated with theEPPCommand.- Returns:
Stringinstance if defined; null otherwise.
-
setTransId
Sets the Client Transaction Id associated with the EPPCommand.- Parameters:
aTransId- Client Transaction IdString
-
getNamespace
Gets the EPP namespace associated with theEPPCommand.- Specified by:
getNamespacein interfaceEPPCodecComponent- Specified by:
getNamespacein interfaceEPPMessage- Returns:
- Namespace URI associated with the
EPPCommand.
-
getType
Gets command type of theEPPCommand. Each command is associated with a single command type equal to one of theEPPCommand.TYPE_constants and optionally a command operation equal to one of theEPPCommand.OP_constants.- Returns:
- Command type
String(EPPCommand.TYPE_)
-
getOp
Gets the string operation of the concreteEPPCommand. The type should be equal to one of theEPPCommand.OP_constants, or null if there is no operation.- Returns:
- Operation of concrete EPPCommand if exists; null otherwise.
-
hasKey
public boolean hasKey()Has the key been set?- Returns:
trueif the key has been set;falseotherwise.
-
getKey
Gets the key of the command object. The key is used for lookup of the existing object, such as the domain name for the domain name object or the contact identifier for the contact object. The concrete commands that have a key need to override this method.- Returns:
- The command object key if defined;
nullotherwise
-
hasExtension
Does the command have a command extension object of a specified class? If so, the command extension object can be retrieved with a call togetExtensions(Class).- Parameters:
aExtensionClass- Command extension class- Returns:
trueif the extension object exists;falseotherwise.
-
getExtension
Gets the command extension object with the specified class. The extension object is an unspecified element in the EPP Specifications. To create an extension object, an XML Schema for the extension object must exist with a unique XML Namespace. A customEPPExtensionFactorymust be created for the extension, which returns an instance ofEPPCodecComponentfor an instance of an extension object in the EPP Command.- Parameters:
aExtensionClass- of desired extension- Returns:
- Concrete
EPPCodecComponentassociated with the command if exists;nullotherwise.
-
getExtension
public EPPCodecComponent getExtension(Class aExtensionClass, boolean aFailOnDuplicate) throws EPPDuplicateExtensionException Gets the command extension object with the specified class with the option to fail when a duplicate extension is found. The extension object is an unspecified element in the EPP Specifications. To create an extension object, an XML Schema for the extension object must exist with a unique XML Namespace. A customEPPExtensionFactorymust be created for the extension, which returns an instance ofEPPCodecComponentfor an instance of an extension object in theEPPCommand.- Parameters:
aExtensionClass-Classof desired extensionaFailOnDuplicate- ThrowEPPDuplicateExtensionExceptioniftrueand a duplicate extension is found- Returns:
- Concrete
EPPCodecComponentassociated with the command if exists;nullotherwise. - Throws:
EPPDuplicateExtensionException- If a duplicate extension is found with the extension included in the extension
-
setExtension
Deprecated.Replaced byaddExtension(EPPCodecComponent). This method will add the extension as is done inaddExtension(EPPCodecComponent).Sets a command extension object. The extension object is an unspecified element in the EPP Specifications. The unspecified element will be encoded under the <unspec> element of the EPP Command.- Parameters:
aExtension- command extension object associated with the command
-
addExtension
Adds a command extension object. The extension object is an unspecified element in the EPP Specifications. The unspecified element will be encoded under the <unspec> element of the EPP Command.- Parameters:
aExtension- command extension object associated with the command
-
hasExtensions
public boolean hasExtensions()Does the command have a command extension objects? If so, the command extension objects can be retrieved with a call togetExtensions.- Returns:
trueif there are extension objects;falseotherwise.
-
getExtensions
Gets the command extensions. The extension objects are an unspecified elements in the EPP Specification. To create an extension object, an XML Schema for the extension object must exist with a unique XML Namespace. A customEPPExtensionFactorymust be created for the extension, which returns an instance ofEPPCodecComponentfor an instance of an extension object in the EPP Command.- Returns:
Vectorof concreteEPPCodecComponentassociated with the command if exists;nullotherwise.
-
setExtensions
Sets the command extension objects. The extension objects are an unspecified element in the EPP Specifications. The unspecified element will be encoded under the <unspec> element of the EPP Command.- Parameters:
aExtensions- command extension objects associated with the command
-
findDuplicateExtNamespaces
Find the set of duplicate EPP extension XML namespaces based on the list of EPP extensions set in the command.- Returns:
Setof duplicate EPP extension XML namespaces;nullotherwise.
-
findUnsupportedExtNamespaces
Find the set of unsupported EPP extension XML namespaces based the passed in supported extension XML namespaces and on the list of EPP extensions set in the command.- Parameters:
aSupportedExtNamespaces- List of EPP extensions to scan for unsupported XML namespaces. Passnullfor no supported extensions.- Returns:
Setof unsupported EPP extension XML namespaces;nullotherwise.
-
findUnsupportedExtNamespaceSuffixes
Find the set of unsupported EPP extensions based on passing the list of supported extension XML namespace suffixes and the list of EPP extensions set in the command.- Parameters:
aSupportedExtNamespaceSuffixes- List of EPP extensions to scan for unsupported XML namespace suffixes. Passnullfor no supported extensions.- Returns:
Setof unsupported EPP extension XML namespace suffixes;nullotherwise.
-
findExtNamespaces
Find the set of unique EPP extension XML namespaces based on the list of EPP extensions set in the command.- Parameters:
aFilterExtNamespaces- Filter extension namespaces from the returned set. Set tonullfor no filtering.- Returns:
Setof unique EPP extension XML namespaces.
-
findExtNamespaceSuffixes
Find the set of unique EPP extension XML namespace suffixes based on the list of EPP extensions set in the command and the optional use of a list of XML namespace suffixes to filter.- Parameters:
aFilterExtNamespaceSuffixes- Filter extension namespace suffixes from the returned set. Set tonullfor no filtering.- Returns:
Setof unique EPP extension XML namespace suffixes.
-
encode
encodeEPPCommandinto a DOM element tree. The <command> element is created and the attribute nodes are appending as children. This method is a Template Method in the Template Method Design Pattern.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- DOCUMENT ME!- Returns:
- <command> root element tree.
- Throws:
EPPEncodeException- Error encoding the DOM element tree.
-
decode
decodeEPPCommandfrom a DOM element tree. The "command" element needs to be the value of theaElementargument. This method is a Template Method in the Template Method Design Pattern.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- <command> root element tree.- Throws:
EPPDecodeException- Error decoding the DOM element tree.EPPComponentNotFoundException- An extension component could not be found
-
equals
implements a deepEPPCommandcompare. -
clone
CloneEPPCommand.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPCommand - Throws:
CloneNotSupportedException- standard Object.clone exception
-
toString
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent. -
doGenEncode
Encodes the atributes of a general extension ofEPPCommand. An example of a general extension isEPPCreateCmd.encodeis a Template Method and this method is a Primitive Operation within the Template Method Design Pattern.- Parameters:
aDocument- DOM document used as a factory of DOM objects.- Returns:
- instance root DOM element along with attribute child nodes.
- Throws:
EPPEncodeException- Error encoding the DOM element tree.
-
doGenDecode
Decodes the atributes of a general extension ofEPPCommand. An example of a general extension isEPPCreateCmd.decodeis a Template Method and this method is a Primitive Operation within the Template Method Design Pattern.- Parameters:
aElement- root DOM element associated with instance- Throws:
EPPDecodeException- Error decoding the DOM element tree.
-
addExtension(EPPCodecComponent).