com.novell.service.nds
Class NdsObjectACL

java.lang.Object
  |
  +--com.novell.service.nds.NdsObjectACL

public class NdsObjectACL
extends java.lang.Object
implements NdsAttributeValue, , java.lang.Cloneable, java.io.Serializable

Provides access to attribute values of the ObjectACL syntax. It is used for attributes whose values represent ACL entries. An object ACL value can protect either an object or an attribute. The protected object is always the one that contains the ACL attribute. If an ACL entry is to apply to the object as a whole, the protected attribute name should be left empty (NULL). If a specific attribute is to be protected, it should be named in the ACL entry.

You can match an ACL value against either a subject (trustee) or a privilege set, or both. If the subject name is not to be considered in the comparison, specify it as NULL. If the privilege set is not to be considered in the comparison, specify an Approximate Match with a privilege set value of zero.

The Object ACL syntax supports both matching for equality and approximate matching. The difference between matching for equality and approximate matching concerns the privileges field of the comparison value. When matching for equality, the privilege set must match exactly for the comparison to succeed. When approximate matching has been selected, any bits in the privilege field in the filter that are set must also be set in the target. Any other bits in the target are ignored.

Matching Rules: Equality and Approximate Matching

See Also:
NdsSyntaxId

Field Summary
static java.lang.String DS_ALL_ATTRS_NAME
          All Attributes Rights ACL to be stored as a String value.
static java.lang.String DS_CREATOR_NAME
          String constant for [Creator] special entry name.
static java.lang.String DS_ENTRY_RIGHTS_NAME
          Entry Rights ACL to be stored as a String value.
static java.lang.String DS_MASK_NAME
          String constant for [Inheritance Mask] special entry name.
static java.lang.String DS_PUBLIC_NAME
          String constant for the [Public] object.
static java.lang.String DS_ROOT_NAME
          String constant for the [Root] object.
static java.lang.String DS_SELF_NAME
          String constant for [Self] special entry name.
 
Constructor Summary
NdsObjectACL(java.lang.String protectedAttrName, java.lang.String subjectName, long privileges)
          Constructs an NdsObjectACL object based on the specified protectedAttrName, subjectName, and privileges parameters.
 
Method Summary
 boolean approximate(java.lang.Object anObject)
          Compares two Objects using the approximate equals matching rule.
 java.lang.Object clone()
          Creates a new object of the same class as this object.
 int compareTo(java.lang.Object anObject)
          Compares two objects for ordering, or compares two strings lexicographically.
 int count()
          Returns the number of elements in this sequence.
 boolean equals(java.lang.Object anObject)
          Compares two Objects for equality.
 int getNdsSyntaxId()
          Returns the int that represents this NDS syntax ID.
 long getPrivileges()
          Returns the stored privileges variable as a long value stored in the object data member.
 java.lang.String getProtectedAttrName()
          Returns the stored protectedAttrName variable as a String value stored in the object data member.
 java.lang.String getSubjectName()
          Returns the stored subjectName variable as a String value stored in the object data member.
  getValue(java.lang.String compositeId)
          Returns a SchemaValue object based on the given passed-in string containing the element value.
 java.util.Enumeration getValueIds()
          Returns an enumeration of composite IDs.
 java.util.Enumeration getValues()
          Returns an enumeration of the elements in this composite.
 boolean supportsMatchingRules(int matchingRules)
          Checks to see if this object supports the specified matching rules.
 java.lang.String toString()
          Generates a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DS_ALL_ATTRS_NAME

public static final java.lang.String DS_ALL_ATTRS_NAME
All Attributes Rights ACL to be stored as a String value.

(DS_ALL_ATTRS_NAME = "[All Attributes Rights]")


DS_ENTRY_RIGHTS_NAME

public static final java.lang.String DS_ENTRY_RIGHTS_NAME
Entry Rights ACL to be stored as a String value.

(DS_ENTRY_RIGHTS_NAME = "[Entry Rights]")


DS_ROOT_NAME

public static final java.lang.String DS_ROOT_NAME
String constant for the [Root] object.

(DS_ROOT_NAME = "[Root]")


DS_PUBLIC_NAME

public static final java.lang.String DS_PUBLIC_NAME
String constant for the [Public] object.

(DS_PUBLIC_NAME = "[Public]")


DS_MASK_NAME

public static final java.lang.String DS_MASK_NAME
String constant for [Inheritance Mask] special entry name.

(DS_MASK_NAME = "[Inheritance Mask]")


DS_CREATOR_NAME

public static final java.lang.String DS_CREATOR_NAME
String constant for [Creator] special entry name. It can only be used in the AddEntry method.

(DS_CREATOR_NAME = "[Creator]")


DS_SELF_NAME

public static final java.lang.String DS_SELF_NAME
String constant for [Self] special entry name. It can only be used in the AddEntry method.

(DS_SELF_NAME = "[Self]")

Constructor Detail

NdsObjectACL

public NdsObjectACL(java.lang.String protectedAttrName,
                    java.lang.String subjectName,
                    long privileges)
