public class EPPResponse extends java.lang.Object implements EPPMessage
EPPResponse
can be encoded and decoded by
EPPCodec
. Every EPP response contain the following:EPPCommand
EPPResult
instances.EPPResponse
is a concrete class that can be extended by the
Command Mapping responses. A Command Mapping response must override the
Template Design Pattern doEncode
and doDecode
methods. EPPResponse
provides a default doEncode
and doDecode
implementation that does nothing. An
EPPResponse
client will call encode
or
decode
, which in turn will call doEncode
or
doDecode
, respectively.Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
extensions
Extension objects associated with the response.
|
static java.lang.String |
TRANSFER_CLIENT_APPROVED
Transfer status constant - clientApproved
|
static java.lang.String |
TRANSFER_CLIENT_CANCELLED
Transfer status constant - clientCancelled
|
static java.lang.String |
TRANSFER_CLIENT_REJECTED
Transfer status constant - clientRejected
|
static java.lang.String |
TRANSFER_PENDING
Transfer status constant - pending
|
static java.lang.String |
TRANSFER_SERVER_APPROVED
Transfer status constant - serverApproved
|
static java.lang.String |
TRANSFER_SERVER_CANCELLED
Transfer status constant - serverCancelled
|
Constructor and Description |
---|
EPPResponse()
Allocates a new
EPPResponse with default attribute values. |
EPPResponse(EPPTransId aTransId)
Allocates a new
EPPResponse setting the transaction id. |
EPPResponse(EPPTransId aTransId,
EPPResult aResult)
Allocates a new
EPPResponse setting the transaction id and an
individual result. |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(EPPCodecComponent aExtension)
Adds an extension object.
|
java.lang.Object |
clone()
Clone
EPPResponse . |
void |
decode(org.w3c.dom.Element aElement)
decode
EPPResponse from a DOM element tree. |
protected void |
doDecode(org.w3c.dom.Element aElement)
Decodes the attributes of the concrete
EPPResponse and must
be overridden by EPPResponse derived classes. |
protected org.w3c.dom.Element |
doEncode(org.w3c.dom.Document aDocument)
Encodes the attributes of the concrete
EPPResponse and must
be overridden by EPPResponse derived classes. |
org.w3c.dom.Element |
encode(org.w3c.dom.Document aDocument)
encode
EPPResponse into a DOM element tree. |
boolean |
equals(java.lang.Object aObject)
implements a deep
EPPResponse compare. |
EPPCodecComponent |
getExtension(java.lang.Class aExtensionClass)
Gets the extension object with the specified class.
|
EPPCodecComponent |
getExtension(java.lang.Class aExtensionClass,
boolean aFailOnDuplicate)
Gets the response extension object with the specified class with the
option to fail when a duplicate extension is found.
|
java.util.Vector |
getExtensions()
Gets the extensions.
|
java.lang.Long |
getMessageQueue()
Deprecated.
As of EPP 1.0, replaced with
getMsgQueueCount() |
EPPMsgQueue |
getMsgQueue()
Gets the response message queue object.
|
java.lang.Long |
getMsgQueueCount()
Convenience method for getting the message queue count attribute.
|
java.util.Date |
getMsgQueueDate()
Convenience method for getting the message queue date attribute.
|
java.lang.String |
getMsgQueueMsg()
Convenience method for getting the message queue message attribute.
|
java.lang.String |
getNamespace()
Gets the EPP namespace associated with the
EPPResponse . |
java.util.Date |
getQDate()
Deprecated.
As of EPP 1.0, replaced with
getMsgQueueDate() |
EPPResult |
getResult()
Gets the first result in the response.
|
java.util.Vector |
getResults()
Gets the Vector of results associated with the
EPPResponse . |
EPPTransId |
getTransId()
Gets the Transaction Id associated with the
EPPResponse . |
java.lang.String |
getType()
Gets the EPP response extension type name or
null if there is
no extension. |
boolean |
hasExtension(java.lang.Class aExtensionClass)
Does the response have an extension object of a specified class?
|
boolean |
hasExtensions()
Does the response have an extension objects?
|
boolean |
hasMessageQueue()
Deprecated.
As of EPP 1.0, replaced with
hasMsgQueue() . This
method will return true if a message queue object
exists that has a non-null message count. |
boolean |
hasMsgQueue()
Does the response have a message queue object?
|
boolean |
hasResultCode(int aCode)
Does the response have a result with the specified result code?
|
boolean |
isSuccess()
Does the response have a success status?
|
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 response extension objects.
|
void |
setMsgQueue(EPPMsgQueue aMsgQueue)
Sets the response message queue object.
|
void |
setResult(EPPResult aResult)
Sets an individual result for the response with an
EPPResult
instance. |
void |
setResult(int aCode)
Sets an individual result for the response with a result code.
|
void |
setResult(int aCode,
java.lang.String aText)
Sets an individual result for the response with a result code and the
result text.
|
void |
setResult(int aCode,
java.lang.String aText,
java.util.Vector aValues)
Sets an individual result for the response with a result code, the result
text, and a Vector of
String values. |
void |
setResults(java.util.Vector someResults)
Sets the result(s) of the response as a Vector of
EPPResult
instances. |
void |
setTransId(EPPTransId aTransId)
Sets the Transaction Id associated with the
EPPResponse . |
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 TRANSFER_CLIENT_APPROVED
public static final java.lang.String TRANSFER_CLIENT_CANCELLED
public static final java.lang.String TRANSFER_CLIENT_REJECTED
public static final java.lang.String TRANSFER_PENDING
public static final java.lang.String TRANSFER_SERVER_APPROVED
public static final java.lang.String TRANSFER_SERVER_CANCELLED
protected java.util.Vector extensions
EPPCodecComponent
interface.public EPPResponse()
EPPResponse
with default attribute values.
The defaults include the following: null
. This attribute must be set
using setTransId
before invoking encode
.null
. This attribute is optional.
null
. This attribute is optional.
public EPPResponse(EPPTransId aTransId)
EPPResponse
setting the transaction id. The
results attribute will default to an individual successful result. Both
the extensions and the message queue will be set to null
.aTransId
- Transaction id associated with the response.public EPPResponse(EPPTransId aTransId, EPPResult aResult)
EPPResponse
setting the transaction id and an
individual result. Both the extensions and the message queue will be set
to null
.aTransId
- Transaction id associated with the response.aResult
- Result to associate with the response.public java.lang.String getType()
null
if there is
no extension.null
otherwise. For
example, getType
will return
EPPDomainCheckResp.ELM_NAME for a EPPDomainCheckResp instance.public EPPTransId getTransId()
EPPResponse
. This
should include the EPPCommand
client specified transaction
id, and a server generated transaction id.null
otherwise.public void setTransId(EPPTransId aTransId)
EPPResponse
. This
should include the EPPCommand
client specified transaction
id, and a server generated transaction id.aTransId
- Response transaction idpublic java.lang.String getNamespace()
EPPResponse
. A
base EPPResponse
instance will have the EPP namespace equal
to EPPCodec.NS
.getNamespace
in interface EPPCodecComponent
getNamespace
in interface EPPMessage
EPPResponse
.public java.util.Vector getResults()
EPPResponse
.EPPResult
instances.public EPPResult getResult()
getResults()
to get
all results associated with the response.null
otherwisepublic boolean isSuccess()
isSuccess
will check
that there is only one EPPResult
defined and the result code
is set to a value of 10??.true
if is success; false
otherwise.public boolean hasResultCode(int aCode)
aCode
- Result code to scan fortrue
if the result code exists in response;
false
otherwise.public void setResult(int aCode)
setResult(int)
will set the results to a Vector of one
EPPResult
with the result code set to aCode
.
aCode
- Result code (1000-9999)public void setResult(int aCode, java.lang.String aText)
setResult(int)
will set the results to a Vector of one
EPPResult
with the result code set to aCode
, and
the result text set to aText
. The language of the text will
default to "en". aCode
- Result code (1000-9999)aText
- Result text in the default "en" language.public void setResult(int aCode, java.lang.String aText, java.util.Vector aValues)
String
values. This method should only
be called if there is an error, since values are not included with
successful results. The EPP Specification defines the range of the result
codes to be 1000 - 9999. setResult(int)
will set the results to a Vector of one
EPPResult
with the result code set to aCode
, the
result text set to aText
, and the values set to
someValues
. The language of the text will default to "en".
aCode
- Result code (1000-9999)aText
- Result text in the default "en" language.aValues
- Vector of EPPValue
or EPPExtValue
instancespublic void setResult(EPPResult aResult)
EPPResult
instance. This method allows for specification of result attributes like
the text language.aResult
- Individual response result.public void setResults(java.util.Vector someResults)
EPPResult
instances. This method should only be used if there is an error, since
only errors can contain more than one result.someResults
- Vector of EPPResult
instancespublic boolean hasExtension(java.lang.Class aExtensionClass)
getExtensions(Class)
.aExtensionClass
- Specific extension class to look fortrue
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 Response.aExtensionClass
- of desired extensionEPPCodecComponent
associated with the
response 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 EPPResponse
.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
- response extension object associated with the responsepublic void addExtension(EPPCodecComponent aExtension)
aExtension
- extension object associated with the responsepublic 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 Response.Vector
of concrete EPPCodecComponent
associated with the response if exists; null
otherwise.public void setExtensions(java.util.Vector aExtensions)
aExtensions
- command extension objects associated with the command@Deprecated public boolean hasMessageQueue()
hasMsgQueue()
. This
method will return true
if a message queue object
exists that has a non-null
message count.getMessageQueue
.true
if this is an message queue object;
false
otherwise.@Deprecated public java.lang.Long getMessageQueue()
getMsgQueueCount()
Long
count of the number of messages.null
otherwise.@Deprecated public java.util.Date getQDate()
getMsgQueueDate()
null
otherwise.public boolean hasMsgQueue()
getMsgQueue
.true
if this is an message queue object;
false
otherwise.public void setMsgQueue(EPPMsgQueue aMsgQueue)
aMsgQueue
- queue objectpublic EPPMsgQueue getMsgQueue()
null
otherwise.public java.lang.Long getMsgQueueCount()
getMsgQueue()
and than calling EPPMsgQueue.getCount()
.null
otherwise.public java.util.Date getMsgQueueDate()
null
otherwise.public java.lang.String getMsgQueueMsg()
null
otherwise.public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
EPPResponse
into a DOM element tree. The
<response> 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
- Used as a document factoryEPPEncodeException
- Error encoding the DOM element tree.public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException, EPPComponentNotFoundException
EPPResponse
from a DOM element tree. The "response"
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
- <response> root element tree.EPPDecodeException
- Error decoding the DOM element tree.EPPComponentNotFoundException
- An extension component could not be foundpublic boolean equals(java.lang.Object aObject)
EPPResponse
compare.equals
in class java.lang.Object
aObject
- EPPResponse
instance to compare withtrue
if equal; false
otherwisepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
EPPResponse
.clone
in interface EPPCodecComponent
clone
in class java.lang.Object
EPPResponse
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 org.w3c.dom.Element doEncode(org.w3c.dom.Document aDocument) throws EPPEncodeException
EPPResponse
and must
be overridden by EPPResponse
derived classes. The default
implementation is to do nothing, since EPPResponse
is a
concrete class. 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 void doDecode(org.w3c.dom.Element aElement) throws EPPDecodeException
EPPResponse
and must
be overridden by EPPResponse
derived classes. The default
implementation is to do nothing, since EPPResponse
is a
concrete class. 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.