|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.cams.access.AbstractPermissionCollection
Abstract implementation of the PermissionCollection interface.
PermissionCollection| Field Summary | |
protected Config |
config
The Config object passed in at initialization through which configuration parameters, services, and a Logger are available. |
protected boolean |
debug
A flag that enables/disables DEBUG-level messages. |
protected Logger |
logger
The Logger to which DEBUG, INFO, WARNING, ERROR, and FATAL messages are written. |
protected List |
permissionList
The List of Permissions in this collection. |
| Constructor Summary | |
AbstractPermissionCollection()
Create a new AbstractPermissionCollection. |
|
| Method Summary | |
void |
addPermission(Permission permission)
Add a Permission. |
boolean |
containsOverlapping(Permission permission)
Check for an overlapping Permission. |
Permission |
getOverlapping(Permission permission)
Get an overlapping Permission. |
Permission |
getPermission(ResourceRequest resourceReq)
Get the Permission best matching a
ResourceRequest. |
PermissionIterator |
getPermissions()
Get all Permissions. |
void |
initialize(Config config)
Initialize the AccessControlRule. |
void |
removePermission(Permission permission)
Remove a Permission. |
boolean |
setDebug(boolean enable)
Enable or disable debugging. |
String |
toString()
Get a String representation of the PermissionCollection object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected List permissionList
protected Config config
protected Logger logger
protected boolean debug
| Constructor Detail |
public AbstractPermissionCollection()
| Method Detail |
public void initialize(Config config)
throws ConfigException
initialize in interface PermissionCollectionconfig - a Config object that provides access to configuration
parameters and a runtime Context.
ConfigExceptionpublic boolean setDebug(boolean enable)
setDebug in interface Debuggableenable - if true, enable debugging, else disable debugging.
public void addPermission(Permission permission)
throws OverlappingPermissionsException
Permission.
addPermission in interface PermissionCollectionpermission - the Permission to be added.
OverlappingPermissionsExceptionpublic void removePermission(Permission permission)
Permission.
removePermission in interface PermissionCollectionpermission - the Permission to be removed.public Permission getPermission(ResourceRequest resourceReq)
Permission best matching a
ResourceRequest.
getPermission in interface PermissionCollectionresourceReq - the ResourceRequest
Permission best matching the
ResourceRequest or null if no match.public PermissionIterator getPermissions()
getPermissions in interface PermissionCollectionpublic boolean containsOverlapping(Permission permission)
Two Permission instances: A and B are considered to overlap if:
containsOverlapping in interface PermissionCollectionpermission - the Permission to be checked for an overlap.
getOverlapping(com.cafesoft.cams.access.Permission)public Permission getOverlapping(Permission permission)
getOverlapping in interface PermissionCollectionpermission - the Permission that overlaps the one to be retrieved.
public String toString()
toString in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||