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, unsubscribeToEventcall, connect, connect, disconnect, getNaoqiType, getService, isProxyReady, setServicepublic ALMemory(Session session) throws java.lang.Exception
java.lang.Exceptionpublic 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 insertedCallErrorjava.lang.InterruptedExceptionpublic void removeData(java.lang.String key)
throws CallError,
java.lang.InterruptedException
key - Name of the data to be removed.CallErrorjava.lang.InterruptedExceptionpublic java.util.List<java.lang.String> getSubscribers(java.lang.String name)
throws CallError,
java.lang.InterruptedException
name - Name of the event or micro-eventCallErrorjava.lang.InterruptedExceptionpublic void removeMicroEvent(java.lang.String name)
throws CallError,
java.lang.InterruptedException
name - Name of the event to remove.CallErrorjava.lang.InterruptedExceptionpublic 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 changedCallErrorjava.lang.InterruptedExceptionpublic 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 insertedCallErrorjava.lang.InterruptedExceptionpublic 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 changedCallErrorjava.lang.InterruptedExceptionpublic void unregisterModuleReference(java.lang.String moduleName)
throws CallError,
java.lang.InterruptedException
moduleName - Name of the departing module.CallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic 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 insertedCallErrorjava.lang.InterruptedExceptionpublic 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).CallErrorjava.lang.InterruptedExceptionpublic 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)CallErrorjava.lang.InterruptedExceptionpublic 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 eventCallErrorjava.lang.InterruptedExceptionpublic 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 eventCallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic java.lang.String getType(java.lang.String key)
throws CallError,
java.lang.InterruptedException
key - Name of the variableCallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic void removeEvent(java.lang.String name)
throws CallError,
java.lang.InterruptedException
name - Name of the event to remove.CallErrorjava.lang.InterruptedExceptionpublic 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 changedCallErrorjava.lang.InterruptedExceptionpublic java.lang.Boolean isStatsEnabled()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic void clearStats()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic java.lang.Boolean isTraceEnabled()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic void exit()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic java.lang.String version()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic java.lang.Boolean ping()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic java.util.List<java.lang.String> getMethodList()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic java.lang.Object getMethodHelp(java.lang.String methodName)
throws CallError,
java.lang.InterruptedException
methodName - The name of the method.CallErrorjava.lang.InterruptedExceptionpublic java.lang.Object getModuleHelp()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic 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'CallErrorjava.lang.InterruptedExceptionpublic void stop(java.lang.Integer id)
throws CallError,
java.lang.InterruptedException
id - the ID of the method to wait forCallErrorjava.lang.InterruptedExceptionpublic java.lang.String getBrokerName()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic java.lang.String getUsage(java.lang.String name)
throws CallError,
java.lang.InterruptedException
name - The name of the method.CallErrorjava.lang.InterruptedExceptionpublic void declareEvent(java.lang.String eventName)
throws CallError,
java.lang.InterruptedException
eventName - The name of the eventCallErrorjava.lang.InterruptedExceptionpublic 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 eventCallErrorjava.lang.InterruptedExceptionpublic java.lang.Object getData(java.lang.String key)
throws CallError,
java.lang.InterruptedException
key - Name of the value.CallErrorjava.lang.InterruptedExceptionpublic 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.CallErrorjava.lang.InterruptedExceptionpublic AnyObject subscriber(java.lang.String eventName) throws CallError, java.lang.InterruptedException
subscriber in class ALMemoryHelpereventName - Name of the ALMemory eventCallErrorjava.lang.InterruptedExceptionpublic java.lang.Object getTimestamp(java.lang.String key)
throws CallError,
java.lang.InterruptedException
key - Name of the variableCallErrorjava.lang.InterruptedExceptionpublic java.lang.Object getEventHistory(java.lang.String key)
throws CallError,
java.lang.InterruptedException
key - Name of the variableCallErrorjava.lang.InterruptedExceptionpublic java.util.List<java.lang.String> getDataList(java.lang.String filter)
throws CallError,
java.lang.InterruptedException
filter - A string used as the search termCallErrorjava.lang.InterruptedExceptionpublic java.util.List<java.lang.String> getDataListName()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic 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 effectCallErrorjava.lang.InterruptedExceptionpublic java.lang.Object getDataPtr(java.lang.String key)
throws CallError,
java.lang.InterruptedException
key - Name of the data.CallErrorjava.lang.InterruptedExceptionpublic java.util.List<java.lang.String> getEventList()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionpublic java.util.List<java.lang.String> getExtractorEvent(java.lang.String extractorName)
throws CallError,
java.lang.InterruptedException
extractorName - The name of the extractorCallErrorjava.lang.InterruptedExceptionpublic java.lang.Object getListData(java.lang.Object keyList)
throws CallError,
java.lang.InterruptedException
keyList - An array containing the key names.CallErrorjava.lang.InterruptedExceptionpublic java.util.List<java.lang.String> getMicroEventList()
throws CallError,
java.lang.InterruptedException
CallErrorjava.lang.InterruptedExceptionAldebaran SDK for Java
Copyright 2006-2015 Aldebaran Robotics. All Rights Reserved.