Class LifeCyclePolicyScanner

java.lang.Object
org.opencastproject.lifecyclemanagement.impl.scanner.LifeCyclePolicyScanner
All Implemented Interfaces:
org.apache.felix.fileinstall.ArtifactInstaller, org.apache.felix.fileinstall.ArtifactListener

public class LifeCyclePolicyScanner extends Object implements org.apache.felix.fileinstall.ArtifactInstaller
Loads, unloads, and reloads LifeCyclePolicys from "*policy.yml" files in any of fileinstall's watch directories.
  • Field Details

    • artifactIds

      protected Map<File,String> artifactIds
      An internal collection of artifact id, bind the policy definition files and their id
    • artifactsWithError

      protected final List<File> artifactsWithError
      List of artifact parsed with error
    • securityService

      protected SecurityService securityService
    • organizationDirectoryService

      protected OrganizationDirectoryService organizationDirectoryService
  • Constructor Details

    • LifeCyclePolicyScanner

      public LifeCyclePolicyScanner()
  • Method Details

    • addLifeCycleService

      protected void addLifeCycleService(LifeCycleService service)
    • setSecurityService

      public void setSecurityService(SecurityService securityService)
    • setOrganizationDirectoryService

      public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService)
    • install

      public void install(File artifact)
      Specified by:
      install in interface org.apache.felix.fileinstall.ArtifactInstaller
      See Also:
      • ArtifactInstaller.install(java.io.File)
    • uninstall

      public void uninstall(File artifact)
      Specified by:
      uninstall in interface org.apache.felix.fileinstall.ArtifactInstaller
      See Also:
      • ArtifactInstaller.uninstall(java.io.File)
    • update

      public void update(File artifact)
      Specified by:
      update in interface org.apache.felix.fileinstall.ArtifactInstaller
      See Also:
      • ArtifactInstaller.update(java.io.File)
    • parseLifeCyclePolicyFile

      public LifeCyclePolicyImpl parseLifeCyclePolicyFile(File artifact)
      Parse the given lifecycle policy file and return the related lifecycle policy
      Parameters:
      artifact - The lifecycle policy file to parse
      Returns:
      the lifecycle policy if the given contained a valid one, or null if the file can not be parsed.
    • putLifeCyclePolicy

      public void putLifeCyclePolicy(LifeCyclePolicyImpl policy)
      Add the given lifecycle policy to the installed lifecycle policy id.
      Parameters:
      policy - the lifecycle policy
    • removeLifeCyclePolicy

      public void removeLifeCyclePolicy(String identifier)
      Remove the lifecycle policy with the given id from the installed definition list.
      Parameters:
      identifier - the lifecycle policy identifier
    • canHandle

      public boolean canHandle(File artifact)
      Specified by:
      canHandle in interface org.apache.felix.fileinstall.ArtifactListener
      See Also:
      • ArtifactListener.canHandle(java.io.File)