Class PoliciesCache
- java.lang.Object
-
- com.dtolabs.rundeck.core.authorization.providers.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PoliciesCachefromDir(java.io.File rootDir)Create a cache from a directory sourcestatic PoliciesCachefromDir(java.io.File rootDir, java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext)Create a cache from a directory sourcestatic PoliciesCachefromDir(java.io.File rootDir, java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext, Logger logger)Create a cache from a directory sourcestatic PoliciesCachefromFile(java.io.File singleFile)Create a cache from a single file sourcestatic PoliciesCachefromFile(java.io.File singleFile, java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext)Create a cache from a single file sourcestatic PoliciesCachefromSourceProvider(SourceProvider provider)Create from a providerstatic PoliciesCachefromSourceProvider(SourceProvider provider, Logger logger)static PoliciesCachefromSourceProvider(SourceProvider provider, java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext)Create from a provider with a forced contextstatic PoliciesCachefromSourceProvider(SourceProvider provider, java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> forcedContext, Logger logger)Create from a provider with a forced contextstatic PoliciesCachefromSources(java.lang.Iterable<CacheableYamlSource> sources)Create a cache from cacheable sourcesstatic PoliciesCachefromSources(java.lang.Iterable<CacheableYamlSource> sources, java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> context)Create a cache from cacheable sourcesPolicyCollectiongetDocument(CacheableYamlSource source)java.util.Iterator<PolicyCollection>iterator()
-
-
-
Method Detail
-
getDocument
public PolicyCollection getDocument(CacheableYamlSource source) throws PoliciesParseException
- Parameters:
source- source- Returns:
- collection
- Throws:
PoliciesParseException
-
iterator
public java.util.Iterator<PolicyCollection> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<PolicyCollection>
-
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, Logger logger)
-
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 providerforcedContext- 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 providerforcedContext- 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
-
-