public class ALMemory extends ALMemoryHelper
Modifier and Type | Method and Description |
---|---|
void |
addMapping(java.lang.String service,
java.util.Map<java.lang.String,java.lang.String> signalEvent)
Add a mapping between signal and event
|
void |
addMapping(java.lang.String service,
java.lang.String signal,
java.lang.String event)
Add a mapping between signal and event
|
void |
clearStats() |
void |
declareEvent(java.lang.String eventName)
Declares an event to allow future subscriptions to the event
|
void |
declareEvent(java.lang.String eventName,
java.lang.String extractorName)
Declares an event to allow future subscriptions to the event
|
void |
exit()
Exits and unregisters the module.
|
java.lang.String |
getBrokerName()
Gets the name of the parent broker.
|
java.lang.Object |
getData(java.lang.String key)
Gets the value of a key-value pair stored in memory
|
java.lang.Object |
getData(java.lang.String key,
java.lang.Integer deprecatedParameter)
DEPRECATED - Gets the value of a key-value pair stored in memory.
|
java.util.List<java.lang.String> |
getDataList(java.lang.String filter)
Gets a list of all key names that contain a given string
|
java.util.List<java.lang.String> |
getDataListName()
Gets the key names for all the key-value pairs in memory
|
java.lang.Object |
getDataOnChange(java.lang.String key,
java.lang.Integer deprecatedParameter)
DEPRECATED - Blocks the caller until the value of a key changes
|
java.lang.Object |
getDataPtr(java.lang.String key)
Gets a pointer to 32 a bit data item.
|
java.lang.Object |
getDescriptionList(java.util.List<java.lang.String> keylist)
Descriptions of all given keys
|
java.lang.Object |
getEventHistory(java.lang.String key)
Get data value and timestamp
|
java.util.List<java.lang.String> |
getEventList()
Gets a list containing the names of all the declared events
|
java.util.List<java.lang.String> |
getExtractorEvent(java.lang.String extractorName)
Gets the list of all events generated by a given extractor
|
java.lang.Object |
getListData(java.lang.Object keyList)
Gets the values associated with the given list of keys.
|
java.lang.Object |
getMethodHelp(java.lang.String methodName)
Retrieves a method's description.
|
java.util.List<java.lang.String> |
getMethodList()
Retrieves the module's method list.
|
java.util.List<java.lang.String> |
getMicroEventList()
Gets a list containing the names of all the declared micro events
|
java.lang.Object |
getModuleHelp()
Retrieves the module's description.
|
java.util.List<java.lang.String> |
getSubscribers(java.lang.String name)
Gets a list containing the names of subscribers to an event.
|
java.lang.Object |
getTimestamp(java.lang.String key)
Get data value and timestamp
|
java.lang.String |
getType(java.lang.String key)
Gets the storage class of the stored data.
|
java.lang.String |
getUsage(java.lang.String name)
Gets the method usage string.
|
void |
insertData(java.lang.String key,
java.lang.Float value)
Inserts a key-value pair into memory, where value is a float
|
void |
insertData(java.lang.String key,
java.lang.Integer value)
Inserts a key-value pair into memory, where value is an int
|
void |
insertData(java.lang.String key,
java.lang.Object data)
Inserts a key-value pair into memory, where value is an ALValue
|
void |
insertData(java.lang.String key,
java.lang.String value)
Inserts a key-value pair into memory, where value is a string
|
void |
insertListData(java.lang.Object list)
Inserts a list of key-value pairs into memory.
|
java.lang.Boolean |
isRunning(java.lang.Integer id)
Returns true if the method is currently running.
|
java.lang.Boolean |
isStatsEnabled() |
java.lang.Boolean |
isTraceEnabled() |
java.lang.Boolean |
ping()
Just a ping.
|
void |
raiseEvent(java.lang.String name,
java.lang.Object value)
Publishes the given data to all subscribers.
|
void |
raiseMicroEvent(java.lang.String name,
java.lang.Object value)
Publishes the given data to all subscribers.
|
void |
removeData(java.lang.String key)
Removes a key-value pair from memory
|
void |
removeEvent(java.lang.String name)
Removes a event from memory and unsubscribes any exiting subscribers.
|
void |
removeMicroEvent(java.lang.String name)
Removes a micro event from memory and unsubscribes any exiting subscribers.
|
void |
setDescription(java.lang.String name,
java.lang.String description)
Describe a key
|
void |
stop(java.lang.Integer id)
returns true if the method is currently running
|
AnyObject |
subscriber(java.lang.String eventName)
Get an object wrapping a signal bound to the given ALMemory event.
|
void |
subscribeToEvent(java.lang.String name,
java.lang.String callbackModule,
java.lang.String callbackMethod)
Subscribes to an event and automaticaly launches the module that declared itself as the generator of the event if required.
|
void |
subscribeToEvent(java.lang.String name,
java.lang.String callbackModule,
java.lang.String callbackMessage,
java.lang.String callbacMethod)
DEPRECATED Subscribes to event and automaticaly launches the module capable of generating the event if it is not already running.
|
void |
subscribeToMicroEvent(java.lang.String name,
java.lang.String callbackModule,
java.lang.String callbackMessage,
java.lang.String callbackMethod)
Subscribes to a microEvent.
|
void |
unregisterModuleReference(java.lang.String moduleName)
Informs ALMemory that a module doesn't exist anymore.
|
void |
unsubscribeToEvent(java.lang.String name,
java.lang.String callbackModule)
Unsubscribes a module from the given event.
|
void |
unsubscribeToMicroEvent(java.lang.String name,
java.lang.String callbackModule)
Unsubscribes from the given event.
|
java.lang.String |
version()
Returns the version of the module.
|
java.lang.Boolean |
wait(java.lang.Integer id,
java.lang.Integer timeoutPeriod)
Wait for the end of a long running method that was called using 'post'
|
subscribeToEvent, subscribeToEvent, unsubscribeAllEvents, unsubscribeToEvent
call, connect, connect, disconnect, getNaoqiType, getService, isProxyReady, setService
public ALMemory(Session session) throws java.lang.Exception
java.lang.Exception
public void insertData(java.lang.String key, java.lang.String value) throws CallError, java.lang.InterruptedException
key
- Name of the value to be inserted.value
- The string to be insertedCallError
java.lang.InterruptedException
public void removeData(java.lang.String key) throws CallError, java.lang.InterruptedException
key
- Name of the data to be removed.CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getSubscribers(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- Name of the event or micro-eventCallError
java.lang.InterruptedException
public void removeMicroEvent(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- Name of the event to remove.CallError
java.lang.InterruptedException
public void subscribeToEvent(java.lang.String name, java.lang.String callbackModule, java.lang.String callbackMethod) throws CallError, java.lang.InterruptedException
name
- The name of the event to subscribe tocallbackModule
- Name of the module to call with notificationscallbackMethod
- Name of the module's method to call when a data is changedCallError
java.lang.InterruptedException
public void insertData(java.lang.String key, java.lang.Integer value) throws CallError, java.lang.InterruptedException
key
- Name of the value to be inserted.value
- The int to be insertedCallError
java.lang.InterruptedException
public void subscribeToMicroEvent(java.lang.String name, java.lang.String callbackModule, java.lang.String callbackMessage, java.lang.String callbackMethod) throws CallError, java.lang.InterruptedException
name
- Name of the data.callbackModule
- Name of the module to call with notificationscallbackMessage
- Message included in the notification. This can be used to disambiguate multiple subscriptions.callbackMethod
- Name of the module's method to call when a data is changedCallError
java.lang.InterruptedException
public void unregisterModuleReference(java.lang.String moduleName) throws CallError, java.lang.InterruptedException
moduleName
- Name of the departing module.CallError
java.lang.InterruptedException
public void unsubscribeToEvent(java.lang.String name, java.lang.String callbackModule) throws CallError, java.lang.InterruptedException
name
- The name of the eventcallbackModule
- The name of the module that was given when subscribing.CallError
java.lang.InterruptedException
public void unsubscribeToMicroEvent(java.lang.String name, java.lang.String callbackModule) throws CallError, java.lang.InterruptedException
name
- Name of the event.callbackModule
- The name of the module that was given when subscribing.CallError
java.lang.InterruptedException
public void insertData(java.lang.String key, java.lang.Float value) throws CallError, java.lang.InterruptedException
key
- Name of the value to be inserted.value
- The float to be insertedCallError
java.lang.InterruptedException
public void setDescription(java.lang.String name, java.lang.String description) throws CallError, java.lang.InterruptedException
name
- Name of the key.description
- The description of the event (text format).CallError
java.lang.InterruptedException
public java.lang.Object getDescriptionList(java.util.List<java.lang.String> keylist) throws CallError, java.lang.InterruptedException
keylist
- List of keys. (empty to get all descriptions)CallError
java.lang.InterruptedException
public void addMapping(java.lang.String service, java.lang.String signal, java.lang.String event) throws CallError, java.lang.InterruptedException
service
- Name of the servicesignal
- Name of the signalevent
- Name of the eventCallError
java.lang.InterruptedException
public void addMapping(java.lang.String service, java.util.Map<java.lang.String,java.lang.String> signalEvent) throws CallError, java.lang.InterruptedException
service
- Name of the servicesignalEvent
- A map of signal corresponding to eventCallError
java.lang.InterruptedException
public void insertData(java.lang.String key, java.lang.Object data) throws CallError, java.lang.InterruptedException
key
- Name of the value to be inserted.data
- The ALValue to be inserted. This could contain a basic type, or a more complex array. See the ALValue documentation for more information.CallError
java.lang.InterruptedException
public void insertListData(java.lang.Object list) throws CallError, java.lang.InterruptedException
list
- An ALValue list of the form [[Key, Value],...]. Each item will be inserted.CallError
java.lang.InterruptedException
public java.lang.String getType(java.lang.String key) throws CallError, java.lang.InterruptedException
key
- Name of the variableCallError
java.lang.InterruptedException
public void raiseEvent(java.lang.String name, java.lang.Object value) throws CallError, java.lang.InterruptedException
name
- Name of the event to raise.value
- The data associated with the event. This could contain a basic type, or a more complex array. See the ALValue documentation for more information.CallError
java.lang.InterruptedException
public void raiseMicroEvent(java.lang.String name, java.lang.Object value) throws CallError, java.lang.InterruptedException
name
- Name of the event to raise.value
- The data associated with the event. This could contain a basic type, or a more complex array. See the ALValue documentation for more information.CallError
java.lang.InterruptedException
public void removeEvent(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- Name of the event to remove.CallError
java.lang.InterruptedException
public void subscribeToEvent(java.lang.String name, java.lang.String callbackModule, java.lang.String callbackMessage, java.lang.String callbacMethod) throws CallError, java.lang.InterruptedException
name
- The name of the event to subscribe tocallbackModule
- Name of the module to call with notificationscallbackMessage
- DEPRECATED Message included in the notification.callbacMethod
- Name of the module's method to call when a data is changedCallError
java.lang.InterruptedException
public java.lang.Boolean isStatsEnabled() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void clearStats() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isTraceEnabled() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void exit() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.String version() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean ping() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getMethodList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Object getMethodHelp(java.lang.String methodName) throws CallError, java.lang.InterruptedException
methodName
- The name of the method.CallError
java.lang.InterruptedException
public java.lang.Object getModuleHelp() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean wait(java.lang.Integer id, java.lang.Integer timeoutPeriod) throws CallError, java.lang.InterruptedException
id
- The ID of the method that was returned when calling the method using 'post'timeoutPeriod
- The timeout period in ms. To wait indefinately, use a timeoutPeriod of zero.CallError
java.lang.InterruptedException
public java.lang.Boolean isRunning(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- The ID of the method that was returned when calling the method using 'post'CallError
java.lang.InterruptedException
public void stop(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- the ID of the method to wait forCallError
java.lang.InterruptedException
public java.lang.String getBrokerName() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.String getUsage(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- The name of the method.CallError
java.lang.InterruptedException
public void declareEvent(java.lang.String eventName) throws CallError, java.lang.InterruptedException
eventName
- The name of the eventCallError
java.lang.InterruptedException
public void declareEvent(java.lang.String eventName, java.lang.String extractorName) throws CallError, java.lang.InterruptedException
eventName
- The name of the eventextractorName
- The name of the extractor capable of creating the eventCallError
java.lang.InterruptedException
public java.lang.Object getData(java.lang.String key) throws CallError, java.lang.InterruptedException
key
- Name of the value.CallError
java.lang.InterruptedException
public java.lang.Object getData(java.lang.String key, java.lang.Integer deprecatedParameter) throws CallError, java.lang.InterruptedException
key
- Name of the value.deprecatedParameter
- DEPRECATED - This parameter has no effect, but is left for compatibility reason.CallError
java.lang.InterruptedException
public AnyObject subscriber(java.lang.String eventName) throws CallError, java.lang.InterruptedException
subscriber
in class ALMemoryHelper
eventName
- Name of the ALMemory eventCallError
java.lang.InterruptedException
public java.lang.Object getTimestamp(java.lang.String key) throws CallError, java.lang.InterruptedException
key
- Name of the variableCallError
java.lang.InterruptedException
public java.lang.Object getEventHistory(java.lang.String key) throws CallError, java.lang.InterruptedException
key
- Name of the variableCallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getDataList(java.lang.String filter) throws CallError, java.lang.InterruptedException
filter
- A string used as the search termCallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getDataListName() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Object getDataOnChange(java.lang.String key, java.lang.Integer deprecatedParameter) throws CallError, java.lang.InterruptedException
key
- Name of the data.deprecatedParameter
- DEPRECATED - this parameter has no effectCallError
java.lang.InterruptedException
public java.lang.Object getDataPtr(java.lang.String key) throws CallError, java.lang.InterruptedException
key
- Name of the data.CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getEventList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getExtractorEvent(java.lang.String extractorName) throws CallError, java.lang.InterruptedException
extractorName
- The name of the extractorCallError
java.lang.InterruptedException
public java.lang.Object getListData(java.lang.Object keyList) throws CallError, java.lang.InterruptedException
keyList
- An array containing the key names.CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getMicroEventList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
Aldebaran SDK for Java
Copyright 2006-2015 Aldebaran Robotics. All Rights Reserved.