|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.verisign.epp.codec.gen.EPPCodec
public class EPPCodec
Singleton class to encode and decode EPPMessage instances to
and from DOM Documents. EPPCodec encapsulates the details of
the EPP and is capable of handling new EPP Command Mappings through the use
of EPPFactory.
Utility methods are provided for decoding specific concrete
EPPMessages including:
EPPCommand - EPP Command encoded by client and decoded by
server
EPPResponse - EPP Response encoded by server and decoded by
client
EPPGreeting - EPP Greeting encoded by server and decoded by
client
EPPHello - EPP Hello encoded by client and decoded by server
EPPFactory,
EPPMessage,
EPPGreeting,
EPPHello,
EPPCommand,
EPPResponse| Field Summary | |
|---|---|
static java.lang.String |
NS
EPP general XML namespace URI. |
static java.lang.String |
NS_PREFIX
EPP general XML namespace prefix. |
static java.lang.String |
NS_SCHEMA
EPP general XML schema location. |
static java.lang.String |
NS_XSI
XML Schema instance used by the EPP XML Schemas. |
static java.lang.String |
VERSION
version of the EPP. |
| Constructor Summary | |
|---|---|
protected |
EPPCodec()
allocates the Singleton EPPCodec instance. |
| Method Summary | |
|---|---|
EPPMessage |
decode(org.w3c.dom.Document aDocument)
decodes a DOM Document into a concrete EPPMessage. |
EPPMessage |
decode(org.w3c.dom.Element root)
decodes a DOM Element tree into a concrete EPPMessage. |
EPPCommand |
decodeCommand(org.w3c.dom.Document aDocument)
utility method that will decode a DOM Document and return an EPPCommand instance. |
EPPGreeting |
decodeGreeting(org.w3c.dom.Document aDocument)
utility method that will decode a DOM Document and return an EPPGreeting instance. |
EPPHello |
decodeHello(org.w3c.dom.Document aDocument)
utility method that will decode a DOM Document and return an EPPHello instance. |
EPPResponse |
decodeResponse(org.w3c.dom.Document aDocument)
utility method that will decode a DOM Document and return an EPPResponse instance. |
org.w3c.dom.Document |
encode(EPPMessage aMessage)
encodes a concrete EPPMessage into a DOM Document. |
static EPPCodec |
getInstance()
gets the Singleton instance of EPPCodec. |
void |
init(java.util.Vector someFactories)
Initialize the Singleton instance. |
void |
init(java.util.Vector someFactories,
java.util.Vector extensionFactories)
Initialize the Singleton instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VERSION
public static final java.lang.String NS
public static final java.lang.String NS_PREFIX
public static final java.lang.String NS_SCHEMA
public static final java.lang.String NS_XSI
| Constructor Detail |
|---|
protected EPPCodec()
EPPCodec instance. The XML Parser
used to construct the DOM Document is initialized to be namespace
aware and to not validate. JAXP is used to instantiate the
concrete XML Parser, and the XML Parser is only used during an
encode operation.
| Method Detail |
|---|
public static EPPCodec getInstance()
EPPCodec.
EPPCodec follows the Singleton Design Pattern.
EPPCodec.
public void init(java.util.Vector someFactories)
throws EPPCodecException
EPPCodec. Vector of concrete EPPMapFactory fully
qualified class names are specified to initialize the
EPPCodec with the supported EPP Command Mappings. For
example, support for the Domain Command Mapping is added to
EPPCodec by included the class name
"com.verisign.epp.codec.domain.EPPDomainMapFactory" in the
someFactories argument. The following code shows the
steps to include the Domain Command Mapping and the Host Command
Mapping in the EPPCodec.
Vector theFactories = new Vector();
theFactories.addElement("com.verisign.epp.codec.domain.EPPDomainMapFactory");
theFactories.addElement("com.verisign.epp.codec.host.HostMapFactory");
EPPCodec.getInstance().init(theFactories);
someFactories - a Vector of concrete EPPMapFactory
fully qualified class names.
EPPCodecException - DOCUMENT ME!
public void init(java.util.Vector someFactories,
java.util.Vector extensionFactories)
throws EPPCodecException
EPPCodec. AVector of
concrete EPPCommandResponseExtension of fully qualified
class names are specified to initialize the EPPCodec with
the supported Command Response Extensions. For example support for the
Protocol Level Extensiosn and CommanResponse Extensions is added to
EPPCodec by including the class names namely
"com.verisign.epp.codec.gen.EPPProtocolExtensions",
"com.verisign.epp.codec.gen.EPPCommandResponseExtensions" in the
extensionFactories argument.The follwoign code shows the
steps to the ProtcolExtensions and CommandResponse Extensions in the
EPPCodec.
Vector protocolExts = EPPEnv.getProtocolExtensions();
Vector commandExts=EPPEnv.getCmdResponseExtensions();
Vector extensionsVector=new Vector()
extensionsVector.addElement((String)protocolExts.elementAt(i));
extensionsVector.addElement((String)commandExts.elementAt(j));
Now instantiate the Codec instance with both the mapfactories and extension factories
EPPCodec.getInstance().init(EPPEnv.getMapFactories(),extensionsVector);
someFactories - a Vector of concrete EPPMapFactory
fully qualified class names.extensionFactories - a Vector of concrete
EPPProtocolExtension and
EPPCommandResponseExtesnsions
EPPCodecException - DOCUMENT ME!
public org.w3c.dom.Document encode(EPPMessage aMessage)
throws EPPEncodeException
EPPMessage into a DOM Document.
aMessage - Concrete EPPMessage to encode.
EPPMessage
EPPEncodeException - Error encoding the
EPPMessage.
public EPPMessage decode(org.w3c.dom.Document aDocument)
throws EPPDecodeException
EPPMessage.
aDocument - DOM Document to decode into a concrete
EPPMessage.
EPPMessage.
EPPDecodeException - Error decoding the DOM Document.
public EPPMessage decode(org.w3c.dom.Element root)
throws EPPDecodeException,
EPPComponentNotFoundException
EPPMessage.
root - Root EPP element to decode from
EPPMessage.
EPPDecodeException - Error decoding the DOM Document.
EPPComponentNotFoundException - A component could not be found which could be
a command, response, or extension component.
public EPPCommand decodeCommand(org.w3c.dom.Document aDocument)
throws EPPDecodeException
EPPCommand instance. An
EPPDecodeException will be thrown if the decoded
EPPMessage is not an EPPCommand.
aDocument - DOM Document to decode into an EPPCommand.
EPPCommand.
EPPDecodeException - Error decoding the DOM Document or
EPPMessage is not an EPPCommand
public EPPResponse decodeResponse(org.w3c.dom.Document aDocument)
throws EPPDecodeException
EPPResponse instance. An
EPPDecodeException will be thrown if the decoded
EPPMessage is not an EPPResponse.
aDocument - DOM Document to decode into an
EPPResponse.
EPPResponse.
EPPDecodeException - Error decoding the DOM Document or
EPPMessage is not an EPPResponse
public EPPGreeting decodeGreeting(org.w3c.dom.Document aDocument)
throws EPPDecodeException
EPPGreeting instance. An
EPPDecodeException will be thrown if the decoded
EPPMessage is not an EPPGreeting.
aDocument - DOM Document to decode into an
EPPGreeting.
EPPGreeting.
EPPDecodeException - Error decoding the DOM Document or
EPPMessage is not an EPPGreeting
public EPPHello decodeHello(org.w3c.dom.Document aDocument)
throws EPPDecodeException
EPPHello instance. An EPPDecodeException
will be thrown if the decoded EPPMessage is not an
EPPHello.
aDocument - DOM Document to decode into an EPPHello.
EPPHello.
EPPDecodeException - Error decoding the DOM Document or
EPPMessage is not an EPPHello
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||