Class OperatorArtifactManager
Operators that require artifacts from the Artifact Management Server (AMS) use the
OperatorArtifactManager
interface to manage their artifacts.
Operators obtain an OperatorArtifactManager
instance using the
Operator.getArtifactManager()
method. The OperatorArtifactManager
instance returned manages artifacts for the operator that requested the instance.
To receive artifacts from AMS, an operator:
- Invokes
registerArtifactNotifier()
to register an artifact notifier for each type of artifact used by the operator. An operator receives its artifacts via its artifact notifiers. - Invokes
registerForArtifact()
for each artifact required by the operator.
Artifacts are uniquely identified by the artifact's type, name, and version. When an operator requests an artifact it must specify all three of these attributes. When specifying the artifact's version the operator can either request a specific version of the artifact or request the latest version of the artifact (as defined by AMS). Operators that request the latest version of the artifact receive updates (via its artifact notifier) whenever a new version of the artifact becomes the latest version.
- Since:
- 10.2
-
Method Summary
Modifier and TypeMethodDescription(package private) ArtifactNotifier
getArtifactNotifier
(String artifactType) Return the operator's ArtifactNotifier instance for the specified artifact type(package private) com.tibco.ep.sb.ads.internal.ArtifactRegistration
getArtifactRegistration
(ArtifactDescriptor artifactDescriptor) Returns the operator's ArtifactRegistration instance for the specified artifactregisterArtifactNotifier
(String artifactType, ArtifactNotifier notifier) Add an artifact notifier for the specified artifact type.void
registerForArtifact
(ArtifactDescriptor artifactDescriptor) Registers the operator to receive the specified artifact from the Artifact Management Server (AMS).unregisterArtifactNotifier
(String artifactType) Clears the operator's artifact notifier for the specified artifact typevoid
unregisterForArtifact
(ArtifactDescriptor artifactDescriptor) Unregisters the operator from the specified artifact
-
Method Details
-
registerArtifactNotifier
Add an artifact notifier for the specified artifact type.Methods in an artifact notifier are invoked when the operator's artifacts are received from the Artifact Management Server (AMS). The operator can optionally use the
registerForAritfact()
method to request specific artifacts from AMS though AMS can send artifacts to the operator whether or not the operator callsregisterForArtifact()
.Operators can register notifiers for any number of artifact types. The same notifier instance can be used for multiple artifact types.
- Parameters:
artifactType
- Artifact type. Must be a valid AMS artifact type identifier.notifier
- Operator's artifact notifier for the artifact type- Returns:
- the previously installed artifact notifier for the operator and artifact type or null if no notifier was previously installed.
- See Also:
-
unregisterArtifactNotifier
Clears the operator's artifact notifier for the specified artifact typeUnregister automatically occurs when the JVM shutdowns.
- Parameters:
artifactType
- Artifact type- Returns:
- the previously installed artifact notifier for the operator and artifact type or null if no notifier was previously installed.
-
getArtifactNotifier
Return the operator's ArtifactNotifier instance for the specified artifact type- Parameters:
artifactType
- artifact type- Returns:
- ArtifactNotifier instance or null if not found
-
registerForArtifact
Registers the operator to receive the specified artifact from the Artifact Management Server (AMS).This method is used to request an artifact from the AMS. Use an
AritfactDescriptor
instance to describe the artifact. An artifact is described using its artifact type, name, and version attributes. These attributes must be valid type, name, and version identifiers on the AMS being used otherwise the operator never receives the artifact.To request the latest version of an artifact set the version attribute to the value
ArtifactDescriptor.LATEST_VERSION
.Operators receive the artifact via the artifact notifier installed with
registerArtifactNotifier()
. It is undefined whether the artifact notifier is called before or afterregisterForArtifact()
returns. UseArtifactDescriptor.setRequiredAtStartup()
to specify whether or not the operator requires the artifact to be available before the operator starts.Operators that request the latest version of an artifact receive a notification whenever a new latest version of the artifact becomes available from AMS.
registerForArtifact()
must be called before the operator has started (i.e. the operator must be in the runtime state ofNOT_YET_STARTED
).No action is taken if the operator has already registered for this artifact.
- Parameters:
artifactDescriptor
- Description of the artifact- Throws:
ArtifactException
- If an artifact notifier does not exist for the requested artifact or if it is too late in the Operator's life cycle to register an artifact.- See Also:
-
unregisterForArtifact
Unregisters the operator from the specified artifactNo action is taken if the operator is not registered the artifact.
Unregister automatically occurs when the JVM shutdowns.
- Parameters:
artifactDescriptor
- Description of the artifact
-
getArtifactRegistration
com.tibco.ep.sb.ads.internal.ArtifactRegistration getArtifactRegistration(ArtifactDescriptor artifactDescriptor) Returns the operator's ArtifactRegistration instance for the specified artifact- Parameters:
artifactDescriptor
- Artifact description- Returns:
- ArtifactRegistration instance or null
-