Package nl.tue.id.oocsi
Class OOCSICommunicator
java.lang.Object
nl.tue.id.oocsi.client.OOCSIClient
nl.tue.id.oocsi.OOCSICommunicator
public class OOCSICommunicator extends OOCSIClient
communication interface for OOCSI client
- Author:
- matsfunk
-
Field Summary
-
Constructor Summary
Constructors Constructor Description OOCSICommunicator(java.lang.Object parent, java.lang.String name)
constructor -
Method Summary
Modifier and Type Method Description OOCSICall
call(java.lang.String callName)
create a call for service method "callName"OOCSICall
call(java.lang.String callName, int timeoutMS)
create a call for service method "callName" with a specific timeoutOOCSICall
call(java.lang.String callName, int timeoutMS, int maxResponses)
create a call for service method "callName" with a specific timeoutOOCSICall
call(java.lang.String channelName, java.lang.String callName)
create a call for service method "callName" on channel "channelName"OOCSICall
call(java.lang.String channelName, java.lang.String callName, int timeoutMS)
create a call for service method "callName" with a specific timeout on channel "channelName"OOCSICall
call(java.lang.String channelName, java.lang.String callName, int timeoutMS, int maxResponses)
create a call for service method "callName" with a specific timeout on channel "channelName"OOCSIMessage
channel(java.lang.String channelName)
send data through a channel given by the channelNameboolean
connect()
connect to OOCSI network without a concrete server given, i.e., wait for multi-cast messages broadcasting a server to connect toboolean
connect(java.lang.String hostname, int port)
connect to OOCSI networkHandler
createSimpleCallerHandler(java.lang.String handlerName)
create a simple handler that calls the method with the given handlerName in the parent object (without parameters)boolean
register(java.lang.String responderName)
subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"boolean
register(java.lang.String responderName, java.lang.String handlerName)
register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an eventboolean
registerChannel(java.lang.String channelName, java.lang.String responderName)
subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"boolean
registerChannel(java.lang.String channelName, java.lang.String responderName, java.lang.String handlerName)
register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an eventboolean
subscribe(java.lang.String channelName)
subscribe to channel "channelName" for handler method "channelName" in the parent class; the handler method will be called with an OOCSIEvent object upon occurrence of an event; will try 'handleOOCSIEvent' as a fall-back in case no matching handler method is found for "channelName"boolean
subscribe(java.lang.String channelName, java.lang.String handlerName)
subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an eventboolean
subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds)
subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an eventboolean
subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds, boolean ratePerSender)
subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an eventMethods inherited from class nl.tue.id.oocsi.client.OOCSIClient
channels, channels, clients, disconnect, getName, heyOOCSI, heyOOCSI, isConnected, isReconnect, kill, log, reconnect, register, register, register, send, send, setReconnect, subscribe, subscribe, unregister, unregister, unsubscribe
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
OOCSICommunicator
public OOCSICommunicator(java.lang.Object parent, java.lang.String name)constructor- Parameters:
parent
-name
-
-
-
Method Details
-
connect
public boolean connect()Description copied from class:OOCSIClient
connect to OOCSI network without a concrete server given, i.e., wait for multi-cast messages broadcasting a server to connect to- Overrides:
connect
in classOOCSIClient
- Returns:
-
connect
public boolean connect(java.lang.String hostname, int port)Description copied from class:OOCSIClient
connect to OOCSI network- Overrides:
connect
in classOOCSIClient
- Returns:
-
channel
send data through a channel given by the channelName- Parameters:
channelName
-- Returns:
-
call
create a call for service method "callName"- Parameters:
callName
-- Returns:
-
call
create a call for service method "callName" on channel "channelName"- Parameters:
channelName
-callName
-- Returns:
-
call
create a call for service method "callName" with a specific timeout- Parameters:
callName
-timeoutMS
-- Returns:
-
call
create a call for service method "callName" with a specific timeout on channel "channelName"- Parameters:
channelName
-callName
-timeoutMS
-- Returns:
-
call
create a call for service method "callName" with a specific timeout- Parameters:
callName
-timeoutMS
-maxResponses
-- Returns:
-
call
public OOCSICall call(java.lang.String channelName, java.lang.String callName, int timeoutMS, int maxResponses)create a call for service method "callName" with a specific timeout on channel "channelName"- Parameters:
channelName
-callName
-timeoutMS
-maxResponses
-- Returns:
-
subscribe
public boolean subscribe(java.lang.String channelName)subscribe to channel "channelName" for handler method "channelName" in the parent class; the handler method will be called with an OOCSIEvent object upon occurrence of an event; will try 'handleOOCSIEvent' as a fall-back in case no matching handler method is found for "channelName"- Parameters:
channelName
-- Returns:
-
subscribe
public boolean subscribe(java.lang.String channelName, java.lang.String handlerName)subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event- Parameters:
channelName
-handlerName
-- Returns:
-
subscribe
public boolean subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds)subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event- Parameters:
channelName
-handlerName
-rate
-seconds
-- Returns:
-
subscribe
public boolean subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds, boolean ratePerSender)subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event- Parameters:
channelName
-handlerName
-rate
-seconds
-ratePerSender
-- Returns:
-
createSimpleCallerHandler
create a simple handler that calls the method with the given handlerName in the parent object (without parameters)- Parameters:
handlerName
-- Returns:
-
register
public boolean register(java.lang.String responderName)subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"- Parameters:
responderName
-- Returns:
-
register
public boolean register(java.lang.String responderName, java.lang.String handlerName)register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event- Parameters:
responderName
-handlerName
-- Returns:
-
registerChannel
public boolean registerChannel(java.lang.String channelName, java.lang.String responderName)subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"- Parameters:
channelName
-responderName
-- Returns:
-
registerChannel
public boolean registerChannel(java.lang.String channelName, java.lang.String responderName, java.lang.String handlerName)register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event- Parameters:
channelName
-responderName
-handlerName
-- Returns:
-