WebSphere brand IBM WebSphere Sensor Events, Version 6.2

Edge Configuration Service

The Edge Configuration Service provides a means of specifying configuration information using XML and a limited facility for remote configuration.

For configuration purposes, Data Capture and Delivery makes use of OSGi's Configuration Admin and Metatype Services as specified within the OSGi Service Platform Service Compendium, Release 4, Version 4.1, April 2007. However, the OSGi specification provides no bindings other than Java™ for interacting with the services, with the exception of the Metatype Service where there is the option to declare metadata using XML, and no explicit facility for remotely managing the configuration. In an attempt to address this, Data Capture and Delivery provides a means of specifying configuration information using XML and a limited facility for remote configuration via the Edge Configuration Service.

The XML configuration closely follows Configuration Admin and Metatype Service terminology and exposes the functionality of the former service. Exposure of Metatype Service functionality is limited to the ability to specify cardinalities and datatypes for properties. One exception to familiar terminology is the addition of requests and request types in an attempt to clearly define the available functionality. The XML facility also attempts to make useful contributions that go beyond the standard functionality of both services. For example, common properties within multiple configurations may be updated using a single request, and multi-valued properties of the right type may be stored as arrays of primitives (boolean) instead of only as primitive wrappers (java.lang.Boolean).

The remote configuration management facility may be controlled using two mechanisms:

XML Syntax

The table below lists the XML elements and attributes that are used in the Edge Configuration. The XML schema, configurationAdmin.xsd, is also located in the IBM® Data Capture and Delivery Toolkit for WebSphere Sensor Events, in the com.ibm.rfid.edge.config project.

The following is a sample of the configurationAdmin.xsd file.

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" 
targetNamespace="http://www.ibm.com/xmlns/rfid/datacapture/v6.0.1" 
xmlns:datacapture="http://www.ibm.com/xmlns/rfid/datacapture/v6.0.1" 
elementFormDefault="qualified">
	<element name="configurationAdmin" type="datacapture:configurationAdmin"/>
	
	<complexType name="configurationAdmin">
		<sequence>
		 <element name="requests" type="datacapture:requests" minOccurs="1" maxOccurs="1"/>
		</sequence>
	</complexType>
	
	<complexType name="requests">
		<sequence>
		 <element name="request" type="datacapture:request" minOccurs="1" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	
	<complexType name="request">
		<sequence>
		 <element name="configurations" type="datacapture:configurations" minOccurs="1" maxOccurs="1"/>
		</sequence>
		<attribute name="type" type="datacapture:requestType" use="required"/>
	</complexType>
	
	<complexType name="configurations">
		<sequence>
		 <element name="configuration" type="datacapture:configuration" minOccurs="1" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	
	<complexType name="configuration">
		<sequence>
		 <element name="properties" type="datacapture:properties" minOccurs="0" maxOccurs="1"/>
		</sequence>
		<attribute name="bundleLocation" type="string" use="optional"/>
		<attribute name="factoryPid" type="string" use="optional"/>
		<attribute name="filter" type="string" use="optional"/>
		<attribute name="pid" type="string" use="optional"/>
	</complexType>
	
	<complexType name="properties">
		<sequence>
		 <element name="property" type="datacapture:property" minOccurs="1" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	
	<complexType name="property">
		<attribute name="cardinality" type="integer" use="optional" default="0"/>
		<attribute name="key" type="string" use="required"/>
		<attribute name="type" type="datacapture:propertyType" use="optional" default="string"/>
		<attribute name="value" type="string" use="required"/>
	</complexType>
	
	<simpleType name="requestType">
		<restriction base="string">
		 <enumeration value="create"/>
	 	 <enumeration value="createOrUpdate"/>
		 <enumeration value="delete"/>
		 <enumeration value="update"/>
		</restriction>
	</simpleType>
	
	<simpleType name="propertyType">
		<restriction base="string">
		 <enumeration value="string"/>
		 <enumeration value="long"/>
		 <enumeration value="double"/>
		 <enumeration value="float"/>
		 <enumeration value="integer"/>
		 <enumeration value="byte"/>
		 <enumeration value="char"/>
		 <enumeration value="boolean"/>
		 <enumeration value="short"/>
		</restriction>
	</simpleType>
</schema>
Table 1. XML elements and attributes used in the Edge Configuration
Element Attribute Attribute Description
configurationAdmin none  
requests none  
request type The type of request. This attribute is required and must be one of the following: create, update, createOrUpdate, delete.
configurations none  
configuration bundleLocation The bundle location associated with the configuration. This attribute is optional. See section 104.4.1 of the OSGi Service Compendium for a detailed explanation.
factoryPid The PID of the Managed Service Factory associated with this configuration. This attribute is optional unless neither the pid nor the filter attribute is provided, in which case it is required. The pid and factoryPid attributes are mutually exclusive.
filter Locates existing configurations. This attribute is optional unless neither the pid nor the factoryPid attribute is provided, in which case it is required. Using this property has no effect if the pid attribute is also specified. See section 104.7.3 of the OSGi Service Compendium for a detailed explanation.
pid The PID of the Managed Service associated with this configuration. This attribute is optional unless neither the factoryPid nor the filter attribute is provided, in which case it is required. The pid and factoryPid attributes are mutually exclusive.

Services with a pid specified have a filter generated automatically: service.pid=<pid>. This value will override any value specified with the filter attribute.

The PID assigned to a configuration by a Managed Service Factory occurs locally. Use the pid attribute for configurations associated with Managed Services and the filter attribute for configurations associated with Managed Service Factories.

properties none  
property cardinality Indicates if the property is multi-valued and how the values should be stored (i.e. array or vector). See the Metatype Specification, section 105 of the OSGi Service Compendium for more information. This value is optional. The default value is zero (0).
Note: The current implementation of the Edge Configuration Service, in order to comply with Device Kit restrictions, uses arrays of primitive values if the type attribute is set to a value other than string.
key The property key. This attribute is required.
type The data type of the property. The default value is string. This attribute is optional and can be one of the following: boolean, byte, char, double, float, integer, long, short, or string. See section 105.6.1 of the OSGi Service Compendium for more information.
value The property value. This attribute is required.
Table 2. Edge Configuration Service properties
Property Description
com.ibm.rfid.edge.config.autostart If the value is set to true, the agent pulls down the configuration. If set to false, the configuration is not pulled until an explicit reload request is received. The location of the configuration is specified by the com.ibm.rfid.edge.config.url property.
com.ibm.rfid.edge.config.bootstrap If the value is set to true, the agent creates its own configuration within the Configuration Admin service based on the values of the system properties.
com.ibm.rfid.edge.config.bootstrap.overrides If the value is set to true, the agent overwrites its existing configuration within the Configuration Admin service with one containing the values of the system properties. If the value is set to false, the existing configuration is not modified. If there is no existing configuration, this property has no effect. If com.ibm.rfid.edge.config.bootstrap equals false, this property has no effect.
com.ibm.rfid.edge.config.interval The interval, in milliseconds, that specifies how often to pull the configuration. The location of the configuration is specified by the com.ibm.rfid.edge.config.url property. Once the XML configuration is successfully retrieved, this loop terminates and does not start again unless Data Capture and Delivery is restarted and com.ibm.rfid.edge.config.autostart equals true or a reload request is received.
com.ibm.rfid.edge.config.url The URL that specifies the location of the XML configuration.

Request types

There are four types of requests that can be used for edge configuration. These values are set in the XML using the type attribute of the request element.

create
For creating a new configuration that did not previously exist. For Managed Services, a new configuration is created if there is no existing service with the same PID. No update occurs to an existing Managed Service. For Managed Service Factories, a new configuration is always created using the Factory PID unless a filter is specified. If a filter is specified and one or more existing configurations matching the filter are found, a new configuration is not created.
update
For updating existing configurations. If at least one configuration matching the filter is not found, no updates take place. If more than one configuration matching the filter is found, all configurations are updated with the specified properties. This is used to update multiple configurations sharing a common property.
createOrUpdate
For updating existing configurations or creating a new configuration that did not previously exist. If one or more configurations matching the specified filter are found, updates occur. If no existing configurations are found matching the filter then a new configuration is created.
delete
For deleting existing configurations.

Library | Support | Terms of use

(c) Copyright IBM Corporation 2004, 2009. All rights reserved.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.