Constructs an NdsObjectACL object based on the specified protectedAttrName, subjectName, and privileges parameters.
Parameters:
protectedAttrName - The name of the attribute to be protected stored as a String value.
subjectName - The subject (trustee) name stored as a String value.
privileges - The privileges containing a bit mask identifying specific rights stored as a long value.
Method Detail

compareTo

public int compareTo(java.lang.Object anObject)
              throws java.lang.Exception
Compares two objects for ordering, or compares two strings lexicographically. The compareTo method does not apply to the ObjectACL syntax because this syntax does not support the Ordering and Substrings matching rules.

equals

public boolean equals(java.lang.Object anObject)
Compares two Objects for equality. The equals method compares this object value with the value of the reference object in the anObject parameter. When matching for equality, the privilege set must match exactly for the comparison to succeed.

The equals method implements the most discriminating possible equivalence relation on objects; that is, for any reference values X and Y, this method returns TRUE if and only if X and Y refer to the same object (X==Y has the value TRUE).

Parameters:
anObject - The reference object with which to compare.
Returns:
A boolean set to TRUE if and only if the argument is not NULL and is an NDS integer object that contains the same value as this object, otherwise set to FALSE.
Overrides:
equals in class java.lang.Object

count

public int count()
Returns the number of elements in this sequence.
Specified by:
count in interface
Returns:
The number of elements in this sequence as an int.

getValue

public  getValue(java.lang.String compositeId)
Returns a SchemaValue object based on the given passed-in string containing the element value. The SchemaValue object is a Java language data type.
Specified by:
getValue in interface
Parameters:
compositeId - The passed-in string containing the element value.
Returns:
The SchemaValue object containing the protectedAttrName, subjectName and privileges, or NULL.

getValueIds

public java.util.Enumeration getValueIds()
Returns an enumeration of composite IDs.
Specified by:
getValueIds in interface
Returns:
An enumeration of composite IDs.

getValues

public java.util.Enumeration getValues()
Returns an enumeration of the elements in this composite.
Specified by:
getValues in interface
Returns:
An enumeration of the composite elements (protectedAttrName, subjectName and privileges).

approximate

public boolean approximate(java.lang.Object anObject)
                    throws java.lang.Exception
Compares two Objects using the approximate equals matching rule. It compares this object with the reference object in the anObject parameter.

An Object ACL value can protect either an object or an attribute. The protected object is always the one that contains the ACL attribute. If an ACL entry is to apply to the object as a whole, leave the protected attribute name empty (NULL). If a specific attribute is to be protected, name it in the ACL entry.

You can match an ACL value against either a subject (trustee) or a privilege set, or both, If the subject name is not to be considered in the compariosn, specify it as NULL. If the privilege set is not to be considered in the comparison, specify an approximate equals match with a privilege set value of zero.

When the approximate equals matching is used, set any bits in the target that are set in the filter's privilege field. Any other bits in the target are ignored. Values with the same protectedAttrName and subjectName are considered to be duplicate and thus are not permitted. The Protected Attribute Name conveys the attribute that the ACL is protecting.

Specified by:
approximate in interface NdsAttributeValue
Parameters:
anObject - The reference object with which to compare.
Returns:
A Boolean set to TRUE if any argument is not equal to NULL, otherwise set to FALSE.
Throws:
NsiException - The approximate() method is not supported for this syntax.

getNdsSyntaxId

public int getNdsSyntaxId()
Returns the int that represents this NDS syntax ID.
Specified by:
getNdsSyntaxId in interface NdsAttributeValue
Returns:
The syntax ID as an int

supportsMatchingRules

public boolean supportsMatchingRules(int matchingRules)
Checks to see if this object supports the specified matching rules. The ObjectACL syntax supports both the equality and approximate equals matching rules.
Specified by:
supportsMatchingRules in interface NdsAttributeValue
Parameters:
matchingRules - The set of matching rules to check.
Returns:
A Boolean set to TRUE if the matching rules for this object are equal to the matchingRules parameter.

clone

public java.lang.Object clone()
Creates a new object of the same class as this object. It then initializes each of the new object's fields by assigning them the same value as the corresponding fields in this object. No constructor is called.
Returns:
A clone of this object instance containing the cloned syntax.

toString

public java.lang.String toString()
Generates a string representation of the object. It returns a string that textually represents the object. The result should be a concise but informative representation that is easy to read.
Returns:
The String representation of the object.
Overrides:
toString in class java.lang.Object

getProtectedAttrName

public java.lang.String getProtectedAttrName()
Returns the stored protectedAttrName variable as a String value stored in the object data member.
Returns:
The String value of protectedAttrName.

getSubjectName

public java.lang.String getSubjectName()
Returns the stored subjectName variable as a String value stored in the object data member.
Returns:
The String value of subjectName.

getPrivileges

public long getPrivileges()
Returns the stored privileges variable as a long value stored in the object data member.
Returns:
The long value of the privileges variable.