public class

ConfigurationManager

extends Object
java.lang.Object
   ↳ com.datalogic.device.configuration.ConfigurationManager

Class Overview

ConfigurationManager gives the developer the ability to browse and set the configuration properties of the device. The device, as a managed device, exposes properties organized in a tree. Each property has a unique identifier used to uniquely identify the property. ConfigurationManager is the sdk access point to the whole of properties that describes and allows the configuration of the device.
Using ConfigurationManager the user can read and modify the value of any property.
The properties are organized in a tree where the leaves are the properties and the intermediate nodes are the groups. A group is a functional collection of property. A group cannot be modified, only the contained properties can be modified.
A property is uniquely identified by an integer identifier PropertyID.
A group is uniquely identified by an integer identifier PropertyGroupID..

The ConfigurationManager offers methods:

  1. to directly access a property,
  2. to navigate the tree of properties,

A Property offers methods to get/set the value.
When the value of a property is modified it is not directly applied to the device. The change is only kept in the sdk local image of the configuration that’s the tree of properties. To actually apply the change to the device the ConfigurationManager commit() method must be called.

A group PropertyGroup offers methods:

  1. to directly access a property of its subtree,
  2. to navigate its subtree of properties and groups.

Summary

Public Constructors
ConfigurationManager(Context context)
This is the constructor of ConfigurationManager.
Public Methods
int commit()
Applies all the modified values since the last commit() to the device and also commits them to the persistent storage.
Property getPropertyById(int id)
Returns the Property whose identifier has the given integer value PropertyID.
Property getPropertyByName(String name)
Gets theProperty whose identifier has the integer value defined by the given constant PropertyID.
PropertyGroup getPropertyGroupById(int id)
Gets the PropertyGroup whose identifier has the given integer value PropertyGroupID.
PropertyGroup getPropertyGroupByName(String name)
Gets the PropertyGroup whose identifier has the integer value defined by the given string PropertyGroupID.
PropertyGroup getTreeRoot()
Returns the PropertyGroup root of the tree of Propertys of the configuration.
int registerListener(ConfigurationChangeListener listener)
int unregisterListener(ConfigurationChangeListener listener)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ConfigurationManager (Context context)

Added in revision 27

This is the constructor of ConfigurationManager.

Parameters
context Context context of the caller application
Throws
ConfigException in case of error.

Public Methods

public int commit ()

Added in revision 27

Applies all the modified values since the last commit() to the device and also commits them to the persistent storage. All the properties committed in this way will maintain the set value between reboots. It works in best effort. If the application of some properties failed, the list of their identifiers is returned through the exception bad_id_buffer.

Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the ConfigException error constants.
Throws
ConfigException in case of error, when exceptions are enabled through the ErrorManager singleton.

public Property getPropertyById (int id)

Added in revision 27

Returns the Property whose identifier has the given integer value PropertyID. If a property with the given id is not found NULL is returned. If the returned property is not supported, get and set on the property will fail.

Parameters
id int unique identifier of the requested property
Returns

public Property getPropertyByName (String name)

Added in revision 27

Gets theProperty whose identifier has the integer value defined by the given constant PropertyID. If a property with the given name is not found NULL is returned. If the returned property is not supported, get and set on the property will fail.

Parameters
name String defining string of the unique identifier of the requested property
Returns

public PropertyGroup getPropertyGroupById (int id)

Added in revision 27

Gets the PropertyGroup whose identifier has the given integer value PropertyGroupID. If a propertyGroup with the given id is not found NULL is returned.

Parameters
id int integer value of the identifier of the requested group
Returns

public PropertyGroup getPropertyGroupByName (String name)

Added in revision 27

Gets the PropertyGroup whose identifier has the integer value defined by the given string PropertyGroupID. If a propertyGroup with the given name is not found NULL is returned.

Parameters
name String name of the requested group
Returns

public PropertyGroup getTreeRoot ()

Added in revision 27

Returns the PropertyGroup root of the tree of Propertys of the configuration.

Returns

public int registerListener (ConfigurationChangeListener listener)

Added in revision 27
Parameters
listener ConfigurationChangeListener listener used to be notified of a change of the configuration
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the ConfigException error constants.

public int unregisterListener (ConfigurationChangeListener listener)

Added in revision 27
Parameters
listener ConfigurationChangeListener listener to be notified of a change of the configuration
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the ConfigException error constants.