public class EPPXMLByteArray
extends java.lang.Object
EPPXMLByteArray
is a utility class for reading and writing EPP
messages to/from byte arrays. DOM Document is converted to and from byte
arrays. An XML parser is required when reading from the stream. There is one
constructor that will create an XML parser per call to
read(InputStream)
and one that will use a parser pool. Use of a
parser pool is recommended.Constructor and Description |
---|
EPPXMLByteArray()
Default constructor for
EPPXMLByteArray . |
EPPXMLByteArray(java.lang.String aParserPoolName)
Construct
EPPXMLByteArray to use a parser pool and a default
transformer pool. |
EPPXMLByteArray(java.lang.String aParserPoolName,
java.lang.String aTransformerPoolName)
Construct
EPPXMLByteArray to use a parser pool and a
transformer pool. |
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Document |
decode(byte[] aPacket)
Decodes(parses) and validates the
aPacket parameter and
returns the associated DOM Document. |
byte[] |
encode(org.w3c.dom.Document aDoc)
Encodes(converts) a DOM Document to a
byte array. |
public EPPXMLByteArray()
EPPXMLByteArray
. When using this
constructor, a parser instance will be created on each call to
decode(byte[])
and a transformer instance will be created on
each call to encode()
. .public EPPXMLByteArray(java.lang.String aParserPoolName)
EPPXMLByteArray
to use a parser pool and a default
transformer pool. The aParserPoolName
parameter has to be a
pool of EPPParserPool
subclasses. When using this
constructor, a parser instance will be checked out and checkin as needed
on each call to decode(byte[])
. The Transformer
pool used is defined by the EPPTransformer.POOL
constant.aParserPoolName
- Pool name to usepublic EPPXMLByteArray(java.lang.String aParserPoolName, java.lang.String aTransformerPoolName)
EPPXMLByteArray
to use a parser pool and a
transformer pool. The aParserPoolName
parameter has to be a
pool of EPPParserPool
subclasses. When using this
constructor, a parser instance will be checked out and checkin as needed
on each call to decode(byte[])
. The Transformer
pool used is defined by the EPPTransformer.POOL
constant. The
aTransformerPoolName
parameters is the name of pool
containing Transformer
instances.aParserPoolName
- Parser pool name to useaTransformerPoolName
- Transformer pool name to usepublic org.w3c.dom.Document decode(byte[] aPacket) throws EPPAssemblerException, EPPException, java.io.IOException
aPacket
parameter and
returns the associated DOM Document. The XML parser is either created per
call, or is retrieved from a parser pool when
EPPXMLByteArray(GenericPoolManager)
is used. Use of a parser
pool is recommended.aPacket
- The byte array containing the EPP packet.EPPException
- Error with received packet or end of stream. It is
recommended that the stream be closed.EPPAssemblerException
- Error parsing packetjava.io.IOException
- Error reading packet from streampublic byte[] encode(org.w3c.dom.Document aDoc) throws EPPException
byte
array. The DOM
Document will be serialized to XML and converted into a byte
array.aDoc
- DOM Document to convert to byte
array.EPPException
- Error writing to stream. It is recommended that the stream
be closed.Copyright © VeriSign Inc. All Rights Reserved.