Interface ArtifactNotifier


public interface ArtifactNotifier
Operators implement this interface to receive notifications about the artifacts used by the operator.
Since:
10.2
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activated(Artifact oldArtifact, Artifact newArtifact)
    Called when an artifact becomes active for the operator.
    void
    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
    Called before the artifact becomes inactive for the operator.
  • Method Details

    • validateActivation

      void validateActivation(Artifact currentArtifact, Artifact newArtifact) throws ArtifactException
      Validate an artifact.

      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.

      Parameters:
      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 validate
      Throws:
      ArtifactException - to prevent newArtifact from becoming active for the operator
    • activated

      void activated(Artifact oldArtifact, Artifact newArtifact)
      Called when an artifact becomes active for the operator.

      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().

      Parameters:
      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 artifact
    • validateDeactivation

      void validateDeactivation(Artifact artifact) throws ArtifactException
      Called before the artifact becomes inactive for the operator.

      This method can be used to block the deactivation of the artifact by throwing an ArtifactException exception.

      Parameters:
      artifact - the artifact that will be deactivated
      Throws:
      ArtifactException - to prevent the artifact from becoming inactive.
    • deactivated

      void deactivated(Artifact artifact)
      Called when the operator's artifact has been deactivated.

      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().

      Parameters:
      artifact - the artifact that has been deactivated
    • message

      default void message(ArtifactMessage artifactMessage)
      Called when a message is received for an artifact that the operator has registered for.

      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.

      Parameters:
      artifactMessage - An ArtifactMessage instance which specifies the artifact that the message pertains to, the message code, the message severity, and the message text.