public abstract class AbstractResource extends java.lang.Object implements Resource, Scope
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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
describeRights, getRightsInstance, getTypeName, isInstanceNameValid, isRightsSetValid
protected 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 Resource
resourceIndex
- specifies the registration number for the resourcepublic java.lang.String toString()
toString
in class java.lang.Object
public final Scope getEnclosingScope()
getEnclosingScope
in interface Scope
Scope
object, which is
SecurityManager
public java.lang.Object getLibrary()
This implementation exports no library. Plugins that require exported variables should override this method.
getLibrary
in interface Resource
null
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.