T - public abstract class BaseContextACLManager<T> extends java.lang.Object implements ContextACLManager<T>
forContext(Object) to retrieve ACLFilemanager, and apply corresponding method
call, maintains created managers in a map, and handles listener mappings for the created managers| Constructor and Description |
|---|
BaseContextACLManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(T context,
ACLFileManagerListener listener)
Receive notification of changes
|
void |
addListenerMap(java.util.function.Function<T,ACLFileManagerListener> mapping)
adds a mapping from context to listeners, and immediately applies to previously created managers
|
protected ACLFileManager |
applyMappings(T ctx,
ACLFileManager listenable)
Applies existing listener mappings to a manager
|
protected abstract ACLFileManager |
createManager(T context) |
boolean |
deletePolicyFile(T context,
java.lang.String fileName)
Delete a policy file
|
boolean |
existsPolicyFile(T context,
java.lang.String file) |
ACLFileManager |
forContext(T context) |
AclPolicyFile |
getAclPolicy(T context,
java.lang.String fileName)
Retrieve a system policy
|
java.lang.String |
getPolicyFileContents(T context,
java.lang.String fileName) |
java.util.List<java.lang.String> |
listStoredPolicyFiles(T context)
List the system aclpolicy file names, not including the dir path
|
long |
loadPolicyFileContents(T context,
java.lang.String fileName,
java.io.OutputStream outputStream)
Load content to output stream
|
void |
removeListener(T context,
ACLFileManagerListener listener)
Remove a listener
|
long |
storePolicyFile(T context,
java.lang.String fileName,
java.io.InputStream input)
Store a system policy file
|
long |
storePolicyFileContents(T context,
java.lang.String fileName,
java.lang.String fileText)
Store a system policy file
|
com.dtolabs.rundeck.core.authorization.RuleSetValidation<com.dtolabs.rundeck.core.authorization.providers.PolicyCollection> |
validatePolicyFile(T context,
java.lang.String fname)
Validate the yaml aclpolicy within a specific project context
|
com.dtolabs.rundeck.core.authorization.RuleSetValidation<com.dtolabs.rundeck.core.authorization.providers.PolicyCollection> |
validateYamlPolicy(T context,
java.lang.String ident,
java.lang.String text)
Validate the yaml aclpolicy, optionally within a specific project context
|
protected ACLFileManager applyMappings(T ctx, ACLFileManager listenable)
ctx - contextlistenable - managerprotected abstract ACLFileManager createManager(T context)
public ACLFileManager forContext(T context)
forContext in interface ContextACLManager<T>public void addListenerMap(java.util.function.Function<T,ACLFileManagerListener> mapping)
addListenerMap in interface ContextACLManager<T>mapping - public void addListener(T context, ACLFileManagerListener listener)
ContextACLManageraddListener in interface ContextACLManager<T>public void removeListener(T context, ACLFileManagerListener listener)
ContextACLManagerremoveListener in interface ContextACLManager<T>public long storePolicyFile(T context, java.lang.String fileName, java.io.InputStream input) throws java.io.IOException
ContextACLManagerstorePolicyFile in interface ContextACLManager<T>fileName - name without pathinput - input streamjava.io.IOExceptionpublic boolean deletePolicyFile(T context, java.lang.String fileName) throws java.io.IOException
ContextACLManagerdeletePolicyFile in interface ContextACLManager<T>java.io.IOExceptionpublic long storePolicyFileContents(T context, java.lang.String fileName, java.lang.String fileText) throws java.io.IOException
ContextACLManagerstorePolicyFileContents in interface ContextACLManager<T>fileName - name without pathfileText - contentsjava.io.IOExceptionpublic AclPolicyFile getAclPolicy(T context, java.lang.String fileName)
ContextACLManagergetAclPolicy in interface ContextACLManager<T>fileName - name without pathpublic java.lang.String getPolicyFileContents(T context, java.lang.String fileName) throws java.io.IOException
getPolicyFileContents in interface ContextACLManager<T>fileName - name of policy file, without pathjava.io.IOExceptionpublic long loadPolicyFileContents(T context, java.lang.String fileName, java.io.OutputStream outputStream) throws java.io.IOException
ContextACLManagerloadPolicyFileContents in interface ContextACLManager<T>fileName - name of policy file, without pathjava.io.IOExceptionpublic boolean existsPolicyFile(T context, java.lang.String file)
existsPolicyFile in interface ContextACLManager<T>file - name without pathpublic com.dtolabs.rundeck.core.authorization.RuleSetValidation<com.dtolabs.rundeck.core.authorization.providers.PolicyCollection> validateYamlPolicy(T context, java.lang.String ident, java.lang.String text) throws java.io.IOException
ContextValidatorvalidateYamlPolicy in interface ContextValidator<T>ident - identity string for the sourcestext - yaml aclpolicy textjava.io.IOExceptionpublic com.dtolabs.rundeck.core.authorization.RuleSetValidation<com.dtolabs.rundeck.core.authorization.providers.PolicyCollection> validatePolicyFile(T context, java.lang.String fname) throws java.io.IOException
ContextValidatorvalidatePolicyFile in interface ContextValidator<T>fname - filenamejava.io.IOExceptionpublic java.util.List<java.lang.String> listStoredPolicyFiles(T context)
ContextACLManagerlistStoredPolicyFiles in interface ContextACLManager<T>