diff --git a/dist/oocsi.zip b/dist/oocsi.zip index ca202b3..b9d6713 100644 Binary files a/dist/oocsi.zip and b/dist/oocsi.zip differ diff --git a/dist/oocsi/examples/Connectivity/SendResponseChannel/SendResponseChannel.pde b/dist/oocsi/examples/Connectivity/SendResponseChannel/SendResponseChannel.pde new file mode 100644 index 0000000..4f5502d --- /dev/null +++ b/dist/oocsi/examples/Connectivity/SendResponseChannel/SendResponseChannel.pde @@ -0,0 +1,93 @@ +import nl.tue.id.oocsi.*; +import nl.tue.id.oocsi.client.services.*; + +// ****************************************************** +// This example requires a running OOCSI server! +// +// How to do that? Check: Examples > Tools > LocalServer +// +// More information how to run an OOCSI server +// can be found here: https://iddi.github.io/oocsi/) +// ****************************************************** + +// variables for fill color and size of rectangle +int fillColor = 255; +int size = 3; + +OOCSI oocsi1; + +// second OOCSI instance for making calls to the registered handlers +OOCSI oocsi2; + +void setup() { + size(200, 200); + noStroke(); + rectMode(CENTER); + + // connect to OOCSI server running on the same machine (localhost) + // with "receiverName" to be my channel others can send data to + // (for more information how to run an OOCSI server refer to: https://iddi.github.io/oocsi/) + oocsi1 = new OOCSI(this, "channel_responder", "localhost"); + + // register this first OOCSI client for responses + // to call "numberNumer" + oocsi1.registerChannel("colorChannel", "newNumber"); + // and "newColor" + oocsi1.registerChannel("colorChannel", "newColor"); + + // register can take also the name of the function as an optional second parameter: + // oocsi1.register("newColor", "generateColor"); + + // --------------------------------------------------------------------------------- + + // connect with a second OOCSI client for calling the first one + oocsi2 = new OOCSI(this, "caller", "localhost"); +} + +// responder for calls to "newNumber", will receive the call message and then put the response data into +// the response OOCSIData object, which is same as for OOCSI events and messages +void newNumber(OOCSIEvent event, OOCSIData response) { + response.data("number", frameCount % 20); +} + +// responder for calls to "newColor", will receive the call message and then put the response data into +// the response OOCSIData object, which is same as for OOCSI events and messages +void newColor(OOCSIEvent event, OOCSIData response) { + int col = event.getInt("color", 0); + response.data("color", (fillColor + col) % 255); +} + +void draw() { + background(0); + + // draw a rect with the given size and fill color + fill(fillColor, 120, 120); + rect(width/2., height/2., 5 * size, 5 * size); +} + +void mousePressed() { + + // on mouse press call two different services and get new data... + + // first one for getting a new size + // 1: create call + OOCSICall call1 = oocsi2.call("colorChannel", "newNumber", 200); + // 2: send out and wait until either there is a response or the timeout has passed + call1.sendAndWait(); + // 3: check for response + if (call1.hasResponse()) { + // 4: get data out of the first response + size = call1.getFirstResponse().getInt("number", 0); + } + + // second one for getting a new color + // 1: create call with parameter "color", similar to normal OOCSI events + OOCSICall call2 = oocsi2.call("colorChannel", "newColor", 200).data("color", frameCount); + // 2: send out and wait until either there is a response or the timeout has passed + call2.sendAndWait(); + // 3: check for response + if (call2.hasResponse()) { + // 4: get data out of the first response + fillColor = call2.getFirstResponse().getInt("color", 0); + } +} \ No newline at end of file diff --git a/dist/oocsi/library.properties b/dist/oocsi/library.properties index 18c2125..f4112a8 100644 --- a/dist/oocsi/library.properties +++ b/dist/oocsi/library.properties @@ -40,11 +40,11 @@ paragraph = This library provides easy ways to connect a Processing sketch to a # compare different versions of the same library, and check if an update is # available. You should think of it as a counter, counting the total number of # releases you've had. -version = 136 +version = 137 # The version as the user will see it. If blank, the version attribute will be # used here. This should be a single word, with no spaces. -prettyVersion = 1.3.6 +prettyVersion = 1.3.7 # The min and max revision of Processing compatible with your library. # Note that these fields use the revision and not the version of Processing, diff --git a/dist/oocsi/library/oocsi.jar b/dist/oocsi/library/oocsi.jar index f1b8b29..0a1fd24 100644 Binary files a/dist/oocsi/library/oocsi.jar and b/dist/oocsi/library/oocsi.jar differ diff --git a/dist/oocsi/reference/allclasses-frame.html b/dist/oocsi/reference/allclasses-frame.html index 865aa35..07eb08b 100644 --- a/dist/oocsi/reference/allclasses-frame.html +++ b/dist/oocsi/reference/allclasses-frame.html @@ -2,9 +2,9 @@ - + All Classes - + diff --git a/dist/oocsi/reference/allclasses-noframe.html b/dist/oocsi/reference/allclasses-noframe.html index 0e4e144..9186004 100644 --- a/dist/oocsi/reference/allclasses-noframe.html +++ b/dist/oocsi/reference/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes - + diff --git a/dist/oocsi/reference/constant-values.html b/dist/oocsi/reference/constant-values.html index b13f230..f46ec8f 100644 --- a/dist/oocsi/reference/constant-values.html +++ b/dist/oocsi/reference/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values - + @@ -122,7 +122,7 @@

nl.tue.*

public static final java.lang.String VERSION -"1.3.6" +"1.3.7" diff --git a/dist/oocsi/reference/deprecated-list.html b/dist/oocsi/reference/deprecated-list.html index 6301763..4be6d03 100644 --- a/dist/oocsi/reference/deprecated-list.html +++ b/dist/oocsi/reference/deprecated-list.html @@ -2,9 +2,9 @@ - + Deprecated List - + diff --git a/dist/oocsi/reference/help-doc.html b/dist/oocsi/reference/help-doc.html index 88a71fb..02104a7 100644 --- a/dist/oocsi/reference/help-doc.html +++ b/dist/oocsi/reference/help-doc.html @@ -2,9 +2,9 @@ - + API Help - + diff --git a/dist/oocsi/reference/index-all.html b/dist/oocsi/reference/index-all.html index 442ea86..01699ad 100644 --- a/dist/oocsi/reference/index-all.html +++ b/dist/oocsi/reference/index-all.html @@ -2,9 +2,9 @@ - + Index - + @@ -128,27 +128,51 @@

C

