The Asset Management Reusable Component stores assets.
With the Asset Management Reusable Component, you can:
- Create, update, and delete types of assets
- Create, update, delete, and search for assets as instances of
these asset types
An asset is an instance of an asset type. The asset
type defines the properties (their names, default values, and various
other metadata) that a class of assets can have. An asset type can
inherit from another asset type, in which case the child asset type
contains all the properties of its ancestors as well as the properties
it has defined for itself. The asset contains values for the properties
defined by its asset type, as well as all the ancestors of its asset
type.
For example, if you define an asset type called Employee,
then this type could contain the properties: First Name, Last Name,
and Department. Then you can define an instance of this type with
a value of John for First Name, Doe for Last Name, and Software Department
for Department.
WebSphere Sensor Events configuration
Table 1. Asset Management agent propertiesName |
Description |
PID |
Agent properties |
Asset Agent |
RUC Asset Mgmt Agent |
com.ibm.premises.reusable.assetmgmt.AssetAgent |
- assign.output.failure=rucresponse/assetmgmt/assign/failure
- assign.output.success=rucresponse/assetmgmt/assign/success
- ruc.targetBackend=ruc.db
- unassign.output.failure=rucresponse/assetmgmt/unassign/failure
- unassign.output.success=rucresponse/assetmgmt/unassign/success
- updateproperty.output.failure=rucresponse/assetmgmt/updateproperty/failure
- updateproperty.output.success=rucresponse/assetmgmt/updateproperty/success
|
Methods
Methods for assets:
- addAsset(Asset asset, Integer userId)
- editAsset(Asset asset, Integer userId)
- editAssets(List<Asset> assets, Integer userId)
- deleteAsset(int assetId, Timestamp updateTime)
- assetWithPrimaryKeyExists(Asset asset)
- assignTag(int assetId, String tagId) (Exposed
as Web service)
- unassignTag(int assetId, String tagId) (Exposed
as Web service)
- updateAssetProperty(int assetId, String propName, Object
propValue) (Exposed as Web service)
- getAssetById(int assetId, Timestamp timestamp)
- findAssetsByParentId(Integer parentAssetId) findAssetsByProperties(Map<String,
Object> assetProperties) (Exposed as Web service)
- findAssetsByTagId(List<String> tagId) (Exposed
as Web service)
- findAssetsByProperties(Map<String, Object> assetProperties) (Exposed
as Web service)
- findAssets(String assetTypeName, boolean allAssetTypeDescendants,
List<String> tagId, Map<String, Object> assetProperties, Integer
parentAssetId, boolean allParentAssetDescendants)
- findAssetsByAssetTypeName(String assetTypeName, boolean
allAssetTypeDescendants) (Exposed as Web service)
- findAssetsByAssetTypeName(String assetTypeName)
Methods for asset types:
- addAssetType(AssetType assetType, Integer userId)
- editAssetType(AssetType assetType, Timestamp updateTime,
Integer userId)
- deleteAssetType(String assetTypeName, Timestamp updateTime)
- getAssetTypeId(String assetTypeName) (Exposed
as Web service)
- getAssetTypeName(int assetTypeId) (Exposed as
Web service)
- getAssetType(String assetTypeName)
- getAssetType(int assetTypeId)
- getAllAssetTypes()
- getAllAssetTypeNames() (Exposed as Web service)
- getAllDataTypes() (Exposed as Web service)
- getPrimaryKeyName(String assetTypeName) (Exposed
as Web service)
- getAssetTypeId(String assetTypeName)
Using the Asset Management Reusable Component
Calling
many of the methods of the Asset Management Reusable Component synchronously,
using the Stateless Session Bean interface or Web service interface,
requires using these defined classes, which are documented in the WebSphere Sensor Events API documentation:
- AssetType
- AssetTypeProperty
- Asset
To publish to Reusable Components MDBs, set the following
values for the JMS topic and eventType. For multi-action Reusable
Components, the topic is checked in the message selector and in the
MDB code.
- assign: profileid/rucaction/assetmgmt/assign
- unassign: profileid/rucaction/assetmgmt/unassign
- updateproperty: profileid/rucaction/assetmgmt/updateproperty
For any of the three actions, the payload must also include:
- AssetMgmtRUCConstants.ASSETMGMT_RUC_ASSETID_KEY_IN
For the updateproperty action, the payload
must also include:
- AssetMgmtRUCConstants.ASSETMGMT_RUC_PROPNAME_KEY_IN
- AssetMgmtRUCConstants.ASSETMGMT_RUC_PROPVALUE_KEY_IN
To invoke the assign or unassign action on the Asset Management
Reusable Component using IBM® Sensor
Events or XML, the payload must include:
- PassiveRFIDTagRead
- PassiveRFIDAggregatedTagRead
Generic payload created from a map can also be used. It must
include either of the following:
- AssetMgmtRUCConstants.TAG_KEY_INOUT
- AssetMgmtRUCConstants.TAGLIST_KEY_INOUT
Note: TAG_KEY_INOUT takes
a String value. TAGLIST_KEY_INOUT takes
a value of java.util.List populated with Strings.
The
JMS topic and eventType for the MDB output from the Reusable Component
comes from the agent properties. Default output topics for success
and failure for each action are shown in Table 1.