|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.novell.service.file.nw.Trustee
Provides variables, constructors, and methods for the support of a Trustee. Trustees can be associated with a given directory entry (file or directory). The given directory entry can have multiple trustees, which can be enumerated using the TrusteeEnumerator interface.
A Trustee is composed of a name identifying the trustee, the rights associated with the named trustee, and a compare string. The compare string uses the RFC1960 (LDAP) search string format and is used to allow individual compares on names and rights.
Warning: This class results in a mutable object. For versatility, code block synchronization has been implemented in the various jndi search and modify methods of this class's implementation to provide for thread safe operation.
If you have a multi-threaded application and a code segment of that application uses get methods of this class, and there is a potential of another thread randomly using corresponding set methods of this class, you should enclose the calls to the get methods of this class in a synchronized code block.
If you have a multi-threaded application and a code segment of that application uses set methods of this class, and there is a potential of another thread randomly using corresponding get methods of this class, you should enclose the calls to the set methods of this class in a synchronized code block.
TrusteeEnumerator
Field Summary | |
static java.lang.String |
ATTRIBUTE_ID
Attribute ID of Trustee. |
static java.lang.String |
COMPARE_SYNTAX_STRING
Schema Syntax of Trustee. |
static java.lang.String |
NAME_FIELD
Compare field for names. |
static java.lang.String |
RIGHTS_FIELD
Compare field for rights. |
static java.lang.String |
SCHEMA_BINDING_NAME
Schema Name of Trustee. |
static int |
TA_CREATE
Create rights. |
static int |
TA_DELETE
Delete rights. |
static int |
TA_MODIFY
Modify rights. |
static int |
TA_OWNERSHIP
Ownership rights. |
static int |
TA_READ
Read rights. |
static int |
TA_SEARCH
Search rights. |
static int |
TA_SUPERVISOR
Supervisor rights. |
static int |
TA_WRITE
Write rights. |
Constructor Summary | |
Trustee()
Creates the default constructor with all data members set to NULL or zero. |
|
Trustee(int objectRights)
Creates a constructor with the rights known and all other data members set to NULL or zero. |
|
Trustee(java.lang.String name)
Creates a constructor with the name known and all other data members set to NULL or zero. |
|
Trustee(java.lang.String name,
int objectRights)
Creates a constructor with all data members based on the input parameters. |
Method Summary | |
java.lang.Object |
clone()
Instantiates a new object of this type. |
boolean |
equals(java.lang.Object obj)
Compares the input object against this object for equality. |
java.lang.String |
getCompareString()
Returns the current value of compareString. |
boolean |
getCreateRights()
Returns a boolean value reflecting the state of the Create bit of the object rights mask. |
boolean |
getDeleteRights()
Returns the state of the Delete bit of the object rights mask as a boolean value. |
boolean |
getModifyRights()
Returns a boolean value reflecting the state of the Modify bit of the object rights mask. |
java.lang.String |
getName()
Returns this object's name field. |
boolean |
getOwnershipRights()
Returns a boolean value reflecting the state of the Ownership bit of the object rights mask. |
boolean |
getReadRights()
Returns a boolean value reflecting the state of the object rights mask Read bit. |
int |
getRights()
Returns the value of the objectRights data member. |
boolean |
getSearchRights()
Returns a boolean value reflecting the state of the Search bit of the object rights mask. |
com.novell.service.rfc1960.Rfc1960Parser |
getSearchStringParser()
Returns the RFC1960 search string parser for the compare string. |
boolean |
getSupervisorRights()
Returns a boolean value reflecting the state of the Supervisor bit of the object rights mask. |
boolean |
getWriteRights()
Returns a boolean value reflecting the state of the Write bit of the object rights mask. |
void |
setCompareString(java.lang.String compareString)
Sets the compare string value to allow individual compares on the name and rights fields. |
void |
setCreateRights(boolean value)
Sets the Create bit of the object rights mask based on the boolean input value. |
void |
setDeleteRights(boolean value)
Sets the Delete bit of the object rights mask based on the boolean input value. |
void |
setModifyRights(boolean value)
Sets the Modify bit of the object rights mask based on the boolean input value. |
void |
setName(java.lang.String name)
Sets the name field of the attribute. |
void |
setOwnershipRights(boolean value)
Sets the Ownership bit of the object rights mask based on the boolean input value. |
void |
setReadRights(boolean value)
Sets the Read bit of the objectRights mask based on the boolean input value. |
void |
setRights(int value)
Sets the objectRights data member of this object to the specified value. |
void |
setSearchRights(boolean value)
Sets the Search bit of the object rights mask based on the boolean input value. |
void |
setSupervisorRights(boolean value)
Sets the Supervisor bit of the object rights mask based on the boolean input value. |
void |
setWriteRights(boolean value)
Sets the Write bit of the object rights mask based on the boolean input value. |
java.lang.String |
toString()
Returns a String representation of this object. |
Methods inherited from class java.lang.Object |
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String ATTRIBUTE_ID
(ATTRIBUTE_ID = "Trustee")
public static final java.lang.String SCHEMA_BINDING_NAME
(SCHEMA_BINDING_NAME = ATTRIBUTE_ID + " Definition")
public static final java.lang.String COMPARE_SYNTAX_STRING
(COMPARE_SYNTAX_STRING = "(" + SearchStringComponent.EQUALS_STRING + "," + SearchStringComponent.PRESENT_STRING + "," + SearchStringComponent.SUBSTRING_STRING + ")")
public static final java.lang.String NAME_FIELD
(NAME_FIELD = "Name")
equals(Object)
public static final java.lang.String RIGHTS_FIELD
(RIGHTS_FIELD = "Rights")
equals(Object)
public static final int TA_READ
(TA_READ = 0x1)
getReadRights()
,
setReadRights(boolean)
public static final int TA_WRITE
(TA_WRITE = 0x2)
getWriteRights()
,
setWriteRights(boolean)
public static final int TA_CREATE
(TA_CREATE = 0x8)
getCreateRights()
,
setCreateRights(boolean)
public static final int TA_DELETE
(TA_DELETE = 0x10)
getDeleteRights()
,
setDeleteRights(boolean)
public static final int TA_OWNERSHIP
(TA_OWNERSHIP = 0x20)
getOwnershipRights()
,
setOwnershipRights(boolean)
public static final int TA_SEARCH
(TA_SEARCH = 0x40)
getSearchRights()
,
setSearchRights(boolean)
public static final int TA_MODIFY
(TA_MODIFY = 0x80)
getModifyRights()
,
setModifyRights(boolean)
public static final int TA_SUPERVISOR
(TA_SUPERVISOR = 0x0100)
Constructor Detail |
public Trustee()
public Trustee(java.lang.String name)
name
- The trustee name.public Trustee(int objectRights)
rights
- The trustee rights.public Trustee(java.lang.String name, int objectRights)
name
- The value of the name data member.objectRights
- The value of the objectRights data member.Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name to be assigned the attribute.public int getRights()
public void setRights(int value)
value
- The value to be set in the ojbectRights mask.public void setCompareString(java.lang.String compareString)
The names of these fields takes the names of their corresponding methods minus the get or set prefix. Given the following string:
"(&(Name=*printer*)(ObjectId>=2)(Rights>=128))" The equals() method will return TRUE if the Name contains the substring printer, the ObjectId is not 2, and Rights is >= 128. If the approximate operator type is used on the Rights field the various bits of the operand value are checked and if any of them are set, equals will return TRUE. For example: "(Rights~=3) returns TRUE if either the TA_READ or TA_WRITE bits are set, regardless of what other bits might be set.
If the string passed in is not a valid RFC1960 formatted string, an IllegalArgumentException will be thrown. If the compareString value is NULL, RFC1960 formatted compares will be disabled.
compareString
- The RFC1960 formatted search string. NULL
disables this compare functionality.equals(java.lang.Object)
,
NAME_FIELD
,
RIGHTS_FIELD
public java.lang.String getCompareString()
setCompareString(java.lang.String)
public com.novell.service.rfc1960.Rfc1960Parser getSearchStringParser()
Returns a Rfc1960Parser object that was instantiated with the compareString last set by the setCompareString method.
public void setReadRights(boolean value)
value
- A boolean set to TRUE if the Read bit is to be set;
otherwise set to FALSE if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getReadRights()
Returns the state of the corresponding bit in the rights mask. TRUE is returned if the corresponding bit is set, otherwise FALSE is returned.
getRights()
,
setRights(int)
public void setWriteRights(boolean value)
value
- A boolean set to TRUE if bit is to be set, otherwise
set to FALSE if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getWriteRights()
getRights()
,
setRights(int)
public void setCreateRights(boolean value)
value
- A boolean set to TRUE if bit is to be set; otherwise
set to FALSE if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getCreateRights()
getRights()
,
setRights(int)
public void setDeleteRights(boolean value)
value
- A boolean set to TRUE if bit is to be set; otherwise
FALSE is returned if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getDeleteRights()
getRights()
,
setRights(int)
public void setOwnershipRights(boolean value)
value
- A boolean value set to TRUE if bit is to be set;
otherwise set to FALSE if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getOwnershipRights()
getRights()
,
setRights(int)
public void setSearchRights(boolean value)
value
- A boolean value set to TRUE if bit is to be set;
otherwise set to FALSE if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getSearchRights()
getRights()
,
setRights(int)
public void setModifyRights(boolean value)
value
- A boolean set to TRUE if bit is to be set;
otherwise set to FALSE if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getModifyRights()
getRights()
,
setRights(int)
public void setSupervisorRights(boolean value)
value
- A boolean set to TRUE if bit is to be set;
otherwise set to FALSE if the bit is to be cleared.getRights()
,
setRights(int)
public boolean getSupervisorRights()
getRights()
,
setRights(int)
public boolean equals(java.lang.Object obj)
If the input object has a RFC1960 compare string, the comparision will be based on the commands in the compare string. If the operationType is illegal for the data type being compared, an IllegalArmumentException will be thrown.
obj
- The object to compare.setCompareString(java.lang.String)
,
NAME_FIELD
,
RIGHTS_FIELD
public java.lang.String toString()
public java.lang.Object clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |