Previous Topic

Next Topic

Book Contents

Book Index

Overview

This guide shows you how to track a com.prosyst.mbs.services.da.DeviceAdmin service and how you can use the main functionality of this service of creating and removing devices and obtaining information about available protocol adapters.

General Principles

The DeviceAdmin is based on the Functional Item Management specification. You can learn more about it on the Developer Guide section. The DeviceAdmin extends FunctionalItemFactory and FunctionalItem. There are some additional restrictions related to them:

The following table describes the functional property of the DeviceAdmin:

Property

Access

Property Class

Description

DeviceAdmin.PROPERTY_ADAPTER_INFOS

RE

Set<AdapterInfo>

Property for information for the protocol adapters.

The following table describes the operations of the DeviceAdmin:

Operation

Parameters

Description

DeviceAdmin.OPERATION_GET_ADAPTER_INFO

String – name of the adapter which is required.

Returns information for specific protocol adapter.

DeviceAdmin.OPERATION_CREATE

String – the only possible value can be com.prosyst.mbs.services.da.Device

Map<String, ?> – a set of properties used for the functional item creation. The keys are the supported device creation properties while the values are the correct type for each property.

Creates and registers a Device with set of functional item creation properties. The device items are registered after the Device itself. The method finishes when the Device and its device items are created and registered in the system.

DeviceAdmin.OPERATION_CREATE_DEVICE

DeviceItemDescriptor – holds device properties to be used for the device creation.

Creates and registers Device using the creation data defined in the provided com.prosyst.mbs.services.da.DeviceDescriptor instance. The device items are registered after the Device itself. The method finishes when the Device and its device items are created and registered in the system.

DeviceAdmin.OPERATION_REMOVE

String – the UID of the Device to be removed.

Removes a Device with the given UID. The method finishes when the Device and its device items are removed and unregistered from the system.

DeviceAdmin.OPERATION_REMOVE_DEVICE

String – the UID of the Device to be removed.

RemoveArgument – supported remove argument.

Removes the specified Device with remove operation argument, specified from the application. It is one of the provided values in RemoveArgument. The method finishes when the Device and its device items are removed and unregistered from the system.

DeviceAdmin.OPERATION_CANCEL_REMOVE

String – the UID of the removing Device.

Forces the adapter to cancel a device remove operation. This operation is executed if the method is supported by the protocol adapter.

DeviceAdmin.OPERATION_RECREATE_DEVICE

N/A

For this operation there is no defined operation method. Used only for FunctionalItem event operation name.

States of the DeviceAdmin

The lifecycle of the Device Admin starts when the service is registered and ends when the service is unregistered. The states of the DeviceAdmin are "Registered" and "Unregistered", as shown on the following diagram:

mbs_da_dev_guide2_v90

After Device Access is initialized it registers the DeviceAdmin as an OSGi service and after that all available Devices and their Device Items are registered as an OSGi services too. The "Unregistered" state can be achieved in two ways: