public abstract class AbstractResource extends Scope implements Resource
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.ThreadLocal<java.lang.Object> |
objectPointer
per thread reference to the Rights context
|
protected int |
resourceIndex
resource index assigned during resource registration
|
protected SecurityManager |
sm
reference to the attached instance of SecurityManager
|
| Constructor and Description |
|---|
AbstractResource() |
| Modifier and Type | Method and Description |
|---|---|
void |
associate(java.lang.Object link)
Stores the reference to the passed Rights object into a thread local
storage temporarily for the use in the library methods during the
expression evaluation.
|
void |
attach(SecurityManager sm)
Notifies the plugin about the instance of the Security Manager
to communicate with.
|
void |
disassociate()
Nullifies the reference to the Rights object in the thread local
storage.
|
java.util.function.BiPredicate<AccessControlList,java.lang.String> |
getACLMatcher()
Returns a bi-predicate allowing to match ACLs based on a supplied resource instance name.
|
Scope |
getEnclosingScope()
Gets the parent scope for this scope.
|
java.lang.Object |
getLibrary()
Returns the plugin's exported variables and functions.
|
protected java.lang.Object |
getLink()
Returns the reference to the currently associated link object.
|
Rights |
getPermissions(java.lang.String subject,
java.lang.String instanceName)
The method is responsible for computing the permissions for the given
instance name; the permissions are the ones valid for the specified
subject ID.
|
void |
init()
Gives chance to the plugin to initialize when all accounts are created.
|
void |
refresh(AdminAccountExtension ext)
Refresh request to plugin.
|
void |
registeredAs(int resourceIndex)
Notifies the plugin that the resource type has been assigned a numeric
value.
|
java.lang.String |
toString()
Returns the string representation of this plugin.
|
getLibraries, getLibraryClasses, getLibsByClass, getVariableList, getVariablesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescribeRights, getRightsInstance, getTypeName, isInstanceNameValid, isRightsSetValidprotected static java.lang.ThreadLocal<java.lang.Object> objectPointer
protected SecurityManager sm
protected int resourceIndex
public final void attach(SecurityManager sm)
public void init()
public final void registeredAs(int resourceIndex)
registeredAs in interface ResourceresourceIndex - specifies the registration number for the resourcepublic java.util.function.BiPredicate<AccessControlList,java.lang.String> getACLMatcher()
null.null.public java.lang.String toString()
toString in class java.lang.Objectpublic final Scope getEnclosingScope()
getEnclosingScope in class ScopeScope object, which is
SecurityManagerpublic java.lang.Object getLibrary()
This implementation exports no library. Plugins that require exported variables should override this method.
getLibrary in interface Resourcenull if there is nothing to exportpublic final void associate(java.lang.Object link)
link - reference to an arbitrary Object that serves as a data sharing
link for the expression evaluation.public final void disassociate()
protected final java.lang.Object getLink()
public Rights getPermissions(java.lang.String subject, java.lang.String instanceName)
subject - The subject ID for which the permissions needs to be computed.instanceName - The instance name for which the permissions are checked.public void refresh(AdminAccountExtension ext)
ext - A valid instance of the admin plugin.