Package com.verisign.epp.codec.gen
Class EPPResponse
java.lang.Object
com.verisign.epp.codec.gen.EPPResponse
- All Implemented Interfaces:
EPPCodecComponent,EPPMessage,Serializable,Cloneable
- Direct Known Subclasses:
EPPBalanceInfoResp,EPPBalanceInfoResp,EPPChangeCheckResp,EPPChangeInfoResp,EPPChangeUpdateResp,EPPContactCheckResp,EPPContactCreateResp,EPPContactInfoResp,EPPContactPendActionMsg,EPPContactTransferResp,EPPDefRegCheckResp,EPPDefRegCreateResp,EPPDefRegInfoResp,EPPDefRegRenewResp,EPPDefRegTransferResp,EPPDomainCheckResp,EPPDomainCreateResp,EPPDomainInfoResp,EPPDomainPendActionMsg,EPPDomainRenewResp,EPPDomainTransferResp,EPPEmailFwdCheckResp,EPPEmailFwdCreateResp,EPPEmailFwdInfoResp,EPPEmailFwdPendActionMsg,EPPEmailFwdRenewResp,EPPEmailFwdTransferResp,EPPHostCheckResp,EPPHostCreateResp,EPPHostInfoResp,EPPHostPendActionMsg,EPPIdnTableCheckResp,EPPIdnTableInfoResp,EPPLowBalancePollResponse,EPPMaintenanceInfoResp,EPPNameVerificationCheckResp,EPPNameVerificationCreateResp,EPPNameVerificationInfoResp,EPPNameVerificationPendActionMsg,EPPNameWatchCreateResp,EPPNameWatchInfoResp,EPPNameWatchRenewResp,EPPNameWatchTransferResp,EPPOrgCheckResp,EPPOrgCreateResp,EPPOrgInfoResp,EPPOrgPendActionMsg,EPPRegistryCheckResp,EPPRegistryCheckResp,EPPRegistryCreateResp,EPPRegistryCreateResp,EPPRegistryInfoResp,EPPRegistryInfoResp,EPPRegistryUpdateResp,EPPRgpPollResponse,EPPValidateCheckResp
Represents an EPP response that is send by an EPP Server and received by an
EPP Client. An
EPPResponse can be encoded and decoded by
EPPCodec. Every EPP response contain the following:- transaction id - Mirror of the transaction id set in the associated
EPPCommand - results - One or more
EPPResultinstances.
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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXML tag name for unspecified extension element.static final StringXML tag name response extension data, which is defined byEPPResponsederived classes.static final StringXML tag name for the "qDate" child element to the <msgQ> elementstatic final StringXML root tag name forEPPReponse.static final StringXML tag name response extension data, which is defined byEPPResponsederived classes.protected Vector<EPPCodecComponent> Extension objects associated with the response.static final StringTransfer status constant - clientApprovedstatic final StringTransfer status constant - clientCancelledstatic final StringTransfer status constant - clientRejectedstatic final StringTransfer status constant - pendingstatic final StringTransfer status constant - serverApprovedstatic final StringTransfer status constant - serverCancelled -
Constructor Summary
ConstructorsConstructorDescriptionAllocates a newEPPResponsewith default attribute values.EPPResponse(EPPTransId aTransId) Allocates a newEPPResponsesetting the transaction id.EPPResponse(EPPTransId aTransId, EPPResult aResult) Allocates a newEPPResponsesetting the transaction id and an individual result. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(EPPCodecComponent aExtension) Adds an extension object.clone()CloneEPPResponse.voiddecodeEPPResponsefrom a DOM element tree.protected voidDecodes the attributes of the concreteEPPResponseand must be overridden byEPPResponsederived classes.protected ElementEncodes the attributes of the concreteEPPResponseand must be overridden byEPPResponsederived classes.encodeEPPResponseinto a DOM element tree.booleanimplements a deepEPPResponsecompare.Find the set of duplicate EPP extension XML namespaces based on the list of EPP extensions set in the response.findExtNamespaces(List<String> aFilterExtNamespaces) Find the set of unique EPP extension XML namespaces based on the list of EPP extensions set in the response.findExtNamespaceSuffixes(List<String> aFilterExtNamespaceSuffixes) Find the set of unique EPP extension XML namespace suffixes based on the list of EPP extensions set in the response 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 response.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 extension object with the specified class.getExtension(Class aExtensionClass, boolean aFailOnDuplicate) Gets the response extension object with the specified class with the option to fail when a duplicate extension is found.Gets the extensions.Deprecated.Gets the response message queue object.Convenience method for getting the message queue count attribute.Convenience method for getting the message queue date attribute.Convenience method for getting the message queue message attribute.Gets the EPP namespace associated with theEPPResponse.getQDate()Deprecated.As of EPP 1.0, replaced withgetMsgQueueDate()Gets the first result in the response.Gets the Vector of results associated with theEPPResponse.Gets the Transaction Id associated with theEPPResponse.getType()Gets the EPP response extension type name ornullif there is no extension.booleanhasExtension(Class aExtensionClass) Does the response have an extension object of a specified class? If so, the extension object can be retrieved with a call togetExtensions(Class).booleanDoes the response have an extension objects? If so, the command extension objects can be retrieved with a call togetExtensions.booleanDeprecated.As of EPP 1.0, replaced withhasMsgQueue().booleanDoes the response have a message queue object? If so, the response message queue object can be retrieved with a call togetMsgQueue.booleanhasResultCode(int aCode) Does the response have a result with the specified result code?booleanDoes the response have a success status?isSuccesswill check that there is only oneEPPResultdefined and the result code is set to a value of 10??.voidsetExtension(EPPCodecComponent aExtension) Deprecated.Replaced byaddExtension(EPPCodecComponent).voidsetExtensions(Vector<EPPCodecComponent> aExtensions) Sets the response extension objects.voidsetMsgQueue(EPPMsgQueue aMsgQueue) Sets the response message queue object.voidsetResult(int aCode) Sets an individual result for the response with a result code.voidSets an individual result for the response with a result code and the result text.voidsetResult(int aCode, String aText, Vector<EPPExtValue> aValues) Sets an individual result for the response with a result code, the result text, and a Vector ofStringvalues.voidSets an individual result for the response with anEPPResultinstance.voidsetResults(Vector<EPPResult> aResults) Sets the result(s) of the response as a Vector ofEPPResultinstances.voidsetTransId(EPPTransId aTransId) Sets the Transaction Id associated with theEPPResponse.toString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
Field Details
-
TRANSFER_CLIENT_APPROVED
Transfer status constant - clientApproved- See Also:
-
TRANSFER_CLIENT_CANCELLED
Transfer status constant - clientCancelled- See Also:
-
TRANSFER_CLIENT_REJECTED
Transfer status constant - clientRejected- See Also:
-
TRANSFER_PENDING
Transfer status constant - pending- See Also:
-
TRANSFER_SERVER_APPROVED
Transfer status constant - serverApproved- See Also:
-
TRANSFER_SERVER_CANCELLED
Transfer status constant - serverCancelled- See Also:
-
ELM_NAME
XML root tag name forEPPReponse.- See Also:
-
ELM_MESSAGE_QUEUE
XML tag name response extension data, which is defined byEPPResponsederived classes.- See Also:
-
ELM_RESPONSE_DATA
XML tag name response extension data, which is defined byEPPResponsederived classes.- See Also:
-
ELM_MESSAGE_QUEUE_QDATE
XML tag name for the "qDate" child element to the <msgQ> element- See Also:
-
ELM_EXTENSION
XML tag name for unspecified extension element.- See Also:
-
extensions
Extension objects associated with the response. 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
-
EPPResponse
public EPPResponse()Allocates a newEPPResponsewith default attribute values. The defaults include the following:
- transaction id is set to
null. This attribute must be set usingsetTransIdbefore invokingencode. - extensions is set to
null. This attribute is optional. - message queue is set to
null. This attribute is optional. - results - Set to an individual successful result
- transaction id is set to
-
EPPResponse
Allocates a newEPPResponsesetting the transaction id. The results attribute will default to an individual successful result. Both the extensions and the message queue will be set tonull.- Parameters:
aTransId- Transaction id associated with the response.
-
EPPResponse
Allocates a newEPPResponsesetting the transaction id and an individual result. Both the extensions and the message queue will be set tonull.- Parameters:
aTransId- Transaction id associated with the response.aResult- Result to associate with the response.
-
-
Method Details
-
getType
Gets the EPP response extension type name ornullif there is no extension.- Returns:
- Extension type name if defined;
nullotherwise. For example,getTypewill return EPPDomainCheckResp.ELM_NAME for a EPPDomainCheckResp instance.
-
getTransId
Gets the Transaction Id associated with theEPPResponse. This should include theEPPCommandclient specified transaction id, and a server generated transaction id.- Returns:
- EPPTransId instance if defined;
nullotherwise.
-
setTransId
Sets the Transaction Id associated with theEPPResponse. This should include theEPPCommandclient specified transaction id, and a server generated transaction id.- Parameters:
aTransId- Response transaction id
-
getNamespace
Gets the EPP namespace associated with theEPPResponse. A baseEPPResponseinstance will have the EPP namespace equal toEPPCodec.NS.- Specified by:
getNamespacein interfaceEPPCodecComponent- Specified by:
getNamespacein interfaceEPPMessage- Returns:
- Namespace URI associated with the
EPPResponse.
-
getResults
Gets the Vector of results associated with theEPPResponse.- Returns:
- Vector of
EPPResultinstances.
-
getResult
Gets the first result in the response. UsegetResults()to get all results associated with the response.- Returns:
- The first result if defined;
nullotherwise
-
isSuccess
public boolean isSuccess()Does the response have a success status?isSuccesswill check that there is only oneEPPResultdefined and the result code is set to a value of 10??.- Returns:
trueif is success;falseotherwise.
-
hasResultCode
public boolean hasResultCode(int aCode) Does the response have a result with the specified result code?- Parameters:
aCode- Result code to scan for- Returns:
trueif the result code exists in response;falseotherwise.
-
setResult
public void setResult(int aCode) Sets an individual result for the response with a result code. The EPP Specification defines the range of the result codes to be 1000 - 9999.
setResult(int)will set the results to a Vector of oneEPPResultwith the result code set toaCode.
If the code is set to one of the pre-defined result codes, the result text will be set to the matching en value, as defined in the EPP Specification; otherwise the text is set to the empty string "".- Parameters:
aCode- Result code (1000-9999)
-
setResult
Sets an individual result for the response with a result code and the result text. The EPP Specification defines the range of the result codes to be 1000 - 9999.
setResult(int)will set the results to a Vector of oneEPPResultwith the result code set toaCode, and the result text set toaText. The language of the text will default to "en".- Parameters:
aCode- Result code (1000-9999)aText- Result text in the default "en" language.
-
setResult
Sets an individual result for the response with a result code, the result text, and a Vector ofStringvalues. 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 oneEPPResultwith the result code set toaCode, the result text set toaText, and the values set tosomeValues. The language of the text will default to "en".- Parameters:
aCode- Result code (1000-9999)aText- Result text in the default "en" language.aValues- Vector ofEPPValueorEPPExtValueinstances
-
setResult
Sets an individual result for the response with anEPPResultinstance. This method allows for specification of result attributes like the text language.- Parameters:
aResult- Individual response result.
-
setResults
Sets the result(s) of the response as a Vector ofEPPResultinstances. This method should only be used if there is an error, since only errors can contain more than one result.- Parameters:
aResults- Vector ofEPPResultinstances
-
hasExtension
Does the response have an extension object of a specified class? If so, the extension object can be retrieved with a call togetExtensions(Class).- Parameters:
aExtensionClass- Specific extension class to look for- Returns:
trueif the extension object exists;falseotherwise.
-
getExtension
Gets the 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 Response.- Parameters:
aExtensionClass- of desired extension- Returns:
- Concrete
EPPCodecComponentassociated with the response if exists;nullotherwise.
-
getExtension
public EPPCodecComponent getExtension(Class aExtensionClass, boolean aFailOnDuplicate) throws EPPDuplicateExtensionException Gets the response 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 theEPPResponse.- 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 response 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 Response.- Parameters:
aExtension- response extension object associated with the response
-
addExtension
Adds an 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 Response.- Parameters:
aExtension- extension object associated with the response
-
hasExtensions
public boolean hasExtensions()Does the response have an 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 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 Response.- Returns:
Vectorof concreteEPPCodecComponentassociated with the response if exists;nullotherwise.
-
setExtensions
Sets the response 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 Response.- 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 response.- 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 response.- 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 response.- 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 response 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.
-
hasMessageQueue
Deprecated.As of EPP 1.0, replaced withhasMsgQueue(). This method will returntrueif a message queue object exists that has a non-nullmessage count.Does the response have a message queue object? If so, the response message queue object can be retrieved with a call togetMessageQueue.- Returns:
trueif this is an message queue object;falseotherwise.
-
getMessageQueue
Deprecated.As of EPP 1.0, replaced withgetMsgQueueCount()Gets the response message queue object. Currently the message queue object is aLongcount of the number of messages.- Returns:
- Number of queue messages if defined;
nullotherwise.
-
getQDate
Deprecated.As of EPP 1.0, replaced withgetMsgQueueDate()Get the response message queue date.- Returns:
- message queue date if defined;
nullotherwise.
-
hasMsgQueue
public boolean hasMsgQueue()Does the response have a message queue object? If so, the response message queue object can be retrieved with a call togetMsgQueue.- Returns:
trueif this is an message queue object;falseotherwise.- Since:
- EPP 1.0
-
setMsgQueue
Sets the response message queue object.- Parameters:
aMsgQueue- queue object- Since:
- EPP 1.0
-
getMsgQueue
Gets the response message queue object.- Returns:
- Message queue object if defined;
nullotherwise.
-
getMsgQueueCount
Convenience method for getting the message queue count attribute. This is equivalent to getting the message queue object bygetMsgQueue()and than callingEPPMsgQueue.getCount().- Returns:
- Count of queue messages if defined;
nullotherwise. - Since:
- EPP 1.0
-
getMsgQueueDate
Convenience method for getting the message queue date attribute.- Returns:
- message queue date if defined;
nullotherwise. - Since:
- EPP 1.0
-
getMsgQueueMsg
Convenience method for getting the message queue message attribute.- Returns:
- message queue message if defined;
nullotherwise. - Since:
- EPP 1.0
-
encode
encodeEPPResponseinto 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.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- Used as a document factory- Returns:
- <response> root element tree.
- Throws:
EPPEncodeException- Error encoding the DOM element tree.
-
decode
decodeEPPResponsefrom a DOM element tree. The "response" 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- <response> root element tree.- Throws:
EPPDecodeException- Error decoding the DOM element tree.EPPComponentNotFoundException- An extension component could not be found
-
equals
implements a deepEPPResponsecompare. -
clone
CloneEPPResponse.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPResponse - Throws:
CloneNotSupportedException- standard Object.clone exception
-
toString
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent. -
doEncode
Encodes the attributes of the concreteEPPResponseand must be overridden byEPPResponsederived classes. The default implementation is to do nothing, sinceEPPResponseis a concrete class.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.
-
doDecode
Decodes the attributes of the concreteEPPResponseand must be overridden byEPPResponsederived classes. The default implementation is to do nothing, sinceEPPResponseis a concrete class.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.
-
getMsgQueueCount()