|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.novell.service.file.nw.EffectiveRights
Provides an attribute interface for returning the effective rights of a file or a directory.
This class contains the following information about the effective rights of a file or directory:
The jndi.ds.Attribute.getAttributeID() returns Effective Rights as the attribute ID for this interface.
This object has a dual mode of operation. The first mode is the average user wanting to know what their effective rights are on a given directory entry. The second mode is requesting the effective rights of some other user on the system. This mode requires that the logged user have management rights (in the bindery) over the user name being requested. Also, it is enabled by the user setting the user name of the object.
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 classes 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 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.
Field Summary | |
static java.lang.String |
ATTRIBUTE_ID
Attribute ID of DirectoryEntryInformation. |
static java.lang.String |
COMPARE_SYNTAX_STRING
Schema Syntax of DirectoryEntryInformation. |
static java.lang.String |
RIGHTS_FIELD
Field specifier for searching on rights field. |
static java.lang.String |
SCHEMA_BINDING_NAME
Schema Class Definition Name of DirectoryEntryInformation. |
static int |
TA_ALL
Netware rights: Specifies all rights to the directory. |
static int |
TA_CREATE
Netware rights: Can create files. |
static int |
TA_DELETE
Netware rights: Can delete files. |
static int |
TA_MODIFY
Netware rights: Can modify the file attributes. |
static int |
TA_NONE
Netware rights: Cannot read or write. |
static int |
TA_OLD_OPEN
Netware rights: Can open existing file (obsolete). |
static int |
TA_OWNERSHIP
Netware rights: Can create and delete subdirectories, and can grant and revoke trustee rights. |
static int |
TA_READ
Netware rights: Can read. |
static int |
TA_SEARCH
Netware rights: Can search the directory. |
static int |
TA_SUPERVISOR
Netware rights: User has supervisor rights. |
static int |
TA_WRITE
Netware rights: Can write. |
static java.lang.String |
USER_FIELD
Field specifier for searching on user field. |
Constructor Summary | |
EffectiveRights()
Constructs an EffectiveRights object with all fields set to zero or NULL. |
|
EffectiveRights(int rights)
Constructs an EffectiveRights object with the passed in rights value and the user field set to NULL. |
|
EffectiveRights(int rights,
java.lang.String user)
Constructs an EffectiveRights object with the rights and user values set. |
|
EffectiveRights(java.lang.String user)
Constructs an EffectiveRights object with a user name, and the rights field is set to zero. |
Method Summary | |
java.lang.Object |
clone()
Clones this object. |
boolean |
equals(java.lang.Object obj)
Determines if the specified passed in object is equal to this EffectiveRights object. |
java.lang.String |
getCompareString()
Returns the current value of compareString. |
int |
getRights()
Returns the effective rights field. |
com.novell.service.rfc1960.Rfc1960Parser |
getSearchStringParser()
Returns the RFC1960 Search String parser for the compare string. |
java.lang.String |
getUser()
Returns a reference to this object's User field. |
void |
setCompareString(java.lang.String compareString)
Sets the compare string value for the Rights and User fields. |
void |
setRights(int value)
Sets the effective rights field. |
void |
setUser(java.lang.String value)
Sets the User field of the Attribute. |
java.lang.String |
toString()
Creates and returns a comma separated list of all attribute values. |
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 = "Entry Information")
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 RIGHTS_FIELD
(RIGHTS_FIELD = "Rights")
setCompareString(java.lang.String)
,
equals(java.lang.Object)
public static final java.lang.String USER_FIELD
(USER_FIELD = "User")
setCompareString(java.lang.String)
,
equals(java.lang.Object)
public static final int TA_NONE
(TA_NONE = 0x0000)
getRights()
,
setRights(int)
public static final int TA_READ
(TA_READ = 0x0001)
getRights()
,
setRights(int)
public static final int TA_WRITE
(TA_WRITE = 0x0002)
getRights()
,
setRights(int)
public static final int TA_OLD_OPEN
(TA_WRITE = 0x0004)
getRights()
,
setRights(int)
public static final int TA_CREATE
(TA_CREATE = 0x0008)
getRights()
,
setRights(int)
public static final int TA_DELETE
(TA_DELETE = 0x0010)
getRights()
,
setRights(int)
public static final int TA_OWNERSHIP
(TA_OWNERSHIP = 0x0020)
getRights()
,
setRights(int)
public static final int TA_SEARCH
(TA_SEARCH = 0x0040)
getRights()
,
setRights(int)
public static final int TA_MODIFY
(TA_MODIFY = 0x0080)
getRights()
,
setRights(int)
public static final int TA_SUPERVISOR
(TA_SUPERVISOR = 0x0100)
getRights()
,
setRights(int)
public static final int TA_ALL
(TA_ALL = 0x00FB)
getRights()
,
setRights(int)
Constructor Detail |
public EffectiveRights()
setUser(java.lang.String)
,
setRights(int)
,
getUser()
,
getRights()
public EffectiveRights(java.lang.String user)
user
- The user data member value.setUser(java.lang.String)
,
setRights(int)
,
getUser()
,
getRights()
public EffectiveRights(int rights)
rights
- The rights data member value.setUser(java.lang.String)
,
setRights(int)
,
getUser()
,
getRights()
public EffectiveRights(int rights, java.lang.String user)
rights
- The rights data member value.user
- The user data member value.setUser(java.lang.String)
,
setRights(int)
,
getUser()
,
getRights()
Method Detail |
public int getRights()
public void setRights(int value)
value
- The effective rights value.public java.lang.String getUser()
public void setUser(java.lang.String value)
value
- The User for which to set the effective rights.public void setCompareString(java.lang.String compareString)
See the various SearchStringComponent compare methods referenced below for detailed information on the operation types allowed for String and integer data members.
The names of these fields have taken the names of their corresponding methods minus the get or set prefix. Given the following string: "(&(User=*test*)(Rights>=128))"
The equals() method returns TRUE if the user has the substring test in it, and the rights are set to be able to modify (TA_MODIFY). 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, this method will throw an IllegalArgumentException. If the compareString value is NULL, RFC1960 formated compares will be disabled.
compareString
- The RFC1960 formated search string. NULL
disables this compare functionality.equals(java.lang.Object)
,
DirectoryEntryInformation.SPACEALLOC_FIELD
public java.lang.String getCompareString()
Trustee.setCompareString(java.lang.String)
public com.novell.service.rfc1960.Rfc1960Parser getSearchStringParser()
Returns a Rfc1960Parser that was instantiated when the compareString was last set by the setCompareString() method.
public boolean equals(java.lang.Object obj)
The input object is compared against this object. If the input object has a RFC1960 compare string, this method will do the comparison based on the commands in the compare string.
obj
- The object to compare.setCompareString(java.lang.String)
public java.lang.String toString()
public java.lang.Object clone()
clone() instantiates a new instance of this type and assigns all fields using the current values of the fields in this directory entry information object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |