Package jade.imtp.leap.JICP
Interface JICPMediator
-
- All Known Subinterfaces:
NIOMediator
- All Known Implementing Classes:
BackEndDispatcher,BIBEDispatcher,HTTPBEDispatcher,NIOBEDispatcher,NIOHTTPBEDispatcher,SMSBEDispatcher
public interface JICPMediator- Author:
- Giovanni Caire - Telecom Italia LAB S.p.A.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetID()Retrieve the ID of this mediatorbooleanhandleIncomingConnection(Connection c, JICPPacket pkt, InetAddress addr, int port)Passes to this JICPMediator the connection opened by the mediated entity.JICPPackethandleJICPPacket(JICPPacket p, InetAddress addr, int port)Passes to this JICPMediator a JICP packet.voidinit(JICPMediatorManager mgr, String id, Properties props)Initialize this JICPMediatorvoidkill()Kill this JICPMediatorvoidtick(long time)This is periodically called by the JICPMediatorManager and should be used by a JICPMediator to evaluate the elapsed time without the need of a dedicated thread or timer.
-
-
-
Method Detail
-
getID
String getID()
Retrieve the ID of this mediator
-
init
void init(JICPMediatorManager mgr, String id, Properties props) throws ICPException
Initialize this JICPMediator- Throws:
ICPException
-
kill
void kill()
Kill this JICPMediator
-
handleIncomingConnection
boolean handleIncomingConnection(Connection c, JICPPacket pkt, InetAddress addr, int port)
Passes to this JICPMediator the connection opened by the mediated entity. This is called by the JICPServer this Mediator is attached to as soon as the mediated entity (re)connects.- Parameters:
c- the connection to the mediated entitypkt- the packet that was sent by the mediated entity when opening this connectionaddr- the address of the mediated entityport- the local port used by the mediated entity- Returns:
- an indication to the JICPMediatorManager to keep the connection open.
-
handleJICPPacket
JICPPacket handleJICPPacket(JICPPacket p, InetAddress addr, int port) throws ICPException
Passes to this JICPMediator a JICP packet. This is called by the JICPServer this Mediator is attached to when a JICPPacket is received having the recipient-ID field set to the ID of this JICPMediator.- Parameters:
p- the JICPPacketaddr- the address of the mediated entityport- the local port used by the mediated entity- Throws:
ICPException
-
tick
void tick(long time)
This is periodically called by the JICPMediatorManager and should be used by a JICPMediator to evaluate the elapsed time without the need of a dedicated thread or timer.
-
-