RAS profile artifact API example

The com.ibm.ras.example.profile.artifact package provides examples of how to programmatically work with RAS artifacts.

com.ibm.ras.example.profile.artifact package

You can use the ArtifactDescriptor pluglet to add new artifact descriptor types. To retrieve artifacts from an asset, use the ArtifactRetrieval pluglet. Use the TypeAnalysis pluglet to perform an analysis of the artifacts or the Visiting pluglet to call all the artifacts in an asset.

The com.ibm.ras.example.profile.artifact package contains the following pluglets that can be used to work with artifacts:

Pluglet Description Results
ArtifactDescriptor Provides an example of how to add new artifact descriptor types that are recognized by the type analyzer. The pluglet in the example demonstrates the following operations:
  • Retrieving the type analyzer service
  • Analyzing the type of a file
  • Retrieving the artifact descriptor manager
  • Retrieving the artifact descriptor factory
  • Creating new artifact descriptors representing folders, files and other physical or logical types
  • Adding new artifact descriptors to the artifact descriptor manager
  • Permanently saving the new types beyond the current session
  • Restoring to the artifact descriptors that were provided with the product
When run successfully, this pluglet provides the following output in the Console view:
  • A count of the total number of artifact descriptors before and after additions
  • The artifact type for a file before and after the new artifact descriptors have been added to the artifact descriptor manager
ArtifactRetrieval Provides an example of how to retrieve artifacts from an asset using an artifact manager and filters. The pluglet in the example demonstrates the following operations:
  • Loading an asset from a manifest using an asset reader
  • Acquiring the asset from the reader
  • Creating an artifact manager for the asset
  • Retrieving all artifacts from the asset
  • Retrieving artifacts from the asset based on an attribute
When run successfully, this pluglet provides the following output in the Console view:
  • A count of the number of artifacts retrieved from an asset
  • The number of artifacts that matched the attribute filter
TypeAnalysis Provides an example of how to perform an analysis of the artifacts in an asset by using the type analyzer to determine the artifact types. The pluglet in the example demonstrates the following operations:
  • Loading an asset from a manifest using an asset reader
  • Acquiring the asset from the reader
  • Visiting all the artifacts in the asset
  • Using the type analyzer to analyze the artifact type
  • Recognizing known and unknown types
When run successfully, this pluglet provides the following output in the Console view:
  • A count of the number of artifacts of a certain type
  • The type of other known or unknown artifact types
Visiting Provides an example of how to call all the artifacts in an asset using the artifact visitor pattern. The pluglet in the example demonstrates the following operations:
  • Loading an asset from a manifest using an asset reader
  • Acquiring the asset from the reader
  • Visiting all the artifacts in the asset
  • Visiting the artifacts in only part of the asset
When run successfully, this pluglet provides a count of the number of artifacts called, in the Console view.

Feedback