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 managersConstructor 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)
ContextACLManager
addListener
in interface ContextACLManager<T>
public void removeListener(T context, ACLFileManagerListener listener)
ContextACLManager
removeListener
in interface ContextACLManager<T>
public long storePolicyFile(T context, java.lang.String fileName, java.io.InputStream input) throws java.io.IOException
ContextACLManager
storePolicyFile
in interface ContextACLManager<T>
fileName
- name without pathinput
- input streamjava.io.IOException
public boolean deletePolicyFile(T context, java.lang.String fileName) throws java.io.IOException
ContextACLManager
deletePolicyFile
in interface ContextACLManager<T>
java.io.IOException
public long storePolicyFileContents(T context, java.lang.String fileName, java.lang.String fileText) throws java.io.IOException
ContextACLManager
storePolicyFileContents
in interface ContextACLManager<T>
fileName
- name without pathfileText
- contentsjava.io.IOException
public AclPolicyFile getAclPolicy(T context, java.lang.String fileName)
ContextACLManager
getAclPolicy
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.IOException
public long loadPolicyFileContents(T context, java.lang.String fileName, java.io.OutputStream outputStream) throws java.io.IOException
ContextACLManager
loadPolicyFileContents
in interface ContextACLManager<T>
fileName
- name of policy file, without pathjava.io.IOException
public 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
ContextValidator
validateYamlPolicy
in interface ContextValidator<T>
ident
- identity string for the sourcestext
- yaml aclpolicy textjava.io.IOException
public com.dtolabs.rundeck.core.authorization.RuleSetValidation<com.dtolabs.rundeck.core.authorization.providers.PolicyCollection> validatePolicyFile(T context, java.lang.String fname) throws java.io.IOException
ContextValidator
validatePolicyFile
in interface ContextValidator<T>
fname
- filenamejava.io.IOException
public java.util.List<java.lang.String> listStoredPolicyFiles(T context)
ContextACLManager
listStoredPolicyFiles
in interface ContextACLManager<T>