Class PoliciesCache

  • All Implemented Interfaces:
    java.lang.Iterable<PolicyCollection>

    public class PoliciesCache
    extends java.lang.Object
    implements java.lang.Iterable<PolicyCollection>
    PoliciesCache retains PolicyDocument objects for inserted Files, and reloads them if file modification time changes.
    • Method Detail

      • fromFile

        public static PoliciesCache fromFile​(java.io.File singleFile)
        Create a cache from a single file source
        Parameters:
        singleFile - file
        Returns:
        cache
      • fromFile

        public static PoliciesCache fromFile​(java.io.File singleFile,
                                             java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext)
        Create a cache from a single file source
        Parameters:
        singleFile - file
        Returns:
        cache
      • fromSourceProvider

        public static PoliciesCache fromSourceProvider​(SourceProvider provider)
        Create from a provider
        Parameters:
        provider - source provider
        Returns:
        policies cache
      • fromSourceProvider

        public static PoliciesCache fromSourceProvider​(SourceProvider provider,
                                                       java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext)
        Create from a provider with a forced context
        Parameters:
        provider - source provider
        forcedContext - forced context
        Returns:
        policies cache
      • fromSourceProvider

        public static PoliciesCache fromSourceProvider​(SourceProvider provider,
                                                       java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext,
                                                       Logger logger)
        Create from a provider with a forced context
        Parameters:
        provider - source provider
        forcedContext - forced context
        Returns:
        policies cache
      • fromDir

        public static PoliciesCache fromDir​(java.io.File rootDir)
        Create a cache from a directory source
        Parameters:
        rootDir - base director
        Returns:
        cache
      • fromDir

        public static PoliciesCache fromDir​(java.io.File rootDir,
                                            java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext,
                                            Logger logger)
        Create a cache from a directory source
        Parameters:
        rootDir - base director
        Returns:
        cache
      • fromDir

        public static PoliciesCache fromDir​(java.io.File rootDir,
                                            java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext)
        Create a cache from a directory source
        Parameters:
        rootDir - base director
        Returns:
        cache
      • fromSources

        public static PoliciesCache fromSources​(java.lang.Iterable<CacheableYamlSource> sources)
        Create a cache from cacheable sources
        Parameters:
        sources - source
        Returns:
        cache
      • fromSources

        public static PoliciesCache fromSources​(java.lang.Iterable<CacheableYamlSource> sources,
                                                java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> context)
        Create a cache from cacheable sources
        Parameters:
        sources - source
        Returns:
        cache