public class RemoteUAAL extends UAAL
Modifier and Type | Class and Description |
---|---|
class |
RemoteUAAL.CListener
Custom ICListener to be used in the sendC() method of the Utility API.
|
class |
RemoteUAAL.SListener
Custom ISListener to be used in the callS() method of the Utility API.
|
Constructor and Description |
---|
RemoteUAAL(ModuleContext context,
String node,
String remote,
String key)
Basic constructor.
|
Modifier and Type | Method and Description |
---|---|
ICListener |
createCListener(String uri)
Use this method to create a Listener to be used in the sendC() method of
the Utility API, instead of creating it ex profeso.
|
ISListener |
createSListener(String uri)
Use this method to create a Listener to be used in the callS() method of
the Utility API, instead of creating it ex profeso.
|
List<String> |
getCEPsList()
Get the list of context event patterns of subscribers registered so far.
|
String |
getKey()
Get the client remote node encryption key to use for GCM
|
String |
getRemoteID()
Get the client remote node endpoint information.
|
List<String> |
getSProfilesList()
Get the list of service profiles of callees registered so far.
|
boolean |
isPatternAdded(String uri) |
boolean |
isProfileAdded(String uri) |
void |
provideS(ServiceProfile[] p,
ISListener l)
Registers Service Profiles and specifies how the calls to these profiles
would be handled.
|
void |
setRemoteID(String remote,
String key)
Set the client remote node endpoint information.
|
void |
subscribeC(ContextEventPattern[] p,
ICListener l)
Subscribes for Context Events and specifies how the events would be
handled.
|
void |
terminate()
Closes all universAAL wrapper classes created by this universAAL helper until now (by
calling their
.close() method) and eliminates them. |
public RemoteUAAL(ModuleContext context, String node, String remote, String key)
context
- The universAAL contextnode
- The client remote node unique identifierremote
- The client remote node endpoint information.key
- encryption key to use for GCM, or null if it does not applypublic List<String> getCEPsList()
public List<String> getSProfilesList()
public void subscribeC(ContextEventPattern[] p, ICListener l)
UAAL
universAAL helper automatically creates a new own internal Context Subscriber
each time this method is called. An implementation of ICListener
must be passed that will handle the reception of an event that matches
the passed patterns. The listener is associated to the patterns: All
events that match the patterns are received by the listener (regardless
of any other calls to this method). The listener remains active and
associated to the patterns until terminate()
is called.
Since every call to this method creates a new subscriber, you should be
careful with how many times you call this method. Usually, a limited
number of subscriptions is needed. Remember that you can combine
different patterns to be handled by a single listener.
Remember that the simplified API in this library (
org.universAAL.utilities.api.context
packages) can assist
you in creating Context Event Patterns.
subscribeC
in class UAAL
p
- An array of Context Event Patterns describing the Context
Events that will be handled by the listener.l
- The listener that will handle the received event that matches
the patterns.Pattern
public boolean isPatternAdded(String uri)
public void provideS(ServiceProfile[] p, ISListener l)
UAAL
universAAL helper automatically creates a new own internal Service Callee each
time this method is called. An implementation of ISListener
must
be passed that will handle the call request that matches the provided
profiles. The listener is associated to the profiles: All call requests
that match the profiles are received by the listener (regardless of any
other calls to this method). The listener remains active and associated
to the profiles until terminate()
is called. Since every
call to this method creates a new callee, you should be careful with how
many times you call this method. Usually, a limited number of callees is
needed.
Remember that the simplified API in this library (
org.universAAL.utilities.api.service
packages) can assist
you in creating Service Profiles.
public boolean isProfileAdded(String uri)
public void terminate()
UAAL
.close()
method) and eliminates them. The
reference to the Module Context is maintained, however. This allows to
perform new calls to the universAAL features methods, which will create new
universAAL wrappers in the helper.public String getRemoteID()
public String getKey()
public void setRemoteID(String remote, String key)
remote
- endpoint.key
- encryption key to use for GCM, or null if it does not applypublic ICListener createCListener(String uri)
uri
- The URI of the context event pattern being used for this
listenerpublic ISListener createSListener(String uri)
uri
- The URI of the service profile being used for this listenerCopyright © 2018 universAAL Consortium. All rights reserved.