All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.access.CapabilityInstance

java.lang.Object
   |
   +----semper.access.CapabilityInstance

public abstract class CapabilityInstance
extends Object
SEMPER Access Control.

Abstract class representing capability instance objects.

Version:
$Revision: 1.1 $ $Date: 1996/11/20 15:47:27 $
Author:
Jaap-Henk Hoepman ([email protected])
See Also:
Capability, EnabledCapabilityInstance, BoundedCapabilityInstance, PassWordCapabilityInstance

Variable Index

 o template
The template of which this capability is an instance.

Constructor Index

 o CapabilityInstance(Capability, AccessControlHandle)
Create a new capability instance.

Method Index

 o addToRole(RoleInstance)
Add the capability to a role.
 o belongsToRole(RoleInstance)
Check whether this capability belongs to the specified role.
 o enable()
Query the user to enable the capability instance.
 o findUnlockedRole()
Check whether the capability belongs to any unlocked role.
 o getDescription()
Get description of this capability instance.
 o getInfo()
Obtain a short string describing the capability instance and its parameters.
 o getName()
Get name of this capability instance.
 o isEnabled()
Check whether the capability is (still) enabled.
 o isenabledStr()
Return a string describing the status of the capability.
 o removeFromRole(RoleInstance)
Remove the capability from a role.

Variables

 o template
 public Capability template
The template of which this capability is an instance. The name and description of this instance are obtainable through this link.

Constructors

 o CapabilityInstance
 public CapabilityInstance(Capability template,
                           AccessControlHandle owner)
Create a new capability instance.

To create an instance, use Capability.createInstance instead.

Parameters:
template - the template for this instance
owner - AccessControlHandle of the owner of the instance.

Methods

 o getName
 public String getName()
Get name of this capability instance.

Returns:
name of this capability instance.
 o getDescription
 public String getDescription()
Get description of this capability instance.

 o getInfo
 public abstract String getInfo()
Obtain a short string describing the capability instance and its parameters.

Useful for logging.

Returns:
A short string describing the capability instance.
 o addToRole
 public void addToRole(RoleInstance r)
Add the capability to a role.

Parameters:
r - role to add the capability to.
 o belongsToRole
 public boolean belongsToRole(RoleInstance r)
Check whether this capability belongs to the specified role.

Parameters:
r - role
Returns:
true if the capability belongs to this role, false otherwise.
 o removeFromRole
 public void removeFromRole(RoleInstance r)
Remove the capability from a role. If the capability is not a member, nothing happens.

Parameters:
r - role to remove the capability from.
 o findUnlockedRole
 protected boolean findUnlockedRole()
Check whether the capability belongs to any unlocked role. If the capability does not belong to an unlocked role, the user is first prompted to unlock one of the roles the capability belongs to. If the user does not unlock any of these roles, this method returns false. This is an internal function (used by AccessMan in verifyCapability()).

Returns:
true if the capability belongs to an unlocked role, false otherwise.
See Also:
verifyCapability
 o isEnabled
 protected abstract boolean isEnabled()
Check whether the capability is (still) enabled. Depending on the type of capability that instantiates this method, this may always return true or eventually return false This is an internal function (used by AcccessMan in verifyCapability()).

Returns:
true if the capability is enabled, false otherwise.
See Also:
verifyCapability
 o isenabledStr
 public String isenabledStr()
Return a string describing the status of the capability.

Returns:
"enabled" if enabled, "disabled" if not.
 o enable
 public abstract boolean enable()
Query the user to enable the capability instance.

Returns:
true if the capability instance was enabled, false otherwise

All Packages  Class Hierarchy  This Package  Previous  Next  Index