java.lang.Object
org.odpi.openmetadata.adapters.connectors.surveyaction.seal.SealProcessor

public class SealProcessor extends Object
SealProcessor seals content, and verifies sealed content, on behalf of the file and folder survey services.
  • Sealing reads every member of the content, writes the manifest and attaches the Sealed classification. It happens when the sealAction request parameter is SEAL.
  • Verification compares each piece of sealed content that the survey covers with its manifest, records the result in the Sealed classification, and describes it in a Seal Verification annotation. If the seal is not intact, it adds a Broken Seal request for action.
The surveyed asset is always covered. A folder survey also covers the sealed files, directories and compound assets that are catalogued beneath the surveyed directory.
  • Field Details

    • SEALED_ELEMENT_ACTION_TARGET

      public static final String SEALED_ELEMENT_ACTION_TARGET
      The name of the action target that links a Broken Seal request for action to the sealed element.
      See Also:
  • Constructor Details

    • SealProcessor

      public SealProcessor(SurveyActionServiceConnector surveyService, SurveyContext surveyContext, AuditLog auditLog, String surveyServiceName, AnnotationType verificationAnnotationType, AnnotationType brokenSealAnnotationType)
      Constructor.
      Parameters:
      surveyService - the survey action service
      surveyContext - the survey's context
      auditLog - destination for audit log messages
      surveyServiceName - name of the survey action service
      verificationAnnotationType - the annotation type for a Seal Verification annotation
      brokenSealAnnotationType - the annotation type for a Broken Seal request for action
  • Method Details

    • getProfileAnnotations

      public List<SealProcessor.SealAnnotation> getProfileAnnotations()
      Return the Seal Verification annotations.
      Returns:
      list
    • getActionAnnotations

      public List<SealProcessor.SealAnnotation> getActionAnnotations()
      Return the Broken Seal requests for action.
      Returns:
      list
    • process

      public void process(OpenMetadataRootElement assetElement, File localRoot, String canonicalRootPathName, boolean lookBeneath) throws UserNotAuthorizedException
      Seal the content if that is requested, and verify the sealed content that the survey covers. A failure to seal or verify one piece of content is logged and does not stop the survey.
      Parameters:
      assetElement - the surveyed asset
      localRoot - the surveyed file or directory on this machine
      canonicalRootPathName - the path name of the surveyed file or directory, as it is catalogued
      lookBeneath - also verify the sealed content catalogued beneath the surveyed directory
      Throws:
      UserNotAuthorizedException - the survey action service has been disconnected
    • getPathName

      public static String getPathName(OpenMetadataRootElement element)
      Return the path name that an element is catalogued with.
      Parameters:
      element - catalogued file, directory or compound asset
      Returns:
      path name or null