public abstract class EPPCommand extends java.lang.Object implements EPPMessage
EPPCommand
can be encoded and decoded by
EPPCodec
. 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.Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
extensions
Extension objects associated with the command.
|
static java.lang.String |
OP_APPROVE
command approve operation currently associated with a <transfer>
command.
|
static java.lang.String |
OP_CANCEL
command cancel operation associated with a <transfer> command.
|
static java.lang.String |
OP_QUERY
command query operation associated with a <transfer> command.
|
static java.lang.String |
OP_REJECT
command reject operation associated with a <transfer> command.
|
static java.lang.String |
OP_REQUEST
command request operation associated with a <transfer> command.
|
protected java.lang.String |
transId
Client Transaction id associated with the command
|
static java.lang.String |
TYPE_CHECK
command type associated with the general EPP <check> command.
|
static java.lang.String |
TYPE_CREATE
command type associated with the general EPP <create> command.
|
static java.lang.String |
TYPE_DELETE
command type associated with the general EPP <delete> command.
|
static java.lang.String |
TYPE_INFO
command type associated with the general EPP <info> command.
|
static java.lang.String |
TYPE_LOGIN
command type associated with the general EPP <login> command.
|
static java.lang.String |
TYPE_LOGOUT
command type associated with the general EPP <logout> command.
|
static java.lang.String |
TYPE_POLL
command type associated with the general EPP <poll> command.
|
static java.lang.String |
TYPE_RENEW
command type associated with the general EPP <renew> command.
|
static java.lang.String |
TYPE_TRANSFER
command type associated with the general EPP <transfer> command.
|
static java.lang.String |
TYPE_UPDATE
command type associated with the general EPP <update> command.
|
Constructor and Description |
---|
EPPCommand()
Allocates a new
EPPCommand with default attribute values. |
EPPCommand(java.lang.String aTransId)
Allocates a new
EPPCommand setting the client transaction id. |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(EPPCodecComponent aExtension)
Adds a command extension object.
|
java.lang.Object |
clone()
Clone
EPPCommand . |
void |
decode(org.w3c.dom.Element aElement)
decode
EPPCommand from a DOM element tree. |
protected abstract void |
doGenDecode(org.w3c.dom.Element aElement)
Decodes the atributes of a general extension of
EPPCommand . |
protected abstract org.w3c.dom.Element |
doGenEncode(org.w3c.dom.Document aDocument)
Encodes the atributes of a general extension of
EPPCommand . |
org.w3c.dom.Element |
encode(org.w3c.dom.Document aDocument)
encode
EPPCommand into a DOM element tree. |
boolean |
equals(java.lang.Object aObject)
implements a deep
EPPCommand compare. |
EPPCodecComponent |
getExtension(java.lang.Class aExtensionClass)
Gets the command extension object with the specified class.
|
EPPCodecComponent |
getExtension(java.lang.Class aExtensionClass,
boolean aFailOnDuplicate)
Gets the command extension object with the specified class with the option
to fail when a duplicate extension is found.
|
java.util.Vector |
getExtensions()
Gets the command extensions.
|
abstract java.lang.String |
getNamespace()
Gets the EPP namespace associated with the
EPPCommand . |
java.lang.String |
getOp()
Gets the string operation of the concrete
EPPCommand . |
java.lang.String |
getTransId()
Gets the Client Transaction Id associated with the
EPPCommand
. |
abstract java.lang.String |
getType()
Gets command type of the
EPPCommand . |
boolean |
hasExtension(java.lang.Class aExtensionClass)
Does the command have a command extension object of a specified class?
|
boolean |
hasExtensions()
Does the command have a command extension objects?
|
boolean |
hasTransId()
Does the command have a client transaction id?
|
void |
setExtension(EPPCodecComponent aExtension)
Deprecated.
Replaced by
addExtension(EPPCodecComponent) . This
method will add the extension as is done in
addExtension(EPPCodecComponent) . |
void |
setExtensions(java.util.Vector aExtensions)
Sets the command extension objects.
|
void |
setTransId(java.lang.String aTransId)
Sets the Client Transaction Id associated with the EPPCommand.
|
java.lang.String |
toString()
Implementation of
Object.toString , which will result in an
indented XML String representation of the concrete
EPPCodecComponent . |
public static final java.lang.String TYPE_LOGIN
public static final java.lang.String TYPE_LOGOUT
public static final java.lang.String TYPE_INFO
public static final java.lang.String TYPE_CHECK
public static final java.lang.String TYPE_TRANSFER
public static final java.lang.String TYPE_CREATE
public static final java.lang.String TYPE_DELETE
public static final java.lang.String TYPE_RENEW
public static final java.lang.String TYPE_UPDATE
public static final java.lang.String TYPE_POLL
public static final java.lang.String OP_APPROVE
public static final java.lang.String OP_CANCEL
public static final java.lang.String OP_QUERY
public static final java.lang.String OP_REJECT
public static final java.lang.String OP_REQUEST
protected java.lang.String transId
protected java.util.Vector extensions
EPPCodecComponent
interface.public EPPCommand()
EPPCommand
with default attribute values. The
defaults include the following: null
. This attribute can be set
using setTransId
before invoking encode
.public EPPCommand(java.lang.String aTransId)
EPPCommand
setting the client transaction id.aTransId
- Client Transaction id associated with the command.public boolean hasTransId()
getTransId
.true
if this is a transaction id; false
otherwise.public java.lang.String getTransId()
EPPCommand
.String
instance if defined; null otherwise.public void setTransId(java.lang.String aTransId)
aTransId
- Client Transaction Id String
public abstract java.lang.String getNamespace()
EPPCommand
.getNamespace
in interface EPPCodecComponent
getNamespace
in interface EPPMessage
EPPCommand
.public abstract java.lang.String getType()
EPPCommand
. Each command is
associated with a single command type equal to one of the
EPPCommand.TYPE_
constants and optionally a command operation
equal to one of the EPPCommand.OP_
constants.String
(EPPCommand.TYPE_
)public java.lang.String getOp()
EPPCommand
. The
type should be equal to one of the EPPCommand.OP_
constants,
or null if there is no operation.public boolean hasExtension(java.lang.Class aExtensionClass)
getExtensions(Class)
.aExtensionClass
- DOCUMENT ME!true
if the extension object exists;
false
otherwise.public EPPCodecComponent getExtension(java.lang.Class aExtensionClass)
EPPExtensionFactory
must be
created for the extension, which returns an instance of
EPPCodecComponent
for an instance of an extension object in
the EPP Command.aExtensionClass
- of desired extensionEPPCodecComponent
associated with the
command if exists; null
otherwise.public EPPCodecComponent getExtension(java.lang.Class aExtensionClass, boolean aFailOnDuplicate) throws EPPDuplicateExtensionException
EPPExtensionFactory
must be created
for the extension, which returns an instance of
EPPCodecComponent
for an instance of an extension object in
the EPPCommand
.aExtensionClass
- Class
of desired extensionaFailOnDuplicate
- Throw EPPDuplicateExtensionException
if
true
and a duplicate extension is foundEPPCodecComponent
associated with the
command if exists; null
otherwise.EPPDuplicateExtensionException
- If a duplicate extension is found with the extension
included in the extension@Deprecated public void setExtension(EPPCodecComponent aExtension)
addExtension(EPPCodecComponent)
. This
method will add the extension as is done in
addExtension(EPPCodecComponent)
.aExtension
- command extension object associated with the commandpublic void addExtension(EPPCodecComponent aExtension)
aExtension
- command extension object associated with the commandpublic boolean hasExtensions()
getExtensions
.true
if there are extension objects;
false
otherwise.public java.util.Vector getExtensions()
EPPExtensionFactory
must be created for the extension,
which returns an instance of EPPCodecComponent
for an
instance of an extension object in the EPP Command.Vector
of concrete EPPCodecComponent
associated with the command if exists; null
otherwise.public void setExtensions(java.util.Vector aExtensions)
aExtensions
- command extension objects associated with the commandpublic org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
EPPCommand
into 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.encode
in interface EPPCodecComponent
aDocument
- DOCUMENT ME!EPPEncodeException
- Error encoding the DOM element tree.public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException, EPPComponentNotFoundException
EPPCommand
from a DOM element tree. The "command"
element needs to be the value of the aElement
argument. This
method is a Template Method in the Template Method Design Pattern.decode
in interface EPPCodecComponent
aElement
- <command> root element tree.EPPDecodeException
- Error decoding the DOM element tree.EPPComponentNotFoundException
- An extension component could not be foundpublic boolean equals(java.lang.Object aObject)
EPPCommand
compare.equals
in class java.lang.Object
aObject
- EPPCommand
instance to compare withpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
EPPCommand
.clone
in interface EPPCodecComponent
clone
in class java.lang.Object
EPPCommand
java.lang.CloneNotSupportedException
- standard Object.clone exceptionpublic java.lang.String toString()
Object.toString
, which will result in an
indented XML String
representation of the concrete
EPPCodecComponent
.toString
in class java.lang.Object
String
if successful; ERROR
otherwise.protected abstract org.w3c.dom.Element doGenEncode(org.w3c.dom.Document aDocument) throws EPPEncodeException
EPPCommand
.
An example of a general extension is EPPCreateCmd
.
encode
is a Template Method and this method is a
Primitive Operation within the Template Method Design Pattern.aDocument
- DOM document used as a factory of DOM objects.EPPEncodeException
- Error encoding the DOM element tree.protected abstract void doGenDecode(org.w3c.dom.Element aElement) throws EPPDecodeException
EPPCommand
.
An example of a general extension is EPPCreateCmd
.
decode
is a Template Method and this method is a
Primitive Operation within the Template Method Design Pattern.aElement
- root DOM element associated with instanceEPPDecodeException
- Error decoding the DOM element tree.Copyright © VeriSign Inc. All Rights Reserved.