Package com.verisign.epp.framework
Class EPPByteArrayDispatcher
- java.lang.Object
-
- com.verisign.epp.framework.EPPByteArrayDispatcher
-
public class EPPByteArrayDispatcher extends java.lang.ObjectA 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 EPPByteArrayDispatchergetInstance()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 abytearray.voidregisterHandler(EPPEventHandler aHandler)Registers anEPPEvenHandlerfor notification of Events.voidsetAssembler(EPPByteArrayAssembler aByteArrayAssembler)Sets the ByteArrayAssembler.byte[]toBytes(EPPMessage aMessage)Encodes an EPP message to abytearray.byte[]toBytes(EPPMessage aMessage, java.lang.Object aData)Encodes an EPP message to abytearray.
-
-
-
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, EPPAssemblerExceptionCreates anEPPMessage, sends the message to the appropriateEPPEventHandler, and then returns the response as abytearray.- Parameters:
aInputBytes- The byte array containing the xml inputaData- Any additional data that may be required by the EPPEventHandler- Returns:
bytearray 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.isFatalcan be called to determine if the exception is a fatal exception for the client session.
-
registerHandler
public void registerHandler(EPPEventHandler aHandler)
Registers anEPPEvenHandlerfor notification of Events.- Parameters:
aHandler- TheEPPEventhandlerto register
-
toBytes
public byte[] toBytes(EPPMessage aMessage) throws EPPAssemblerException
Encodes an EPP message to abytearray.- Parameters:
aMessage- EPP Message to send to the client- Returns:
- Encoded
aMessageas 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 abytearray.- Parameters:
aMessage- EPP Message to send to the clientaData- Any additional data that may be required by the handler.- Returns:
- Encoded
aMessageas abyte[]. - Throws:
EPPAssemblerException- Error encoding the EPP message
-
-