com.netscape.certsrv.acls
Class ACLEntry

java.lang.Object
  extended by 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: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
Serialized Form

Field Summary
protected  java.lang.String mACLEntryString
           
protected  java.lang.String mExpressions
           
protected  boolean mNegative
           
protected  java.util.Hashtable mPerms
           
 
Constructor Summary
ACLEntry()
          Class Constructor
 
Method Summary
 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 this ACLEntry contains a particular permission
 java.lang.String getACLEntryString()
          Gets the ACL Entry String
 java.lang.String getAttributeExpressions()
          Retrieves the expression associated with this entry.
 boolean isNegative()
          Checks if this ACL entry is set to negative.
static ACLEntry parseACLEntry(IACL acl, java.lang.String aclEntryString)
          Parse string in the following format:
 java.util.Enumeration permissions()
          Returns a list of permissions associated with this entry.
 void setACLEntryString(java.lang.String s)
          Sets the ACL entry string
 void setAttributeExpressions(java.lang.String expressions)
          Sets the expression associated with this entry.
 void setNegative()
          Sets this ACL entry negative.
 java.lang.String toString()
          Returns the string representation of this ACLEntry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mPerms

protected java.util.Hashtable mPerms

mExpressions

protected java.lang.String mExpressions

mNegative

protected boolean mNegative

mACLEntryString

protected java.lang.String mACLEntryString
Constructor Detail

ACLEntry

public ACLEntry()
Class Constructor

Method Detail

isNegative

public boolean isNegative()
Checks if this ACL entry is set to negative.

Returns:
true if this ACL entry expression is for "deny"; false if this ACL entry expression is for "allow"

setNegative

public void setNegative()
Sets this ACL entry negative. This ACL entry expression is for "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 interface IACLEntry
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 with
permission - one of the "rights" defined for each protected resource in its ACL

permissions

public java.util.Enumeration 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 this ACLEntry 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 the ACLEntry class

Parameters:
acl - the acl instance associated with this aclentry
aclEntryString - 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 class java.lang.Object
Returns:
string representation of this ACLEntry