Package com.verisign.epp.framework
Class EPPDispatcher
- java.lang.Object
-
- com.verisign.epp.framework.EPPDispatcher
-
public class EPPDispatcher 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 EPPDispatcher
getInstance()
Gets the one and only instance of the EPPDispatchervoid
processConnection(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream, java.lang.Object aData)
Returns theEPPEventResponse
that new connecting clients should receive.void
processMessage(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream, java.lang.Object aData)
Creates anEPPMessage
, sends the message to the appropriateEPPEventHandler
, and then sends the response on the OutputStream.void
registerConnectionHandler(EPPConnectionHandler aConnectionHandler)
Registers aEPPConnectionHandler
for notification of connection eventsvoid
registerHandler(EPPEventHandler aHandler)
Registers anEPPEvenHandler
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.
-
-
-
Method Detail
-
getInstance
public static EPPDispatcher getInstance()
Gets the one and only instance of the EPPDispatcher- Returns:
- Dispatcher The dispatcher
-
processConnection
public void processConnection(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream, java.lang.Object aData)
Returns theEPPEventResponse
that new connecting clients should receive. In this case the EPPGreeting.- Parameters:
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.
-
setAssembler
public void setAssembler(EPPAssembler aAssembler)
Sets the Assembler. The format of the Input/Output streams determines the type of Assembler that should be used.- Parameters:
aAssembler
- The type of Assembler to use.
-
processMessage
public void processMessage(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream, java.lang.Object aData) throws EPPEventException, EPPAssemblerException
Creates anEPPMessage
, sends the message to the appropriateEPPEventHandler
, and then sends the response on the OutputStream.- Parameters:
aInputStream
- The InputStream used to create the EPPMessageaOutputStream
- The OutputStream to send the EPPResponse onaData
- Any additional data that may be required by the EPPEventHandler- 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
-
registerConnectionHandler
public void registerConnectionHandler(EPPConnectionHandler aConnectionHandler)
Registers aEPPConnectionHandler
for notification of connection events- Parameters:
aConnectionHandler
- The connection handler to registier
-
send
public void send(EPPMessage aMessage, java.io.OutputStream aOutputStream) throws EPPAssemblerException
Sends an EPP message to the client.- Parameters:
aMessage
- EPP Message to send to the clientaOutputStream
- Output stream to write the EPP Message- Throws:
EPPAssemblerException
- Error writing message to output stream
-
send
public void send(EPPMessage aMessage, java.io.OutputStream aOutputStream, java.lang.Object aData) throws EPPAssemblerException
Sends an EPP message to the client.- Parameters:
aMessage
- EPP Message to send to the clientaOutputStream
- Output stream to write the EPP MessageaData
- whatever data should be passed to the Assembler- Throws:
EPPAssemblerException
- Error writing message to output stream
-
-