public interface ArtifactNotifier
Modifier and Type | Method and Description |
---|---|
void |
activated(Artifact oldArtifact,
Artifact newArtifact)
Called when an artifact becomes active for the operator.
|
void |
deactivated(Artifact artifact)
Called when the operator's artifact has been deactivated.
|
default void |
message(ArtifactMessage artifactMessage)
Called when a message is received for an artifact that the
operator has registered for.
|
void |
validateActivation(Artifact currentArtifact,
Artifact newArtifact)
Validate an artifact.
|
void |
validateDeactivation(Artifact artifact)
Called before the artifact becomes inactive for the operator.
|
void validateActivation(Artifact currentArtifact, Artifact newArtifact) throws ArtifactException
This method can be used to validate an artifact before it becomes active
for the operator. This method may reject the artifact by throwing an
ArtifactException
exception.
currentArtifact
- the operator's current artifact that will be replaced by newArtifact
.
This parameter is null if there is no current artifact for the operator.newArtifact
- the artifact to validateArtifactException
- to prevent newArtifact from becoming active for the operatorvoid activated(Artifact oldArtifact, Artifact newArtifact)
This method is called after the validateActivation()
method. If multiple
operators are being updated with the artifact then this method is called only if all of
the operators successfully validated the artifact.
Please note that activated() does not throw any exceptions. It is expected that all error conditions are detected in validateActivation().
oldArtifact
- the previous version of the artifact used by the operator. This parameter is null
if there is no previous version.newArtifact
- the new version of the artifactvoid validateDeactivation(Artifact artifact) throws ArtifactException
This method can be used to block the deactivation of the artifact by throwing an
ArtifactException
exception.
artifact
- the artifact that will be deactivatedArtifactException
- to prevent the artifact from becoming inactive.void deactivated(Artifact artifact)
This method is called after the validateDeactivation()
method. If multiple
operators are involved in the deactivation of the artifact then this method is called
only if all of the operators approved the deactivation.
Please note that deactivated() does not throw any exceptions. It is expected that all error conditions are detected in validateDeactivation().
artifact
- the artifact that has been deactivateddefault void message(ArtifactMessage artifactMessage)
This method is called to notify the operator when the Artifact Management Server (AMS) providing artifacts to the application returns a message for an artifact requested by the operator.
Note that if there are multiple AMS instances providing artifacts to the application then multiple errors might be reported for a single artifact. Also, it is possible that one AMS instance might return an error for an artifact before another AMS instance loads the artifact. In this case the initial error does not prevent the artifact from being loaded.
This method can be called at any point in the operator's lifecycle.
artifactMessage
- An ArtifactMessage instance which specifies
the artifact that the message pertains to, the message code,
the message severity, and the message text.Copyright © 2015–2019 Cloud Software Group, Inc.. All rights reserved.