public class EPPDispatcher
extends java.lang.Object
EPPEventHandler
,
EPPEvent
Modifier and Type | Method and Description |
---|---|
static EPPDispatcher |
getInstance()
Gets the one and only instance of the EPPDispatcher
|
void |
processConnection(java.io.InputStream aInputStream,
java.io.OutputStream aOutputStream,
java.lang.Object aData)
Returns the
EPPEventResponse that new connecting clients
should receive. |
void |
processMessage(java.io.InputStream aInputStream,
java.io.OutputStream aOutputStream,
java.lang.Object aData)
Creates an
EPPMessage , sends the message to the appropriate
EPPEventHandler , and then sends the response on the
OutputStream. |
void |
registerConnectionHandler(EPPConnectionHandler aConnectionHandler)
Registers a
EPPConnectionHandler for notification of
connection events |
void |
registerHandler(EPPEventHandler aHandler)
Registers an
EPPEvenHandler for notification of Events. |
void |
send(EPPMessage aMessage,
java.io.OutputStream aOutputStream)
Sends an EPP message to the client.
|
void |
send(EPPMessage aMessage,
java.io.OutputStream aOutputStream,
java.lang.Object aData)
Sends an EPP message to the client.
|
void |
setAssembler(EPPAssembler aAssembler)
Sets the Assembler.
|
public static EPPDispatcher getInstance()
public void processConnection(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream, java.lang.Object aData)
EPPEventResponse
that new connecting clients
should receive. In this case the EPPGreeting.aInputStream
- The InputStream of the new connection.aOutputStream
- The OutputStream to send the response on.aData
- Any extra data that the connection handler may need.public void setAssembler(EPPAssembler aAssembler)
aAssembler
- The type of Assembler to use.public void processMessage(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream, java.lang.Object aData) throws EPPEventException, EPPAssemblerException
EPPMessage
, sends the message to the appropriate
EPPEventHandler
, and then sends the response on the
OutputStream.aInputStream
- The InputStream used to create the EPPMessageaOutputStream
- The OutputStream to send the EPPResponse onaData
- Any additional data that may be required by the
EPPEventHandlerEPPEventException
- 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.public void registerHandler(EPPEventHandler aHandler)
EPPEvenHandler
for notification of Events.aHandler
- The EPPEventhandler
to registerpublic void registerConnectionHandler(EPPConnectionHandler aConnectionHandler)
EPPConnectionHandler
for notification of
connection eventsaConnectionHandler
- The connection handler to registierpublic void send(EPPMessage aMessage, java.io.OutputStream aOutputStream) throws EPPAssemblerException
aMessage
- EPP Message to send to the clientaOutputStream
- Output stream to write the EPP MessageEPPAssemblerException
- Error writing message to output streampublic void send(EPPMessage aMessage, java.io.OutputStream aOutputStream, java.lang.Object aData) throws EPPAssemblerException
aMessage
- EPP Message to send to the clientaOutputStream
- Output stream to write the EPP MessageaData
- whatever data should be passed to the AssemblerEPPAssemblerException
- Error writing message to output stream