Package com.netscape.certsrv.acls
Class ACLEntry
- java.lang.Object
-
- com.netscape.certsrv.acls.ACLEntry
-
- All Implemented Interfaces:
IACLEntry
,java.io.Serializable
public class ACLEntry extends java.lang.Object implements IACLEntry, java.io.Serializable
A class represents an ACI entry of an access control list.- Version:
- $Revision$, $Date$
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ACLEntry.Type
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
aclEntryString
protected java.lang.String
expressions
protected java.util.Hashtable<java.lang.String,java.lang.String>
mPerms
protected ACLEntry.Type
type
-
Constructor Summary
Constructors Constructor Description ACLEntry()
Class Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPermission(IACL acl, java.lang.String permission)
Adds permission to this entry.boolean
checkPermission(java.lang.String permission)
Checks if this entry has the given permission.boolean
containPermission(java.lang.String permission)
Checks to see if thisACLEntry
contains a particular permissionjava.lang.String
getACLEntryString()
Gets the ACL Entry Stringjava.lang.String
getAttributeExpressions()
Retrieves the expression associated with this entry.ACLEntry.Type
getType()
Get the Type of the ACL entry.static ACLEntry
parseACLEntry(IACL acl, java.lang.String aclEntryString)
Parse string in the following format:java.util.Enumeration<java.lang.String>
permissions()
Returns a list of permissions associated with this entry.void
setACLEntryString(java.lang.String s)
Sets the ACL entry stringvoid
setAttributeExpressions(java.lang.String expressions)
Sets the expression associated with this entry.java.lang.String
toString()
Returns the string representation of this ACLEntry
-
-
-
Field Detail
-
mPerms
protected java.util.Hashtable<java.lang.String,java.lang.String> mPerms
-
expressions
protected java.lang.String expressions
-
type
protected ACLEntry.Type type
-
aclEntryString
protected java.lang.String aclEntryString
-
-
Method Detail
-
getType
public ACLEntry.Type getType()
Get the Type of the ACL entry.- Returns:
- Allow or Deny
-
setACLEntryString
public void setACLEntryString(java.lang.String s)
Sets the ACL entry string- Parameters:
s
- string in the following format:allow|deny (right[,right...]) attribute_expression
-
getACLEntryString
public java.lang.String getACLEntryString()
Gets the ACL Entry String- Specified by:
getACLEntryString
in interfaceIACLEntry
- Returns:
- ACL Entry string in the following format:
allow|deny (right[,right...]) attribute_expression
-
addPermission
public void addPermission(IACL acl, java.lang.String permission)
Adds permission to this entry. Permission must be one of the "rights" defined for each protected resource in its ACL- Parameters:
acl
- the acl instance that this aclEntry is associated withpermission
- one of the "rights" defined for each protected resource in its ACL
-
permissions
public java.util.Enumeration<java.lang.String> permissions()
Returns a list of permissions associated with this entry.- Returns:
- a list of permissions for this ACL entry
-
setAttributeExpressions
public void setAttributeExpressions(java.lang.String expressions)
Sets the expression associated with this entry.- Parameters:
expressions
- the evaluator expressions. For example, group="Administrators"
-
getAttributeExpressions
public java.lang.String getAttributeExpressions()
Retrieves the expression associated with this entry.- Returns:
- the evaluator expressions. For example, group="Administrators"
-
containPermission
public boolean containPermission(java.lang.String permission)
Checks to see if thisACLEntry
contains a particular permission- Parameters:
permission
- one of the "rights" defined for each protected resource in its ACL- Returns:
- true if permission contained in the permission list
for this
ACLEntry
; false otherwise.
-
checkPermission
public boolean checkPermission(java.lang.String permission)
Checks if this entry has the given permission.- Parameters:
permission
- one of the "rights" defined for each protected resource in its ACL- Returns:
- true if the permission is allowed; false if the permission is denied. If a permission is not recognized by this ACL, it is considered denied
-
parseACLEntry
public static ACLEntry parseACLEntry(IACL acl, java.lang.String aclEntryString)
Parse string in the following format:allow|deny (right[,right...]) attribute_expression
into an instance of theACLEntry
class- Parameters:
acl
- the acl instance associated with this aclentryaclEntryString
- aclEntryString in the specified format- Returns:
- an instance of the
ACLEntry
class
-
toString
public java.lang.String toString()
Returns the string representation of this ACLEntry- Overrides:
toString
in classjava.lang.Object
- Returns:
- string representation of this ACLEntry
-
-