call(String) - Method in class nl.tue.id.oocsi.OOCSI
-
create a call for service method
+
create a call for service method "callName"
+
+
call(String, String) - Method in class nl.tue.id.oocsi.OOCSI
+
+
create a call for service method "callName" on channel "channelName"
call(String, int) - Method in class nl.tue.id.oocsi.OOCSI
-
create a call for service method
+
create a call for service method "callName" with a specific timeout
+
+
call(String, String, int) - Method in class nl.tue.id.oocsi.OOCSI
+
+
create a call for service method "callName" with a specific timeout on channel "channelName"
call(String, int, int) - Method in class nl.tue.id.oocsi.OOCSI
-
create a call for service method
+
create a call for service method "callName" with a specific timeout
+
+
call(String, String, int, int) - Method in class nl.tue.id.oocsi.OOCSI
+
+
create a call for service method "callName" with a specific timeout on channel "channelName"
call(String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
create a call for service method
+
create a call for service method "callName"
+
+
call(String, String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
+
+
create a call for service method "callName" on channel "channelName"
call(String, int) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
create a call for service method
+
create a call for service method "callName" with a specific timeout
+
+
call(String, String, int) - Method in class nl.tue.id.oocsi.OOCSICommunicator
+
+
create a call for service method "callName" with a specific timeout on channel "channelName"
call(String, int, int) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
create a call for service method
+
create a call for service method "callName" with a specific timeout
+
+
call(String, String, int, int) - Method in class nl.tue.id.oocsi.OOCSICommunicator
+
+
create a call for service method "callName" with a specific timeout on channel "channelName"
canSend() - Method in class nl.tue.id.oocsi.client.services.OOCSICall
@@ -516,6 +540,10 @@

D

disconnect from OOCSI
+
disconnect() - Method in class nl.tue.id.oocsi.OOCSI
+
+
disconnect this client from the OOCSI network
+
disconnect(OOCSIVariable<Double>) - Method in class nl.tue.id.oocsi.OOCSIDouble
 
disconnect(OOCSIVariable<Float>) - Method in class nl.tue.id.oocsi.OOCSIFloat
@@ -989,35 +1017,35 @@

L

 
limit(int, int) - Method in class nl.tue.id.oocsi.client.data.OOCSIVariable
-
set the limiting of incoming events in terms of and timeframe; supports chained invocation
+
set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
limit(int, int) - Method in class nl.tue.id.oocsi.client.protocol.RateLimitedEventHandler
-
reconfigure the rate limitation to different and timeframe
+
reconfigure the rate limitation to different "rate" and "seconds" timeframe
limit(int, int) - Method in class nl.tue.id.oocsi.OOCSIBoolean
-
set the limiting of incoming events in terms of and timeframe; supports chained invocation
+
set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
limit(int, int) - Method in class nl.tue.id.oocsi.OOCSIDouble
-
set the limiting of incoming events in terms of and timeframe; supports chained invocation
+
set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
limit(int, int) - Method in class nl.tue.id.oocsi.OOCSIFloat
-
set the limiting of incoming events in terms of and timeframe; supports chained invocation
+
set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
limit(int, int) - Method in class nl.tue.id.oocsi.OOCSIInt
-
set the limiting of incoming events in terms of and timeframe; supports chained invocation
+
set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
limit(int, int) - Method in class nl.tue.id.oocsi.OOCSILong
-
set the limiting of incoming events in terms of and timeframe; supports chained invocation
+
set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
limit(int, int) - Method in class nl.tue.id.oocsi.OOCSIString
-
set the limiting of incoming events in terms of and timeframe; supports chained invocation
+
set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
loadSequence(String) - Method in class nl.tue.id.oocsi.EventRecorder
@@ -1237,11 +1265,11 @@

O

OOCSICall(OOCSIClient, String, int, int) - Constructor for class nl.tue.id.oocsi.client.services.OOCSICall
-
create a new message to the channel
+
create a new message to the channel "channelName"
OOCSICall(OOCSIClient, String, String, int, int) - Constructor for class nl.tue.id.oocsi.client.services.OOCSICall
-
create a new message to the channel
+
create a new message to the channel "channelName"
OOCSIClient - Class in nl.tue.id.oocsi.client
@@ -1520,11 +1548,11 @@

P

parseData(String) - Static method in class nl.tue.id.oocsi.client.protocol.Handler
-
parse the given String into a Map
+
parse the given "data" String into a Map
parseTimestamp(String) - Static method in class nl.tue.id.oocsi.client.protocol.Handler
-
parse the given String into a long value
+
parse the given "timestamp" String into a long value
pause() - Method in class nl.tue.id.oocsi.EventRecorder
@@ -1550,21 +1578,21 @@

R

 
RateLimitedClientEventHandler - Class in nl.tue.id.oocsi.client.protocol
-
rate limited event handler for events with structured data that will only let through events per +
rate limited event handler for events with structured data that will only let through "rate" events per "second" secs; this counts for all incoming events per sender which protects against single senders overloading the system
RateLimitedClientEventHandler(int, int) - Constructor for class nl.tue.id.oocsi.client.protocol.RateLimitedClientEventHandler
-
creates a rate limited event handler that will at most let through event per secs
+
creates a rate limited event handler that will at most let through "rate" event per "second" secs
RateLimitedEventHandler - Class in nl.tue.id.oocsi.client.protocol
-
rate limited event handler for events with structured data that will only let through events per +
rate limited event handler for events with structured data that will only let through "rate" events per "second" secs; this counts for all incoming events
RateLimitedEventHandler(int, int) - Constructor for class nl.tue.id.oocsi.client.protocol.RateLimitedEventHandler
-
creates a rate limited event handler that will at most let through event per secs
+
creates a rate limited event handler that will at most let through "rate" event per "second" secs
receive(String, Map<String, Object>, long, String, String) - Method in class nl.tue.id.oocsi.client.protocol.DataHandler
 
@@ -1637,7 +1665,11 @@

R

register(String, Responder) - Method in class nl.tue.id.oocsi.client.OOCSIClient
-
register a responder with the socket client with a given handle
+
register a responder with the socket client with a given handle "callName"
+
+
register(String, String, Responder) - Method in class nl.tue.id.oocsi.client.OOCSIClient
+
+
register a responder with the socket client with a given handle "callName" on channel "channelName"
register(OOCSICall) - Method in class nl.tue.id.oocsi.client.socket.SocketClient
@@ -1645,7 +1677,7 @@

R

register(String, Responder) - Method in class nl.tue.id.oocsi.client.socket.SocketClient
-
register a responder with a handle
+
register a responder with a handle "callName"
register(String) - Method in class nl.tue.id.oocsi.OOCSI
@@ -1653,17 +1685,39 @@

R

register(String, String) - Method in class nl.tue.id.oocsi.OOCSI
-
register a responder; requires a method with the given responderName with parameters (OOCSIEvent, OOCSIData)
+
register a responder "responderName"; requires a method with the given name "responderName" with parameters + (OOCSIEvent, OOCSIData)
register(String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
subscribe to channel for handler method in the parent class; the handler method +
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
+ 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"
register(String, String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
register a handler method in the parent class with the given name for the channel ; +
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
+
+
registerChannel(String, String) - Method in class nl.tue.id.oocsi.OOCSI
+
+
register a responder "responderName" on channel "channelName"; requires a method with the responder name + "responderName" with parameters (OOCSIEvent, OOCSIData)
+
+
registerChannel(String, String, String) - Method in class nl.tue.id.oocsi.OOCSI
+
+
register a responder "responderName" on channel "channelName"; requires a method with the given name + "responderName" with parameters (OOCSIEvent, OOCSIData)
+
+
registerChannel(String, String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
+
+
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"
+
+
registerChannel(String, String, String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
+
+
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
registerResponder(OOCSIClient, Responder) - Method in class nl.tue.id.oocsi.client.services.Service.ServiceMethod
@@ -1932,7 +1986,9 @@

S

start the synchronization process
startMulticastLookup() - Method in class nl.tue.id.oocsi.client.socket.SocketClient
-
 
+
+
start pinging for a multi-cast lookup
+
startRecording() - Method in class nl.tue.id.oocsi.EventRecorder
activate recording to a new sequence with a new single track; subsequent calls to recordEvent will record an @@ -1995,38 +2051,38 @@

S

subscribe(String, String) - Method in class nl.tue.id.oocsi.OOCSI
-
subscribe to a channel with a given handler method name
+
subscribe to a channel with a given handler method name "handlerName"
subscribe(String, String, int, int) - Method in class nl.tue.id.oocsi.OOCSI
-
subscribe to a channel with a given handler method name ; limits the rate of incoming events to - events per secs
+
subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + "rate" events per "seconds" secs
subscribe(String, String, int, int, boolean) - Method in class nl.tue.id.oocsi.OOCSI
-
subscribe to a channel with a given handler method name ; limits the rate of incoming events to - events per secs; controls whether we limit the rate of incoming event per sender +
subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + "rate" events per "seconds" secs; "ratePerSender" controls whether we limit the rate of incoming event per sender or for all events coming in from all senders
subscribe(String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
subscribe to channel for handler method in the parent class; the handler method will +
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
+ case no matching handler method is found for "channelName"
subscribe(String, String) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
subscribe to channel for handler method in the parent class with the given name ; the +
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
subscribe(String, String, int, int) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
subscribe to channel for handler method in the parent class with the given name ; the +
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
subscribe(String, String, int, int, boolean) - Method in class nl.tue.id.oocsi.OOCSICommunicator
-
subscribe to channel for handler method in the parent class with the given name ; the +
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
diff --git a/dist/oocsi/reference/index.html b/dist/oocsi/reference/index.html index ae93a1e..954f50b 100644 --- a/dist/oocsi/reference/index.html +++ b/dist/oocsi/reference/index.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/EventRecorder.html b/dist/oocsi/reference/nl/tue/id/oocsi/EventRecorder.html index 9d9630c..25ab1b3 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/EventRecorder.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/EventRecorder.html @@ -2,9 +2,9 @@ - + EventRecorder - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSI.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSI.html index 3b55ecf..b6083c6 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSI.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSI.html @@ -2,9 +2,9 @@ - + OOCSI - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":9,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":9,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -200,14 +200,14 @@

Method Summary

OOCSICall call(java.lang.String callName) -
create a call for service method
+
create a call for service method "callName"
OOCSICall call(java.lang.String callName, int timeoutMS) -
create a call for service method
+
create a call for service method "callName" with a specific timeout
@@ -215,97 +215,145 @@

Method Summary

call(java.lang.String callName, int timeoutMS, int maxResponses) -
create a call for service method
+
create a call for service method "callName" with a specific timeout
+OOCSICall +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 channelName
- + +void +disconnect() +
disconnect this client from the OOCSI network
+ + + java.lang.String getChannels()
retrieve the list of channels on the server
- + java.lang.String getChannels(java.lang.String channelName)
retrieve the list of sub-channel of the channel with the given name on the server
- + java.lang.String getClients()
retrieve the list of clients on the server
- + boolean isConnected()
returns whether the OOCSI client was able to connect to a server (already)
- + static OOCSI localInstance(java.lang.Object parent)
create a local instance of OOCSI, without a connection
- + void register(java.lang.String responderName)
register a responder; requires a method with the given responderName with parameters (OOCSIEvent, OOCSIData)
- + void register(java.lang.String responderName, java.lang.String responderFunctionName) -
register a responder; requires a method with the given responderName with parameters (OOCSIEvent, OOCSIData)
+
register a responder "responderName"; requires a method with the given name "responderName" with parameters + (OOCSIEvent, OOCSIData)
- + +void +registerChannel(java.lang.String channelName, + java.lang.String responderName) +
register a responder "responderName" on channel "channelName"; requires a method with the responder name + "responderName" with parameters (OOCSIEvent, OOCSIData)
+ + + +void +registerChannel(java.lang.String channelName, + java.lang.String responderName, + java.lang.String responderFunctionName) +
register a responder "responderName" on channel "channelName"; requires a method with the given name + "responderName" with parameters (OOCSIEvent, OOCSIData)
+ + + void sendRaw(java.lang.String channel, java.lang.String data)
send raw data to given channel
- + void subscribe(java.lang.String channelName)
subscribe to a channel
- + void subscribe(java.lang.String channelName, java.lang.String handlerName) -
subscribe to a channel with a given handler method name
+
subscribe to a channel with a given handler method name "handlerName"
- + void subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds) -
subscribe to a channel with a given handler method name ; limits the rate of incoming events to - events per secs
+
subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + "rate" events per "seconds" secs
- + void subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds, boolean ratePerSender) -
subscribe to a channel with a given handler method name ; limits the rate of incoming events to - events per secs; controls whether we limit the rate of incoming event per sender +
subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + "rate" events per "seconds" secs; "ratePerSender" controls whether we limit the rate of incoming event per sender or for all events coming in from all senders
@@ -495,6 +543,16 @@

isConnected

+ + + +
    +
  • +

    disconnect

    +
    public void disconnect()
    +
    disconnect this client from the OOCSI network
    +
  • +
@@ -517,7 +575,7 @@

channel

  • call

    public OOCSICall call(java.lang.String callName)
    -
    create a call for service method
    +
    create a call for service method "callName"
    Parameters:
    callName -
    @@ -525,6 +583,23 @@

    call

  • + + + +
      +
    • +

      call

      +
      public OOCSICall call(java.lang.String channelName,
      +                      java.lang.String callName)
      +
      create a call for service method "callName" on channel "channelName"
      +
      +
      Parameters:
      +
      channelName -
      +
      callName -
      +
      Returns:
      +
      +
    • +
    @@ -533,9 +608,28 @@

    call

    call

    public OOCSICall call(java.lang.String callName,
                           int timeoutMS)
    -
    create a call for service method
    +
    create a call for service method "callName" with a specific timeout
    +
    +
    Parameters:
    +
    callName -
    +
    timeoutMS -
    +
    Returns:
    +
    + + + + + +
      +
    • +

      call

      +
      public 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"
      Parameters:
      +
      channelName -
      callName -
      timeoutMS -
      Returns:
      @@ -551,9 +645,30 @@

      call

      public OOCSICall call(java.lang.String callName,
                             int timeoutMS,
                             int maxResponses)
      -
      create a call for service method
      +
      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 -
      @@ -599,7 +714,7 @@

      subscribe

      subscribe

      public void subscribe(java.lang.String channelName,
                             java.lang.String handlerName)
      -
      subscribe to a channel with a given handler method name
      +
      subscribe to a channel with a given handler method name "handlerName"
      Parameters:
      channelName -
      @@ -617,8 +732,8 @@

      subscribe

      java.lang.String handlerName, int rate, int seconds) -
      subscribe to a channel with a given handler method name ; limits the rate of incoming events to - events per secs
      +
      subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + "rate" events per "seconds" secs
      Parameters:
      channelName -
      @@ -639,8 +754,8 @@

      subscribe

      int rate, int seconds, boolean ratePerSender) -
      subscribe to a channel with a given handler method name ; limits the rate of incoming events to - events per secs; controls whether we limit the rate of incoming event per sender +
      subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + "rate" events per "seconds" secs; "ratePerSender" controls whether we limit the rate of incoming event per sender or for all events coming in from all senders
      Parameters:
      @@ -674,9 +789,46 @@

      register

      register

      public void register(java.lang.String responderName,
                            java.lang.String responderFunctionName)
      -
      register a responder; requires a method with the given responderName with parameters (OOCSIEvent, OOCSIData)
      +
      register a responder "responderName"; requires a method with the given name "responderName" with parameters + (OOCSIEvent, OOCSIData)
      +
      +
      Parameters:
      +
      responderName -
      +
      responderFunctionName -
      +
      +
    • +
    + + + +
      +
    • +

      registerChannel

      +
      public void registerChannel(java.lang.String channelName,
      +                            java.lang.String responderName)
      +
      register a responder "responderName" on channel "channelName"; requires a method with the responder name + "responderName" with parameters (OOCSIEvent, OOCSIData)
      Parameters:
      +
      channelName -
      +
      responderName -
      +
      +
    • +
    + + + +
      +
    • +

      registerChannel

      +
      public void registerChannel(java.lang.String channelName,
      +                            java.lang.String responderName,
      +                            java.lang.String responderFunctionName)
      +
      register a responder "responderName" on channel "channelName"; requires a method with the given name + "responderName" with parameters (OOCSIEvent, OOCSIData)
      +
      +
      Parameters:
      +
      channelName -
      responderName -
      responderFunctionName -
      diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIBoolean.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIBoolean.html index 37baf47..74f13de 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIBoolean.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIBoolean.html @@ -2,9 +2,9 @@ - + OOCSIBoolean - + @@ -207,7 +207,7 @@

      Method Summary

      OOCSIBoolean limit(int rate, int seconds) -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      @@ -308,7 +308,7 @@

      Method Detail

      limit

      public OOCSIBoolean limit(int rate,
                                 int seconds)
      -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      Overrides:
      limit in class OOCSIVariable<java.lang.Boolean>
      diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSICommunicator.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSICommunicator.html index fcd4042..a34a34e 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSICommunicator.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSICommunicator.html @@ -2,9 +2,9 @@ - + OOCSICommunicator - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -176,14 +176,14 @@

      Method Summary

      OOCSICall call(java.lang.String callName) -
      create a call for service method
      +
      create a call for service method "callName"
      OOCSICall call(java.lang.String callName, int timeoutMS) -
      create a call for service method
      +
      create a call for service method "callName" with a specific timeout
      @@ -191,86 +191,128 @@

      Method Summary

      call(java.lang.String callName, int timeoutMS, int maxResponses) -
      create a call for service method
      +
      create a call for service method "callName" with a specific timeout
      +OOCSICall +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 channelName
      - + boolean connect()
      connect to OOCSI network without a concrete server given, i.e., wait for multi-cast messages broadcasting a server to connect to
      - + boolean connect(java.lang.String hostname, int port)
      connect to OOCSI network
      - + Handler 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 for handler method in the parent class; the handler method +
      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
      + '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 for the channel ; +
      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
      - + +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"
      + + + +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
      + + + boolean subscribe(java.lang.String channelName) -
      subscribe to channel for handler method in the parent class; the handler method will +
      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
      + case no matching handler method is found for "channelName"
      - + boolean subscribe(java.lang.String channelName, java.lang.String handlerName) -
      subscribe to channel for handler method in the parent class with the given name ; the +
      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
      - + boolean subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds) -
      subscribe to channel for handler method in the parent class with the given name ; the +
      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
      - + boolean subscribe(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds, boolean ratePerSender) -
      subscribe to channel for handler method in the parent class with the given name ; the +
      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
      @@ -280,7 +322,7 @@

      Method Summary

      Methods inherited from class nl.tue.id.oocsi.client.OOCSIClient

      -channels, channels, clients, disconnect, getName, isConnected, kill, log, reconnect, register, register, send, send, setReconnect, subscribe, subscribe, unsubscribe
    • +channels, channels, clients, disconnect, getName, isConnected, kill, log, reconnect, register, register, register, send, send, setReconnect, subscribe, subscribe, unsubscribe
    + + + +
      +
    • +

      call

      +
      public OOCSICall call(java.lang.String channelName,
      +                      java.lang.String callName)
      +
      create a call for service method "callName" on channel "channelName"
      Parameters:
      +
      channelName -
      callName -
      Returns:
      @@ -399,9 +458,28 @@

      call

      call

      public OOCSICall call(java.lang.String callName,
                             int timeoutMS)
      -
      create a call for service method
      +
      create a call for service method "callName" with a specific timeout
      +
      +
      Parameters:
      +
      callName -
      +
      timeoutMS -
      +
      Returns:
      +
      +
    • +
    + + + +
      +
    • +

      call

      +
      public 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"
      Parameters:
      +
      channelName -
      callName -
      timeoutMS -
      Returns:
      @@ -417,9 +495,30 @@

      call

      public OOCSICall call(java.lang.String callName,
                             int timeoutMS,
                             int maxResponses)
      -
      create a call for service method
      +
      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 -
      @@ -434,9 +533,9 @@

      call

    • subscribe

      public boolean subscribe(java.lang.String channelName)
      -
      subscribe to channel for handler method in the parent class; the handler method will +
      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
      + case no matching handler method is found for "channelName"
      Parameters:
      channelName -
      @@ -452,7 +551,7 @@

      subscribe

      subscribe

      public boolean subscribe(java.lang.String channelName,
                                java.lang.String handlerName)
      -
      subscribe to channel for handler method in the parent class with the given name ; the +
      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:
      @@ -472,7 +571,7 @@

      subscribe

      java.lang.String handlerName, int rate, int seconds) -
      subscribe to channel for handler method in the parent class with the given name ; the +
      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:
      @@ -495,7 +594,7 @@

      subscribe

      int rate, int seconds, boolean ratePerSender) -
      subscribe to channel for handler method in the parent class with the given name ; the +
      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:
      @@ -531,9 +630,9 @@

      createSimpleCallerHandler

    • register

      public boolean register(java.lang.String responderName)
      -
      subscribe to channel for handler method in the parent class; the handler method +
      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
      + 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"
      Parameters:
      responderName -
      @@ -544,15 +643,54 @@

      register

      -
        +
        • register

          public boolean register(java.lang.String responderName,
                                   java.lang.String handlerName)
          -
          register a handler method in the parent class with the given name for the channel ; +
          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:
          diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIData.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIData.html index 60158aa..ac53c70 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIData.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIData.html @@ -2,9 +2,9 @@ - + OOCSIData - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIDouble.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIDouble.html index 526b507..8f45baf 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIDouble.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIDouble.html @@ -2,9 +2,9 @@ - + OOCSIDouble - + @@ -256,7 +256,7 @@

          Method Summary

          OOCSIDouble limit(int rate, int seconds) -
          set the limiting of incoming events in terms of and timeframe; supports chained invocation
          +
          set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
          @@ -480,7 +480,7 @@

          timeout

          limit

          public OOCSIDouble limit(int rate,
                                    int seconds)
          -
          set the limiting of incoming events in terms of and timeframe; supports chained invocation
          +
          set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
          Overrides:
          limit in class OOCSIVariable<java.lang.Double>
          @@ -593,7 +593,7 @@

          generator

          java.lang.String outputKey)
          creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - addition, the new value of the variable is sent out to the channel with the given key
          + addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey"
    • Overrides:
      generator in class OOCSIVariable<java.lang.Double>
      diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIEvent.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIEvent.html index 1011f0c..de456d8 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIEvent.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIEvent.html @@ -2,9 +2,9 @@ - + OOCSIEvent - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIFloat.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIFloat.html index ec0d87b..233d01d 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIFloat.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIFloat.html @@ -2,9 +2,9 @@ - + OOCSIFloat - + @@ -256,7 +256,7 @@

      Method Summary

      OOCSIFloat limit(int rate, int seconds) -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      @@ -480,7 +480,7 @@

      timeout

      limit

      public OOCSIFloat limit(int rate,
                               int seconds)
      -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      Overrides:
      limit in class OOCSIVariable<java.lang.Float>
      @@ -593,7 +593,7 @@

      generator

      java.lang.String outputKey)
      creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - addition, the new value of the variable is sent out to the channel with the given key
      + addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey"
      Overrides:
      generator in class OOCSIVariable<java.lang.Float>
      diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIInt.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIInt.html index fbbe95d..c0716c0 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIInt.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIInt.html @@ -2,9 +2,9 @@ - + OOCSIInt - + @@ -256,7 +256,7 @@

      Method Summary

      OOCSIInt limit(int rate, int seconds) -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      @@ -485,7 +485,7 @@

      timeout

      limit

      public OOCSIInt limit(int rate,
                             int seconds)
      -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      Overrides:
      limit in class OOCSIVariable<java.lang.Integer>
      @@ -598,7 +598,7 @@

      generator

      java.lang.String outputKey)
      creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - addition, the new value of the variable is sent out to the channel with the given key
      + addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey"
      Overrides:
      generator in class OOCSIVariable<java.lang.Integer>
      diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSILong.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSILong.html index bd90ff9..84eaa0f 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSILong.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSILong.html @@ -2,9 +2,9 @@ - + OOCSILong - + @@ -256,7 +256,7 @@

      Method Summary

      OOCSILong limit(int rate, int seconds) -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      @@ -480,7 +480,7 @@

      timeout

      limit

      public OOCSILong limit(int rate,
                              int seconds)
      -
      set the limiting of incoming events in terms of and timeframe; supports chained invocation
      +
      set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
      Overrides:
      limit in class OOCSIVariable<java.lang.Long>
      @@ -593,7 +593,7 @@

      generator

      java.lang.String outputKey)
      creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - addition, the new value of the variable is sent out to the channel with the given key
      + addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey"
    Overrides:
    generator in class OOCSIVariable<java.lang.Long>
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIString.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIString.html index f1ea384..9992b00 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIString.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIString.html @@ -2,9 +2,9 @@ - + OOCSIString - + @@ -203,7 +203,7 @@

    Method Summary

    OOCSIString limit(int rate, int seconds) -
    set the limiting of incoming events in terms of and timeframe; supports chained invocation
    +
    set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
    @@ -294,7 +294,7 @@

    Method Detail

    limit

    public OOCSIString limit(int rate,
                              int seconds)
    -
    set the limiting of incoming events in terms of and timeframe; supports chained invocation
    +
    set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
    Overrides:
    limit in class OOCSIVariable<java.lang.String>
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIVariable.html b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIVariable.html index 0da2927..57a3481 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIVariable.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/OOCSIVariable.html @@ -2,9 +2,9 @@ - + OOCSIVariable - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.State.html b/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.State.html index 72a34bf..eb59fc6 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.State.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.State.html @@ -2,9 +2,9 @@ - + StateMachine.State - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.html b/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.html index dd4f45c..861c026 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/StateMachine.html @@ -2,9 +2,9 @@ - + StateMachine - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/OOCSIClient.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/OOCSIClient.html index 9a2b3e5..6ca1d34 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/OOCSIClient.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/OOCSIClient.html @@ -2,9 +2,9 @@ - + OOCSIClient - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -274,43 +274,51 @@

    Method Summary

    void register(java.lang.String callName, Responder responder) -
    register a responder with the socket client with a given handle
    +
    register a responder with the socket client with a given handle "callName"
    void +register(java.lang.String channelName, + java.lang.String callName, + Responder responder) +
    register a responder with the socket client with a given handle "callName" on channel "channelName"
    + + + +void send(java.lang.String channelName, java.util.Map<java.lang.String,java.lang.Object> data)
    send a composite message (map) to the channel with the given name
    - + void send(java.lang.String channelName, java.lang.String message)
    send a string message to the channel with the given name
    - + void setReconnect(boolean reconnect)
    set whether or not a reconnection attempt should be made if a connection fails
    - + void subscribe(Handler handler)
    subscribe to my own channel
    - + void subscribe(java.lang.String channelName, Handler handler)
    subscribe to the channel with the given name
    - + void unsubscribe(java.lang.String channelName)
    unsubscribe from the channel with the given name
    @@ -589,7 +597,7 @@

    register

    register

    public void register(java.lang.String callName,
                          Responder responder)
    -
    register a responder with the socket client with a given handle
    +
    register a responder with the socket client with a given handle "callName"
    Parameters:
    callName -
    @@ -597,6 +605,24 @@

    register

    + + + + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIAwareness.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIAwareness.html index 0113b0a..1561d8b 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIAwareness.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIAwareness.html @@ -2,9 +2,9 @@ - + OOCSIAwareness - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIConsensus.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIConsensus.html index bfdefc3..f1c1726 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIConsensus.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIConsensus.html @@ -2,9 +2,9 @@ - + OOCSIConsensus - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIGather.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIGather.html index 2f6e89e..6ac81d8 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIGather.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIGather.html @@ -2,9 +2,9 @@ - + OOCSIGather - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.DistanceMetric.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.DistanceMetric.html index ba0d5b6..4f8a021 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.DistanceMetric.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.DistanceMetric.html @@ -2,9 +2,9 @@ - + OOCSISpatial.DistanceMetric - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.html index d05781b..196c264 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpatial.html @@ -2,9 +2,9 @@ - + OOCSISpatial - + @@ -325,8 +325,7 @@

    OOCSISpatial

    client -
    channelName -
    key -
    -
    myPosition -
    -
    neighbourThreshold -
    +
    neighborDistance -
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpread.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpread.html index 8ac35ec..aa2cbf1 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpread.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISpread.html @@ -2,9 +2,9 @@ - + OOCSISpread - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISync.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISync.html index df1aff5..b95771b 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISync.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISync.html @@ -2,9 +2,9 @@ - + OOCSISync - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISystemCommunicator.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISystemCommunicator.html index 1ae1ab1..757084a 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISystemCommunicator.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSISystemCommunicator.html @@ -2,9 +2,9 @@ - + OOCSISystemCommunicator - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIVariable.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIVariable.html index ebece11..72f74d2 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIVariable.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/OOCSIVariable.html @@ -2,9 +2,9 @@ - + OOCSIVariable - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-frame.html index e68c4ac..2377aec 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.behavior - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-summary.html index 2b00b16..80f706c 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.behavior - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-tree.html index 66245df..fe7fb99 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.behavior Class Hierarchy - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.State.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.State.html index bdc1a84..23ef9e3 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.State.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.State.html @@ -2,9 +2,9 @@ - + OOCSIStateMachine.State - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.Transition.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.Transition.html index f1e439b..7479e19 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.Transition.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.Transition.html @@ -2,9 +2,9 @@ - + OOCSIStateMachine.Transition - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.html index 4cb20ad..900bc7d 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/OOCSIStateMachine.html @@ -2,9 +2,9 @@ - + OOCSIStateMachine - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-frame.html index 375a489..869517c 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.behavior.state - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-summary.html index 975c10c..5ed7691 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.behavior.state - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-tree.html index 6acef6b..2684055 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/behavior/state/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.behavior.state Class Hierarchy - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/OOCSIVariable.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/OOCSIVariable.html index 4a709b6..325befd 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/OOCSIVariable.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/OOCSIVariable.html @@ -2,9 +2,9 @@ - + OOCSIVariable - + @@ -321,7 +321,7 @@

    Method Summary

    OOCSIVariable<T> limit(int rate, int seconds) -
    set the limiting of incoming events in terms of and timeframe; supports chained invocation
    +
    set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
    @@ -789,7 +789,7 @@

    timeout

    limit

    public OOCSIVariable<T> limit(int rate,
                                   int seconds)
    -
    set the limiting of incoming events in terms of and timeframe; supports chained invocation
    +
    set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
    Parameters:
    rate -
    @@ -844,7 +844,6 @@

    smooth

    Parameters:
    windowLength -
    -
    sigma -
    Returns:
    @@ -897,7 +896,7 @@

    generator

    java.lang.String outputKey)
    creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - addition, the new value of the variable is sent out to the channel with the given key
    + addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey"
    Parameters:
    periodMS -
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-frame.html index 8f89fc0..a6f0497 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.data - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-summary.html index 7966e5d..8610c03 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.data - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-tree.html index a50d756..3e098b3 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/data/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.data Class Hierarchy - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/package-frame.html index a7a82f5..6c46853 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/package-summary.html index e7ddee8..85162a4 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/package-tree.html index faa74a9..eff5245 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client Class Hierarchy - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/DataHandler.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/DataHandler.html index 5f7cdc9..266b603 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/DataHandler.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/DataHandler.html @@ -2,9 +2,9 @@ - + DataHandler - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/EventHandler.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/EventHandler.html index 548af50..dd8fa1a 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/EventHandler.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/EventHandler.html @@ -2,9 +2,9 @@ - + EventHandler - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/Handler.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/Handler.html index a4b0fc4..7b5a89a 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/Handler.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/Handler.html @@ -2,9 +2,9 @@ - + Handler - + @@ -157,13 +157,13 @@

    Method Summary

    static java.util.Map<java.lang.String,java.lang.Object> parseData(java.lang.String data) -
    parse the given String into a Map
    +
    parse the given "data" String into a Map
    static long parseTimestamp(java.lang.String timestamp) -
    parse the given String into a long value
    +
    parse the given "timestamp" String into a long value
    @@ -280,7 +280,7 @@

    parseData

    public static java.util.Map<java.lang.String,java.lang.Object> parseData(java.lang.String data)
                                                                       throws java.io.IOException,
                                                                              java.lang.ClassNotFoundException
    -
    parse the given String into a Map
    +
    parse the given "data" String into a Map
    Parameters:
    data -
    @@ -298,7 +298,7 @@

    parseData

  • parseTimestamp

    public static long parseTimestamp(java.lang.String timestamp)
    -
    parse the given String into a long value
    +
    parse the given "timestamp" String into a long value
    Parameters:
    timestamp -
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiHandler.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiHandler.html index 3461fb8..c1eee86 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiHandler.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiHandler.html @@ -2,9 +2,9 @@ - + MultiHandler - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiMessage.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiMessage.html index c61c7a8..eaf4830 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiMessage.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/MultiMessage.html @@ -2,9 +2,9 @@ - + MultiMessage - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/OOCSIMessage.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/OOCSIMessage.html index 8c8f6cf..7df6d4d 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/OOCSIMessage.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/OOCSIMessage.html @@ -2,9 +2,9 @@ - + OOCSIMessage - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.html index a530c99..9b42710 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.html @@ -2,9 +2,9 @@ - + RateLimitedClientEventHandler - + @@ -125,7 +125,7 @@

    Class RateLimitedC
    public abstract class RateLimitedClientEventHandler
     extends RateLimitedEventHandler
    -
    rate limited event handler for events with structured data that will only let through events per +
    rate limited event handler for events with structured data that will only let through "rate" events per "second" secs; this counts for all incoming events per sender which protects against single senders overloading the system
    Author:
    @@ -166,7 +166,7 @@

    Constructor Summary

    RateLimitedClientEventHandler(int rate, int seconds) -
    creates a rate limited event handler that will at most let through event per secs
    +
    creates a rate limited event handler that will at most let through "rate" event per "second" secs
    @@ -246,7 +246,7 @@

    Constructor Detail

    RateLimitedClientEventHandler

    public RateLimitedClientEventHandler(int rate,
                                          int seconds)
    -
    creates a rate limited event handler that will at most let through event per secs
    +
    creates a rate limited event handler that will at most let through "rate" event per "second" secs
    Parameters:
    rate -
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.html index 607ebcb..f8cc702 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.html @@ -2,9 +2,9 @@ - + RateLimitedEventHandler - + @@ -124,7 +124,7 @@

    Class RateLimitedEventHa
    public abstract class RateLimitedEventHandler
     extends EventHandler
    -
    rate limited event handler for events with structured data that will only let through events per +
    rate limited event handler for events with structured data that will only let through "rate" events per "second" secs; this counts for all incoming events
    Author:
    @@ -177,7 +177,7 @@

    Constructor Summary

    RateLimitedEventHandler(int rate, int seconds) -
    creates a rate limited event handler that will at most let through event per secs
    +
    creates a rate limited event handler that will at most let through "rate" event per "second" secs
    @@ -217,7 +217,7 @@

    Method Summary

    void limit(int rate, int seconds) -
    reconfigure the rate limitation to different and timeframe
    +
    reconfigure the rate limitation to different "rate" and "seconds" timeframe
    @@ -310,7 +310,7 @@

    Constructor Detail

    RateLimitedEventHandler

    public RateLimitedEventHandler(int rate,
                                    int seconds)
    -
    creates a rate limited event handler that will at most let through event per secs
    +
    creates a rate limited event handler that will at most let through "rate" event per "second" secs
    Parameters:
    rate -
    @@ -389,7 +389,7 @@

    exceeded

    limit

    public void limit(int rate,
                       int seconds)
    -
    reconfigure the rate limitation to different and timeframe
    +
    reconfigure the rate limitation to different "rate" and "seconds" timeframe
    Parameters:
    rate -
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-frame.html index 0ddada1..5ce87aa 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.protocol - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-summary.html index cfe2efd..9aa0c6e 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.protocol - + @@ -119,14 +119,14 @@

    Package nl.tue.id.oocsi.client.protocol RateLimitedClientEventHandler -
    rate limited event handler for events with structured data that will only let through events per +
    rate limited event handler for events with structured data that will only let through "rate" events per "second" secs; this counts for all incoming events per sender which protects against single senders overloading the system
    RateLimitedEventHandler -
    rate limited event handler for events with structured data that will only let through events per +
    rate limited event handler for events with structured data that will only let through "rate" events per "second" secs; this counts for all incoming events
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-tree.html index 5cb51d2..3ebffba 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/protocol/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.protocol Class Hierarchy - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/OOCSICall.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/OOCSICall.html index 4f6ed7e..a5a02b0 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/OOCSICall.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/OOCSICall.html @@ -2,9 +2,9 @@ - + OOCSICall - + @@ -184,7 +184,7 @@

    Constructor Summary

    java.lang.String callName, int timeoutMS, int maxResponses) -
    create a new message to the channel
    +
    create a new message to the channel "channelName"
    @@ -193,7 +193,7 @@

    Constructor Summary

    java.lang.String callName, int timeoutMS, int maxResponses) -
    create a new message to the channel
    +
    create a new message to the channel "channelName"
    @@ -400,7 +400,7 @@

    OOCSICall

    java.lang.String callName, int timeoutMS, int maxResponses) -
    create a new message to the channel
    +
    create a new message to the channel "channelName"
    Parameters:
    oocsi -
    @@ -421,7 +421,7 @@

    OOCSICall

    java.lang.String callName, int timeoutMS, int maxResponses) -
    create a new message to the channel
    +
    create a new message to the channel "channelName"
    Parameters:
    oocsi -
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Responder.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Responder.html index ebc7a26..82e99ad 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Responder.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Responder.html @@ -2,9 +2,9 @@ - + Responder - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceField.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceField.html index be65f01..bb220b5 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceField.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceField.html @@ -2,9 +2,9 @@ - + Service.ServiceField - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceMethod.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceMethod.html index d46c0e5..1553090 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceMethod.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.ServiceMethod.html @@ -2,9 +2,9 @@ - + Service.ServiceMethod - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.html index 3d47f3a..4aba84d 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/Service.html @@ -2,9 +2,9 @@ - + Service - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-frame.html index aedfe23..153b94e 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.services - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-summary.html index 579e498..589f7d0 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.services - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-tree.html index 590550a..93d4f63 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/services/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.services Class Hierarchy - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/Base64Coder.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/Base64Coder.html index 4e52c8d..dbb5c30 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/Base64Coder.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/Base64Coder.html @@ -2,9 +2,9 @@ - + Base64Coder - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/SocketClient.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/SocketClient.html index d587893..f02e7fc 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/SocketClient.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/SocketClient.html @@ -2,9 +2,9 @@ - + SocketClient - + @@ -225,7 +225,7 @@

    Method Summary

    void register(java.lang.String callName, Responder responder) -
    register a responder with a handle
    +
    register a responder with a handle "callName"
    @@ -250,7 +250,9 @@

    Method Summary

    boolean -startMulticastLookup()  +startMulticastLookup() +
    start pinging for a multi-cast lookup
    + void @@ -331,6 +333,10 @@

    Method Detail

  • startMulticastLookup

    public boolean startMulticastLookup()
    +
    start pinging for a multi-cast lookup
    +
    +
    Returns:
    +
  • @@ -496,7 +502,7 @@

    register

    register

    public void register(java.lang.String callName,
                          Responder responder)
    -
    register a responder with a handle
    +
    register a responder with a handle "callName"
    Parameters:
    callName -
    diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-frame.html index 4ff5b63..6786bba 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.socket - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-summary.html index fc60e80..982390b 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.socket - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-tree.html index ab92930..3690061 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/client/socket/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi.client.socket Class Hierarchy - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/package-frame.html b/dist/oocsi/reference/nl/tue/id/oocsi/package-frame.html index e0983c8..72045aa 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/package-frame.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/package-frame.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/package-summary.html b/dist/oocsi/reference/nl/tue/id/oocsi/package-summary.html index 0b3844a..38b3b2c 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/package-summary.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/package-summary.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi - + diff --git a/dist/oocsi/reference/nl/tue/id/oocsi/package-tree.html b/dist/oocsi/reference/nl/tue/id/oocsi/package-tree.html index f836240..67422c3 100644 --- a/dist/oocsi/reference/nl/tue/id/oocsi/package-tree.html +++ b/dist/oocsi/reference/nl/tue/id/oocsi/package-tree.html @@ -2,9 +2,9 @@ - + nl.tue.id.oocsi Class Hierarchy - + diff --git a/dist/oocsi/reference/overview-frame.html b/dist/oocsi/reference/overview-frame.html index b7c6826..9873ea6 100644 --- a/dist/oocsi/reference/overview-frame.html +++ b/dist/oocsi/reference/overview-frame.html @@ -2,9 +2,9 @@ - + Overview List - + diff --git a/dist/oocsi/reference/overview-summary.html b/dist/oocsi/reference/overview-summary.html index 516b87d..65cf5b2 100644 --- a/dist/oocsi/reference/overview-summary.html +++ b/dist/oocsi/reference/overview-summary.html @@ -2,9 +2,9 @@ - + Overview - + diff --git a/dist/oocsi/reference/overview-tree.html b/dist/oocsi/reference/overview-tree.html index 3fcd9eb..5022ff8 100644 --- a/dist/oocsi/reference/overview-tree.html +++ b/dist/oocsi/reference/overview-tree.html @@ -2,9 +2,9 @@ - + Class Hierarchy - + diff --git a/dist/oocsi/reference/serialized-form.html b/dist/oocsi/reference/serialized-form.html index 8b10c3c..6688b87 100644 --- a/dist/oocsi/reference/serialized-form.html +++ b/dist/oocsi/reference/serialized-form.html @@ -2,9 +2,9 @@ - + Serialized Form - + diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSI.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSI.java index be5d9be..19ddb69 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSI.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSI.java @@ -109,7 +109,7 @@ private OOCSI(Object parent, OOCSICommunicator communicator) { } /** - * create a new OOCSI network connection with client handle (), server host, and port + * create a new OOCSI network connection with client handle ("name"), server host, and port * * @param parent * @param name @@ -221,6 +221,14 @@ public boolean isConnected() { return oocsi.isConnected(); } + /** + * disconnect this client from the OOCSI network + * + */ + public void disconnect() { + oocsi.disconnect(); + } + /** * send data through a channel given by the channelName * @@ -232,7 +240,7 @@ public OOCSIMessage channel(String channelName) { } /** - * create a call for service method + * create a call for service method "callName" * * @param callName * @return @@ -242,7 +250,18 @@ public OOCSICall call(String callName) { } /** - * create a call for service method + * create a call for service method "callName" on channel "channelName" + * + * @param channelName + * @param callName + * @return + */ + public OOCSICall call(String channelName, String callName) { + return oocsi.call(channelName, callName); + } + + /** + * create a call for service method "callName" with a specific timeout * * @param callName * @param timeoutMS @@ -253,7 +272,19 @@ public OOCSICall call(String callName, int timeoutMS) { } /** - * create a call for service method + * create a call for service method "callName" with a specific timeout on channel "channelName" + * + * @param channelName + * @param callName + * @param timeoutMS + * @return + */ + public OOCSICall call(String channelName, String callName, int timeoutMS) { + return oocsi.call(channelName, callName, timeoutMS); + } + + /** + * create a call for service method "callName" with a specific timeout * * @param callName * @param timeoutMS @@ -264,6 +295,19 @@ public OOCSICall call(String callName, int timeoutMS, int maxResponses) { return oocsi.call(callName, timeoutMS, maxResponses); } + /** + * create a call for service method "callName" with a specific timeout on channel "channelName" + * + * @param channelName + * @param callName + * @param timeoutMS + * @param maxResponses + * @return + */ + public OOCSICall call(String channelName, String callName, int timeoutMS, int maxResponses) { + return oocsi.call(channelName, callName, timeoutMS, maxResponses); + } + /** * send raw data to given channel * @@ -289,7 +333,7 @@ public void subscribe(String channelName) { } /** - * subscribe to a channel with a given handler method name + * subscribe to a channel with a given handler method name "handlerName" * * @param channelName * @param handlerName @@ -304,8 +348,8 @@ public void subscribe(String channelName, String handlerName) { } /** - * subscribe to a channel with a given handler method name ; limits the rate of incoming events to - * events per secs + * subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + * "rate" events per "seconds" secs * * @param channelName * @param handlerName @@ -322,8 +366,8 @@ public void subscribe(String channelName, String handlerName, int rate, int seco } /** - * subscribe to a channel with a given handler method name ; limits the rate of incoming events to - * events per secs; controls whether we limit the rate of incoming event per sender + * subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + * "rate" events per "seconds" secs; "ratePerSender" controls whether we limit the rate of incoming event per sender * or for all events coming in from all senders * * @param channelName @@ -356,7 +400,8 @@ public void register(String responderName) { } /** - * register a responder; requires a method with the given responderName with parameters (OOCSIEvent, OOCSIData) + * register a responder "responderName"; requires a method with the given name "responderName" with parameters + * (OOCSIEvent, OOCSIData) * * @param responderName * @param responderFunctionName @@ -370,6 +415,39 @@ public void register(String responderName, String responderFunctionName) { oocsi.register(responderName, responderFunctionName); } + /** + * register a responder "responderName" on channel "channelName"; requires a method with the responder name + * "responderName" with parameters (OOCSIEvent, OOCSIData) + * + * @param channelName + * @param responderName + */ + public void registerChannel(String channelName, String responderName) { + + if (!oocsi.isConnected()) { + return; + } + + oocsi.registerChannel(channelName, responderName); + } + + /** + * register a responder "responderName" on channel "channelName"; requires a method with the given name + * "responderName" with parameters (OOCSIEvent, OOCSIData) + * + * @param channelName + * @param responderName + * @param responderFunctionName + */ + public void registerChannel(String channelName, String responderName, String responderFunctionName) { + + if (!oocsi.isConnected()) { + return; + } + + oocsi.registerChannel(channelName, responderName, responderFunctionName); + } + /** * retrieve the list of clients on the server * diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIBoolean.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIBoolean.java index c258038..0b96b69 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIBoolean.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIBoolean.java @@ -30,7 +30,7 @@ public OOCSIBoolean(boolean referenceValue, int timeout) { } /** - * set the limiting of incoming events in terms of and timeframe; supports chained invocation + * set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation * * @param rate * @param seconds diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSICommunicator.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSICommunicator.java index 5185286..f6bd4c3 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSICommunicator.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSICommunicator.java @@ -2,6 +2,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import nl.tue.id.oocsi.client.OOCSIClient; import nl.tue.id.oocsi.client.protocol.EventHandler; @@ -86,7 +87,7 @@ public OOCSIMessage channel(String channelName) { } /** - * create a call for service method + * create a call for service method "callName" * * @param callName * @return @@ -96,7 +97,18 @@ public OOCSICall call(String callName) { } /** - * create a call for service method + * create a call for service method "callName" on channel "channelName" + * + * @param channelName + * @param callName + * @return + */ + public OOCSICall call(String channelName, String callName) { + return call(channelName, callName, 1000, 1); + } + + /** + * create a call for service method "callName" with a specific timeout * * @param callName * @param timeoutMS @@ -107,7 +119,19 @@ public OOCSICall call(String callName, int timeoutMS) { } /** - * create a call for service method + * create a call for service method "callName" with a specific timeout on channel "channelName" + * + * @param channelName + * @param callName + * @param timeoutMS + * @return + */ + public OOCSICall call(String channelName, String callName, int timeoutMS) { + return call(channelName, callName, timeoutMS, 1); + } + + /** + * create a call for service method "callName" with a specific timeout * * @param callName * @param timeoutMS @@ -119,9 +143,22 @@ public OOCSICall call(String callName, int timeoutMS, int maxResponses) { } /** - * subscribe to channel for handler method in the parent class; the handler method will + * create a call for service method "callName" with a specific timeout on channel "channelName" + * + * @param channelName + * @param callName + * @param timeoutMS + * @param maxResponses + * @return + */ + public OOCSICall call(String channelName, String callName, int timeoutMS, int maxResponses) { + return new OOCSICall(this, channelName, callName, timeoutMS, maxResponses); + } + + /** + * 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 + * case no matching handler method is found for "channelName" * * @param channelName * @return @@ -131,7 +168,7 @@ public boolean subscribe(String channelName) { } /** - * subscribe to channel for handler method in the parent class with the given name ; the + * 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 * * @param channelName @@ -143,7 +180,7 @@ public boolean subscribe(String channelName, String handlerName) { } /** - * subscribe to channel for handler method in the parent class with the given name ; the + * 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 * * @param channelName @@ -157,7 +194,7 @@ public boolean subscribe(String channelName, String handlerName, int rate, int s } /** - * subscribe to channel for handler method in the parent class with the given name ; the + * 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 * * @param channelName @@ -167,12 +204,19 @@ public boolean subscribe(String channelName, String handlerName, int rate, int s * @param ratePerSender * @return */ - public boolean subscribe(String channelName, String handlerName, int rate, int seconds, boolean ratePerSender) { + public boolean subscribe(final String channelName, String handlerName, int rate, int seconds, + boolean ratePerSender) { // try event handler with OOCSIEvent parameter try { final Method handler = parent.getClass().getDeclaredMethod(handlerName, new Class[] { OOCSIEvent.class }); + if (!Modifier.isPublic(handler.getModifiers())) { + log(" - [ERROR] event handler for channel " + channelName + + " needs to be a public method: 'public void " + channelName + "(OOCSIEvent evt) { ... }'"); + return false; + } + if (rate > 0 && seconds > 0) { if (ratePerSender) { subscribe(channelName, new RateLimitedClientEventHandler(rate, seconds) { @@ -224,10 +268,13 @@ public void receive(OOCSIEvent event) { } }); } + log(" - subscribed to " + channelName + " with event handler"); return true; - } catch (Exception e) { + } catch ( + + Exception e) { // not found, just return false if (!name.equals(channelName)) { log(" - no event handler for channel " + channelName); @@ -270,9 +317,9 @@ public void receive(OOCSIEvent event) { } /** - * subscribe to channel for handler method in the parent class; the handler method + * 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 + * 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName" * * @param responderName * @return @@ -282,7 +329,7 @@ public boolean register(String responderName) { } /** - * register a handler method in the parent class with the given name for the channel ; + * 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 * * @param responderName @@ -327,4 +374,66 @@ public void respond(OOCSIEvent event, OOCSIData response) { } } + + /** + * 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" + * + * @param channelName + * @param responderName + * @return + */ + public boolean registerChannel(String channelName, String responderName) { + return registerChannel(channelName, responderName, responderName) ? true + : registerChannel(channelName, responderName, "respondToOOCSIEvent"); + } + + /** + * 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 + * + * @param channelName + * @param responderName + * @param handlerName + * @return + */ + public boolean registerChannel(String channelName, String responderName, String handlerName) { + + // try responder event handler with OOCSIEvent and response map parameters + + try { + final Method handler = parent.getClass().getDeclaredMethod(handlerName, + new Class[] { OOCSIEvent.class, OOCSIData.class }); + Responder responder = new Responder(this) { + + @Override + public void respond(OOCSIEvent event, OOCSIData response) { + try { + handler.invoke(parent, new Object[] { event, response }); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + } + }; + responder.setCallName(responderName); + register(channelName, responderName, responder); + + log(" - registered " + responderName + " as call responder"); + + return true; + } catch (Exception e) { + // not found, just return false + if (!name.equals(responderName)) { + log(" - no call responders found for channel " + responderName); + } + + return false; + } + + } } diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIDouble.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIDouble.java index 4e2eb2e..70f7102 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIDouble.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIDouble.java @@ -113,7 +113,7 @@ public OOCSIDouble timeout(int timeoutMS) { } /** - * set the limiting of incoming events in terms of and timeframe; supports chained invocation + * set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation * * @param rate * @param seconds @@ -188,7 +188,7 @@ public OOCSIDouble generator(long periodMS) { /** * creates a periodic feedback loop that feed either the last input value or the reference value into the variable * (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - * addition, the new value of the variable is sent out to the channel with the given key + * addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey" * * @param periodMS * @param outputChannel diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIFloat.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIFloat.java index 2502a3d..6cb673f 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIFloat.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIFloat.java @@ -113,7 +113,7 @@ public OOCSIFloat timeout(int timeoutMS) { } /** - * set the limiting of incoming events in terms of and timeframe; supports chained invocation + * set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation * * @param rate * @param seconds @@ -189,7 +189,7 @@ public OOCSIFloat generator(long periodMS) { /** * creates a periodic feedback loop that feed either the last input value or the reference value into the variable * (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - * addition, the new value of the variable is sent out to the channel with the given key + * addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey" * * @param periodMS * @param outputChannel diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIInt.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIInt.java index 1a47f89..6118ae7 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIInt.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIInt.java @@ -118,7 +118,7 @@ public OOCSIInt timeout(int timeoutMS) { } /** - * set the limiting of incoming events in terms of and timeframe; supports chained invocation + * set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation * * @param rate * @param seconds @@ -193,7 +193,7 @@ public OOCSIInt generator(long periodMS) { /** * creates a periodic feedback loop that feed either the last input value or the reference value into the variable * (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - * addition, the new value of the variable is sent out to the channel with the given key + * addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey" * * @param periodMS * @param outputChannel diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSILong.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSILong.java index efe6623..f534269 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSILong.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSILong.java @@ -114,7 +114,7 @@ public OOCSILong timeout(int timeoutMS) { } /** - * set the limiting of incoming events in terms of and timeframe; supports chained invocation + * set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation * * @param rate * @param seconds @@ -189,7 +189,7 @@ public OOCSILong generator(long periodMS) { /** * creates a periodic feedback loop that feed either the last input value or the reference value into the variable * (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - * addition, the new value of the variable is sent out to the channel with the given key + * addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey" * * @param periodMS * @param outputChannel diff --git a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIString.java b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIString.java index de0f895..d0f68db 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/OOCSIString.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/OOCSIString.java @@ -26,7 +26,7 @@ public OOCSIString(OOCSIClient client, String channelName, String key, String re } /** - * set the limiting of incoming events in terms of and timeframe; supports chained invocation + * set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation * * @param rate * @param seconds diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/OOCSIClient.java b/dist/oocsi/src/nl/tue/id/oocsi/client/OOCSIClient.java index ee1e38a..bc7cde2 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/OOCSIClient.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/OOCSIClient.java @@ -16,7 +16,7 @@ */ public class OOCSIClient { - public static final String VERSION = "1.3.6"; + public static final String VERSION = "1.3.7"; private SocketClient sc; protected String name; @@ -46,8 +46,9 @@ public OOCSIClient(String name) { // check oocsi name if (name.contains(" ")) { - log("OOCSI name cannot contain spaces"); - System.exit(-1); + log("[ERROR] OOCSI name cannot contain spaces"); + log(" - OOCSI connection aborted"); + return; } this.name = name; @@ -172,7 +173,7 @@ public void register(OOCSICall call) { } /** - * register a responder with the socket client with a given handle + * register a responder with the socket client with a given handle "callName" * * @param callName * @param responder @@ -183,6 +184,19 @@ public void register(String callName, Responder responder) { sc.register(callName, responder); } + /** + * register a responder with the socket client with a given handle "callName" on channel "channelName" + * + * @param channelName + * @param callName + * @param responder + */ + public void register(String channelName, String callName, Responder responder) { + responder.setCallName(callName); + sc.subscribe(channelName, responder); + sc.register(callName, responder); + } + /** * send a string message to the channel with the given name * diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/behavior/OOCSISpatial.java b/dist/oocsi/src/nl/tue/id/oocsi/client/behavior/OOCSISpatial.java index d283c2f..7dc00d0 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/behavior/OOCSISpatial.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/behavior/OOCSISpatial.java @@ -50,8 +50,7 @@ public class OOCSISpatial extends OOCSISystemCommunicator { * @param client * @param channelName * @param key - * @param myPosition - * @param neighbourThreshold + * @param neighborDistance */ public OOCSISpatial(OOCSIClient client, String channelName, String key, Position neighborDistance) { this(client, channelName, key, (int) (Math.random() * REBALANCING_TIMEOUT), null); diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/data/OOCSIVariable.java b/dist/oocsi/src/nl/tue/id/oocsi/client/data/OOCSIVariable.java index 3fe9c86..0bdf773 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/data/OOCSIVariable.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/data/OOCSIVariable.java @@ -34,10 +34,10 @@ public class OOCSIVariable extends OOCSISystemCommunicator { // key of internal variable in the OOCSI network private String key; - // reference or default value for variable in case nothing has been received for milliseconds + // reference or default value for variable in case nothing has been received for "timeout" milliseconds private T internalReference; - // amount of milliseconds to wait until the reference value is applied to + // amount of milliseconds to wait until the reference value is applied to "internalVariable" private int timeout; // last time the variable was updated @@ -338,7 +338,7 @@ public OOCSIVariable timeout(int timeoutMS) { } /** - * set the limiting of incoming events in terms of and timeframe; supports chained invocation + * set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation * * @param rate * @param seconds @@ -379,7 +379,6 @@ public OOCSIVariable max(T max) { * during operation, however, this will reset the buffer); supports chained invocation * * @param windowLength - * @param sigma * @return */ public OOCSIVariable smooth(int windowLength) { @@ -417,7 +416,7 @@ public OOCSIVariable generator(long periodMS) { /** * creates a periodic feedback loop that feed either the last input value or the reference value into the variable * (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In - * addition, the new value of the variable is sent out to the channel with the given key + * addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey" * * @param periodMS * @param outputChannel diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/Handler.java b/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/Handler.java index de7359c..615efdb 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/Handler.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/Handler.java @@ -51,7 +51,7 @@ abstract public void receive(String sender, Map data, long times String recipient); /** - * parse the given String into a Map + * parse the given "data" String into a Map * * @param data * @return @@ -69,7 +69,7 @@ public static Map parseData(String data) throws IOException, Cla } /** - * parse the given String into a long value + * parse the given "timestamp" String into a long value * * @param timestamp * @return diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.java b/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.java index 7ec5642..8434614 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedClientEventHandler.java @@ -4,7 +4,7 @@ import java.util.Map; /** - * rate limited event handler for events with structured data that will only let through events per + * rate limited event handler for events with structured data that will only let through "rate" events per "second" * secs; this counts for all incoming events per sender which protects against single senders overloading the system * * @author matsfunk @@ -15,7 +15,7 @@ abstract public class RateLimitedClientEventHandler extends RateLimitedEventHand private Map counter = new HashMap(100); /** - * creates a rate limited event handler that will at most let through event per secs + * creates a rate limited event handler that will at most let through "rate" event per "second" secs * * @param rate * @param seconds diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.java b/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.java index 76f4384..36d5889 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/protocol/RateLimitedEventHandler.java @@ -3,7 +3,7 @@ import java.util.Map; /** - * rate limited event handler for events with structured data that will only let through events per + * rate limited event handler for events with structured data that will only let through "rate" events per "second" * secs; this counts for all incoming events * * @author matsfunk @@ -21,7 +21,7 @@ abstract public class RateLimitedEventHandler extends EventHandler { private int counter = 0; /** - * creates a rate limited event handler that will at most let through event per secs + * creates a rate limited event handler that will at most let through "rate" event per "second" secs * * @param rate * @param seconds @@ -85,7 +85,7 @@ public void exceeded(String sender, Map data, long timestamp, St } /** - * reconfigure the rate limitation to different and timeframe + * reconfigure the rate limitation to different "rate" and "seconds" timeframe * * @param rate * @param seconds diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/services/OOCSICall.java b/dist/oocsi/src/nl/tue/id/oocsi/client/services/OOCSICall.java index 4958823..590339a 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/services/OOCSICall.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/services/OOCSICall.java @@ -27,7 +27,7 @@ enum CALL_MODE { private OOCSIEvent response = null; /** - * create a new message to the channel + * create a new message to the channel "channelName" * * @param oocsi * @param callName @@ -39,7 +39,7 @@ public OOCSICall(OOCSIClient oocsi, String callName, int timeoutMS, int maxRespo } /** - * create a new message to the channel + * create a new message to the channel "channelName" * * @param oocsi * @param channelName diff --git a/dist/oocsi/src/nl/tue/id/oocsi/client/socket/SocketClient.java b/dist/oocsi/src/nl/tue/id/oocsi/client/socket/SocketClient.java index ce79f7a..8fee43f 100644 --- a/dist/oocsi/src/nl/tue/id/oocsi/client/socket/SocketClient.java +++ b/dist/oocsi/src/nl/tue/id/oocsi/client/socket/SocketClient.java @@ -41,21 +41,28 @@ public class SocketClient { private static final int MULTICAST_PORT = 4448; private static final String MULTICAST_GROUP = "224.0.0.144"; + private String hostname; + private int port; private String name; + private Map channels; private Map services; private Queue tempIncomingMessages = new LinkedBlockingQueue(1); private List openCalls = new LinkedList(); + // i/o private Socket socket; private BufferedReader input; private PrintWriter output; + + // connection flags private boolean disconnected = false; private boolean hasPrintedServerInfo = false; private boolean connectionEstablished = false; private boolean reconnect = false; private int reconnectCountDown = 100; + // thread pool private ExecutorService executor; /** @@ -72,6 +79,11 @@ public SocketClient(String name, Map channels, Map 0)) { - result = connectAttempt(hostname, port); - if (result) { - reconnectCountDown = 100; - break; - } else { - sleep(1000); - } + + // store the connection details + this.hostname = hostname; + this.port = port; + + // start connection thread + executor.submit(new SocketClientRunnable()); + + // check back on connection progress + while (!disconnected && !connectionEstablished && reconnectCountDown > 0) { + sleep(100); } - return result; + // return connection status + return connectionEstablished; } /** @@ -164,8 +168,9 @@ public boolean connect(final String hostname, final int port) { * @param hostname * @param port * @return + * @throws OOCSIAuthenticationException */ - private boolean connectAttempt(final String hostname, final int port) { + private boolean connectAttempt(final String hostname, final int port) throws OOCSIAuthenticationException { try { // configure and connect socket connectSocket(hostname, port); @@ -197,23 +202,35 @@ private boolean connectAttempt(final String hostname, final int port) { } /** + * connection handshake after the socket connection has been established + * * @param hostname * @param port * @return * @throws IOException + * @throws OOCSIAuthenticationException */ - private boolean connectionHandshake(final String hostname, final int port) throws IOException { + private boolean connectionHandshake(final String hostname, final int port) + throws IOException, OOCSIAuthenticationException { + // short timeout when connecting + socket.setSoTimeout(5000); + // check if we are ok to connect String serverWelcomeMessage; if (!socket.isClosed() && (serverWelcomeMessage = input.readLine()) != null) { + // name is not ok if (!serverWelcomeMessage.startsWith("welcome")) { disconnect(); log(" - disconnected (client name not accepted)"); - return false; - } else { - log(" - connected successfully"); + throw new OOCSIAuthenticationException(); } + // name is ok + log(" - connected successfully"); + + // longer timeout after successful connection + socket.setSoTimeout(20000); + // first data has arrived = connection is ok connectionEstablished = true; @@ -222,16 +239,16 @@ private boolean connectionHandshake(final String hostname, final int port) throw this.internalSubscribe(channelName); } - // if ok, run the communication in a different thread - executor.submit(new SocketClientRunnable(hostname, port)); + reconnectCountDown = 0; + return true; } reconnectCountDown = 0; - return true; + return false; } /** - * connect a socket + * configure and connect a socket * * @param hostname * @param port @@ -239,6 +256,8 @@ private boolean connectionHandshake(final String hostname, final int port) throw * @throws IOException */ private void connectSocket(final String hostname, final int port) throws SocketException, IOException { + + // open and configure socket socket = new Socket(); socket.setTcpNoDelay(true); socket.setTrafficClass(0x10); @@ -251,6 +270,7 @@ private void connectSocket(final String hostname, final int port) throws SocketE /** * print server hint once + * */ private void printServerInfo() { if (!hasPrintedServerInfo) { @@ -289,8 +309,10 @@ public String getName() { * */ public void disconnect() { - // disconnect from server with handshake and no reconnect + // disconnect from server with handshake disconnected = true; + + // and no reconnect reconnect = false; reconnectCountDown = 0; @@ -318,18 +340,17 @@ public void kill() { */ public void reconnect() { output.println("quit"); - internalDisconnect(); log(" - disconnected (by reconnect)"); } /** - * close all resources safely + * close all i/o resources safely * */ private void internalDisconnect() { - // shutdown IO + // shutdown I/O try { if (output != null) { output.close(); @@ -341,9 +362,9 @@ private void internalDisconnect() { socket.close(); } } catch (IOException e) { - e.printStackTrace(); + // do nothing } catch (NullPointerException e) { - e.printStackTrace(); + // do nothing } } @@ -487,7 +508,7 @@ public void register(OOCSICall call) { } /** - * register a responder with a handle + * register a responder with a handle "callName" * * @param callName * @param responder @@ -611,6 +632,19 @@ private String serialize(Map data) { } } + /** + * let thread sleep for ms milliseconds + * + */ + private void sleep(int ms) { + try { + // so, wait a bit before next trial + Thread.sleep(ms); + } catch (InterruptedException e) { + // do nothing + } + } + /** * logging of message on console (can be overridden by subclass) */ @@ -618,45 +652,85 @@ public void log(String message) { // no logging by default } + /** + * communication handler (to be run in a separate thread) + * + */ class SocketClientRunnable implements Runnable { - private String hostname; - private int port; + public SocketClientRunnable() { + // TODO Auto-generated constructor stub + } - /** - * - * - * @param hostname - * @param port - */ - public SocketClientRunnable(String hostname, int port) { - this.hostname = hostname; - this.port = port; + @Override + public void run() { + try { + int connections = 0; + + // SESSIONS + // only do if we either always reconnect, or it's the first connection + while (reconnect || connections == 0) { + connections++; + + // ATTEMPTS + // try 100 times per (re-)connection attempt + reconnectCountDown = 100; + while (reconnectCountDown-- > 0) { + // try to connect + if (connectAttempt(hostname, port)) { + // connection is fine, stop trials + break; + } + + // another trial, sleep before + sleep(1000); + } + + if (isConnected()) { + // connection rest forever + runCommunication(); + } else { + // take a rest before trying again + sleep(5000); + } + } + } catch (OOCSIAuthenticationException oae) { + disconnect(); + // quit this thread... + } } - /* - * (non-Javadoc) + /** + * all communications after the initial handshake happen here * - * @see java.lang.Runnable#run() */ - public void run() { + private void runCommunication() { try { String fromServer; - while (!socket.isClosed() && (fromServer = input.readLine()) != null) { - handleMessage(fromServer); - } + int cyclesSinceRead = 0; + while (!socket.isClosed()) { - } catch (IOException e) { - // do nothing - } finally { - internalDisconnect(); - log(" - OOCSI disconnected " - + (!connectionEstablished ? "(client name not accepted)" : "(server unavailable)")); + // main messaging loop + while (input.ready() && (fromServer = input.readLine()) != null) { + handleMessage(fromServer); + cyclesSinceRead = 0; + } - sleep(200); + // sleep if there is nothing to read + sleep(1); - // try reconnect - connect(hostname, port); + // if no data came in for 20 secs, kill connection and reconnect + if (cyclesSinceRead++ > 20000) { + internalDisconnect(); + log(" - OOCSI disconnected (application level timeout)"); + break; + } + } + } catch (Exception e) { + internalDisconnect(); + if (connectionEstablished) { + log(" - OOCSI disconnected (server unavailable)"); + } } } @@ -702,15 +776,21 @@ public void handleMessage(String fromServer) throws IOException { * @param c */ private void handleData(final String channel, final String data, final String timestamp, final String sender, - Handler c) { + final Handler c) { + // try to parse the data Map dataMap = parseData(data); if (dataMap != null) { handleMappedData(channel, data, timestamp, sender, c, dataMap); } + // if dataMap not parseable and channel ready else if (c != null) { - c.send(sender, data, timestamp, channel, name); + executor.submit(new Runnable() { + public void run() { + c.send(sender, data, timestamp, channel, name); + } + }); } } @@ -725,7 +805,7 @@ else if (c != null) { * @param dataMap */ private void handleMappedData(final String channel, final String data, final String timestamp, - final String sender, Handler c, Map dataMap) { + final String sender, final Handler c, final Map dataMap) { // try to find a responder if (dataMap.containsKey(OOCSICall.MESSAGE_HANDLE)) { final Responder r = services.get((String) dataMap.get(OOCSICall.MESSAGE_HANDLE)); @@ -736,7 +816,9 @@ public void run() { r.receive(sender, Handler.parseData(data), Handler.parseTimestamp(timestamp), channel, name); } catch (ClassNotFoundException e) { + // nothing } catch (Exception e) { + // nothing } } }); @@ -750,11 +832,15 @@ public void run() { // walk from back to allow for removal for (int i = openCalls.size() - 1; i >= 0; i--) { - OOCSICall call = openCalls.get(i); + final OOCSICall call = openCalls.get(i); if (!call.isValid()) { openCalls.remove(i); } else if (call.getId().equals(id)) { - call.respond(dataMap); + executor.submit(new Runnable() { + public void run() { + call.respond(dataMap); + } + }); break; } } @@ -763,11 +849,18 @@ public void run() { // if no responder or call and channel ready waiting if (c != null) { - c.send(sender, data, timestamp, channel, name); + executor.submit(new Runnable() { + public void run() { + c.send(sender, data, timestamp, channel, name); + } + }); } + } /** + * parse the message data + * * @param data * @return */ @@ -783,4 +876,10 @@ private Map parseData(String data) { return dataMap; } } + + class OOCSIAuthenticationException extends Exception { + + private static final long serialVersionUID = 5074228098705122200L; + + } } diff --git a/src/nl/tue/id/oocsi/OOCSI.java b/src/nl/tue/id/oocsi/OOCSI.java index be5d9be..19ddb69 100644 --- a/src/nl/tue/id/oocsi/OOCSI.java +++ b/src/nl/tue/id/oocsi/OOCSI.java @@ -109,7 +109,7 @@ private OOCSI(Object parent, OOCSICommunicator communicator) { } /** - * create a new OOCSI network connection with client handle (), server host, and port + * create a new OOCSI network connection with client handle ("name"), server host, and port * * @param parent * @param name @@ -221,6 +221,14 @@ public boolean isConnected() { return oocsi.isConnected(); } + /** + * disconnect this client from the OOCSI network + * + */ + public void disconnect() { + oocsi.disconnect(); + } + /** * send data through a channel given by the channelName * @@ -232,7 +240,7 @@ public OOCSIMessage channel(String channelName) { } /** - * create a call for service method + * create a call for service method "callName" * * @param callName * @return @@ -242,7 +250,18 @@ public OOCSICall call(String callName) { } /** - * create a call for service method + * create a call for service method "callName" on channel "channelName" + * + * @param channelName + * @param callName + * @return + */ + public OOCSICall call(String channelName, String callName) { + return oocsi.call(channelName, callName); + } + + /** + * create a call for service method "callName" with a specific timeout * * @param callName * @param timeoutMS @@ -253,7 +272,19 @@ public OOCSICall call(String callName, int timeoutMS) { } /** - * create a call for service method + * create a call for service method "callName" with a specific timeout on channel "channelName" + * + * @param channelName + * @param callName + * @param timeoutMS + * @return + */ + public OOCSICall call(String channelName, String callName, int timeoutMS) { + return oocsi.call(channelName, callName, timeoutMS); + } + + /** + * create a call for service method "callName" with a specific timeout * * @param callName * @param timeoutMS @@ -264,6 +295,19 @@ public OOCSICall call(String callName, int timeoutMS, int maxResponses) { return oocsi.call(callName, timeoutMS, maxResponses); } + /** + * create a call for service method "callName" with a specific timeout on channel "channelName" + * + * @param channelName + * @param callName + * @param timeoutMS + * @param maxResponses + * @return + */ + public OOCSICall call(String channelName, String callName, int timeoutMS, int maxResponses) { + return oocsi.call(channelName, callName, timeoutMS, maxResponses); + } + /** * send raw data to given channel * @@ -289,7 +333,7 @@ public void subscribe(String channelName) { } /** - * subscribe to a channel with a given handler method name + * subscribe to a channel with a given handler method name "handlerName" * * @param channelName * @param handlerName @@ -304,8 +348,8 @@ public void subscribe(String channelName, String handlerName) { } /** - * subscribe to a channel with a given handler method name ; limits the rate of incoming events to - * events per secs + * subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + * "rate" events per "seconds" secs * * @param channelName * @param handlerName @@ -322,8 +366,8 @@ public void subscribe(String channelName, String handlerName, int rate, int seco } /** - * subscribe to a channel with a given handler method name ; limits the rate of incoming events to - * events per secs; controls whether we limit the rate of incoming event per sender + * subscribe to a channel with a given handler method name "handlerName"; limits the rate of incoming events to + * "rate" events per "seconds" secs; "ratePerSender" controls whether we limit the rate of incoming event per sender * or for all events coming in from all senders * * @param channelName @@ -356,7 +400,8 @@ public void register(String responderName) { } /** - * register a responder; requires a method with the given responderName with parameters (OOCSIEvent, OOCSIData) + * register a responder "responderName"; requires a method with the given name "responderName" with parameters + * (OOCSIEvent, OOCSIData) * * @param responderName * @param responderFunctionName @@ -370,6 +415,39 @@ public void register(String responderName, String responderFunctionName) { oocsi.register(responderName, responderFunctionName); } + /** + * register a responder "responderName" on channel "channelName"; requires a method with the responder name + * "responderName" with parameters (OOCSIEvent, OOCSIData) + * + * @param channelName + * @param responderName + */ + public void registerChannel(String channelName, String responderName) { + + if (!oocsi.isConnected()) { + return; + } + + oocsi.registerChannel(channelName, responderName); + } + + /** + * register a responder "responderName" on channel "channelName"; requires a method with the given name + * "responderName" with parameters (OOCSIEvent, OOCSIData) + * + * @param channelName + * @param responderName + * @param responderFunctionName + */ + public void registerChannel(String channelName, String responderName, String responderFunctionName) { + + if (!oocsi.isConnected()) { + return; + } + + oocsi.registerChannel(channelName, responderName, responderFunctionName); + } + /** * retrieve the list of clients on the server *