public interface ContextManager
| Modifier and Type | Field and Description |
|---|---|
static String |
GATEWAY_ID_PROP_NAME
Name of global property that holds the gateway identifier.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGlobalVariable(String variableName)
Adds a global variable.
|
void |
addListener(IcasaListener listener)
Adds a listener to the platform.
|
void |
addZoneVariable(String zoneId,
String variableName)
Adds a variable on specified zone.
|
Zone |
createZone(String id,
int leftX,
int topY,
int bottomZ,
int width,
int height,
int depth)
Creates a new rectangular zone.
|
Zone |
createZone(String id,
Position center,
int detectionScope)
Creates a new rectangular zone using a center position.
|
LocatedDevice |
getDevice(String deviceId)
Returns an object which represents the device with specified id.
|
Set<String> |
getDeviceIds()
Returns serial numbers of all available devices.
|
Position |
getDevicePosition(String deviceId)
Returns current position of specified device.
|
List<LocatedDevice> |
getDevices()
Returns a set of objects that represent all available devices.
|
Set<String> |
getDeviceTypes()
Gets the set of devices Types existing in the platform.
|
GenericDevice |
getGenericDevice(String deviceId)
Returns device object that corresponds to specified serial number.
|
Set<Variable> |
getGlobalVariables()
Returns all global variables.
|
Object |
getGlobalVariableValue(String variableName)
Returns the value of a given global variable.
|
Set<String> |
getProvidedServices(LocatedDevice device)
Get a set of Service specifications of specified device.
|
Set<String> |
getProvidedServices(String deviceType)
Get a set of the Service specification
|
Zone |
getZone(String zoneId)
Gets the zone having the specified ID or null if there is no zone with this ID.
|
Zone |
getZoneFromPosition(Position position)
Gets the zone containing this position.
|
Set<String> |
getZoneIds()
Gets the set of zones' IDs.
|
List<Zone> |
getZones()
Returns all defined zones.
|
Set<String> |
getZoneVariables(String zoneId)
Gets the set of available variables names in a given zone.
|
Object |
getZoneVariableValue(String zoneId,
String variableName)
Gets the value of a given variable in a specified zone.
|
void |
moveDeviceIntoZone(String deviceId,
String zoneId)
Moves a device to a zone.
|
void |
moveZone(String id,
int leftX,
int topY,
int bottomZ)
Moves a zone to a new top left corner position.
|
void |
removeAllZones()
Removes all zones in the platform.
|
void |
removeListener(IcasaListener listener)
Removes a listener from the platform.
|
void |
removeZone(String id)
Removes a zone given his identifier.
|
void |
resetContext()
Removes all zones.
|
void |
resizeZone(String id,
int width,
int height,
int depth)
Resizes a zone using a new width and height.
|
void |
setDevicePosition(String deviceId,
Position position)
Sets the device position.
|
void |
setDeviceState(String deviceId,
boolean activatedFlag)
Sets activated flag of a device.
|
void |
setGlobalVariable(String variableName,
Object value)
Sets specified global variable .
|
void |
setParentZone(String zoneId,
String parentId)
Sets the zone parent.
|
void |
setZoneVariable(String zoneId,
String variableName,
Object value)
Sets the value of the specified variable.
|
static final String GATEWAY_ID_PROP_NAME
Zone createZone(String id, int leftX, int topY, int bottomZ, int width, int height, int depth)
id - the identifier of the zone.leftX - the left X value of the zone.topY - the top X value of the zone.width - the width of the zone.height - the height of the zone.IllegalArgumentException - when exists a zone with the same identifier.Zone createZone(String id, Position center, int detectionScope)
id - The identifier of the zone.center - The center position of the new zone.detectionScope - used to calculate the width/height of the zone. width = detectionScope * 2 height =
detectionScope * 2IllegalArgumentException - when a zone exists with the same identifier.void removeZone(String id)
id - The zone identifier.void moveZone(String id, int leftX, int topY, int bottomZ) throws Exception
id - The identifier of the zone to move.leftX - The new X corner value.topY - The new Y corner valueException - when new position does not fit in the parent zone.void resizeZone(String id, int width, int height, int depth) throws Exception
id - The identifier of the zone to resize.width - the new width of the zone.height - The new height of the zonedepth - The new depth of the zoneException - Throws an exception when the zone does not fit in the parent zone.void removeAllZones()
Set<String> getZoneVariables(String zoneId)
zoneId - the zone identifier.Object getZoneVariableValue(String zoneId, String variableName)
zoneId - The zone identifier to inspect the variables.variableName - The variable name to retrieve its value.void addZoneVariable(String zoneId, String variableName)
zoneId - zone identifiervariableName - name of a variablevoid setZoneVariable(String zoneId, String variableName, Object value)
zoneId - The zone identifier to inspect the variables.variableName - The name of the variable to be modified.value - The new value of the variable.List<Zone> getZones()
Zone getZone(String zoneId)
zoneId - The ID of the zone to be retrieved.Zone getZoneFromPosition(Position position)
position - A positionvoid setParentZone(String zoneId, String parentId) throws Exception
zoneId - The ID of zone to be modified.parentId - The ID of the new parent zone.Exception - when the zone does not fit in the new parent zone.Set<String> getDeviceIds()
void setDeviceState(String deviceId, boolean activatedFlag)
deviceId - a device identifieractivatedFlag - activation flag valueLocatedDevice getDevice(String deviceId)
deviceId - a device serial numberGenericDevice getGenericDevice(String deviceId)
deviceId - device serial numberList<LocatedDevice> getDevices()
Position getDevicePosition(String deviceId)
deviceId - a device identifiervoid setDevicePosition(String deviceId, Position position)
deviceId - The ID of device to be moved.position - The new position of device.void moveDeviceIntoZone(String deviceId, String zoneId)
deviceId - The ID of device to be moved.zoneId - The ID of the zone where the device wll be placed.Set<String> getDeviceTypes()
Set<String> getProvidedServices(String deviceType)
deviceType - the device type to retrieve its service specifications.Set<String> getProvidedServices(LocatedDevice device)
device - the device type to retrieve its service specifications.Set<Variable> getGlobalVariables()
Object getGlobalVariableValue(String variableName)
variableName - The variable name to retrieve its value.void addGlobalVariable(String variableName)
variableName - name of a global variablevoid setGlobalVariable(String variableName, Object value)
variableName - value - void addListener(IcasaListener listener)
listener - The new listener.void removeListener(IcasaListener listener)
listener - void resetContext()
Copyright © 2012-2013 ADELE Research Group. All Rights Reserved.