Package com.verisign.epp.framework
Class EPPByteArrayDispatcher
- java.lang.Object
-
- com.verisign.epp.framework.EPPByteArrayDispatcher
-
public class EPPByteArrayDispatcher extends java.lang.Object
A Singleton class that delegates message assembly to an EPPAssembler then routes messages to the appropriate EPPEventHandler.
- See Also:
EPPEventHandler
,EPPEvent
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EPPByteArrayDispatcher
getInstance()
Gets the one and only instance of the EPPByteArrayDispatcherbyte[]
processMessage(byte[] aInputBytes, java.lang.Object aData)
Creates anEPPMessage
, sends the message to the appropriateEPPEventHandler
, and then returns the response as abyte
array.void
registerHandler(EPPEventHandler aHandler)
Registers anEPPEvenHandler
for notification of Events.void
setAssembler(EPPByteArrayAssembler aByteArrayAssembler)
Sets the ByteArrayAssembler.byte[]
toBytes(EPPMessage aMessage)
Encodes an EPP message to abyte
array.byte[]
toBytes(EPPMessage aMessage, java.lang.Object aData)
Encodes an EPP message to abyte
array.
-
-
-
Method Detail
-
getInstance
public static EPPByteArrayDispatcher getInstance()
Gets the one and only instance of the EPPByteArrayDispatcher- Returns:
- Dispatcher The dispatcher
-
setAssembler
public void setAssembler(EPPByteArrayAssembler aByteArrayAssembler)
Sets the ByteArrayAssembler.- Parameters:
aByteArrayAssembler
- The ByteArrayAssembler to use.
-
processMessage
public byte[] processMessage(byte[] aInputBytes, java.lang.Object aData) throws EPPEventException, EPPAssemblerException
Creates anEPPMessage
, sends the message to the appropriateEPPEventHandler
, and then returns the response as abyte
array.- Parameters:
aInputBytes
- The byte array containing the xml inputaData
- Any additional data that may be required by the EPPEventHandler- Returns:
byte
array containing the response to the message.- Throws:
EPPEventException
- Exception related to the handling of an eventEPPAssemblerException
- Exception related to the assembling/de-assembling of messages.EPPAssemberException.isFatal
can be called to determine if the exception is a fatal exception for the client session.
-
registerHandler
public void registerHandler(EPPEventHandler aHandler)
Registers anEPPEvenHandler
for notification of Events.- Parameters:
aHandler
- TheEPPEventhandler
to register
-
toBytes
public byte[] toBytes(EPPMessage aMessage) throws EPPAssemblerException
Encodes an EPP message to abyte
array.- Parameters:
aMessage
- EPP Message to send to the client- Returns:
- Encoded
aMessage
as abyte[]
. - Throws:
EPPAssemblerException
- Error encoding the EPP message
-
toBytes
public byte[] toBytes(EPPMessage aMessage, java.lang.Object aData) throws EPPAssemblerException
Encodes an EPP message to abyte
array.- Parameters:
aMessage
- EPP Message to send to the clientaData
- Any additional data that may be required by the handler.- Returns:
- Encoded
aMessage
as abyte[]
. - Throws:
EPPAssemblerException
- Error encoding the EPP message
-
-