ARoad0.gBaseInterface
Interface StringRight

All Superinterfaces:
BaseObject, BoundBean, java.lang.Comparable, FinalizedObject, FinalizedObjectForUser, java.io.Serializable
All Known Subinterfaces:
StringMetaRight
All Known Implementing Classes:
StringMetaRightImpl, StringRightImpl

public interface StringRight
extends BaseObject, java.io.Serializable, java.lang.Comparable, FinalizedObjectForUser, BoundBean

This interface is responsible for managing the ACS rights, of all the base objects in an ACS. It handles the links to the upper and lower rights in the rights network, allowing comparison, and the next upper and lower rights.

The ACS right may be classed, that is associated to a target class, or typed, that is associated to a type in a target class. If it is typed, it is classed.

For instance, in LCA Lotus Notes, 'read_javascript' is a typed right for the target class Actor, where 'javascript' is a type of Actor. When a right is classed or typed, the class and the type may be superior to the right container (AGO, ACL, PRI, BDG) specification, or may be inferior, and this is specified by the ACS policy. For instance, if an ACL has an actor as target, and if it uses a classed right where the target class is Directory, then the ACL will be effective only if its ACS sets that the ACL specification is superior to the right specification. The ACS may also set that both specifications are applicable.

Two-levels right is managed as one parent right which has a detailled description in a set of lower rights. The parent is the unique upper right of these slave rights. Multi-level rights is a generalization where a right is both a parent and a slave. Some rights set may have these tree structure without be marked and displayed as multi-level rights.

The right has a generic equivallent called a StringMetaRight, which is used to compare rights from different ACS.


Method Summary
 int compareTo(java.lang.Object _o)
          Compare two StringRight instances through the internal key and, if not null, acsname comparisons, whatever the right, sens, power and field.
 boolean equals(java.lang.Object _obj)
          Compares the two StringRights.
 void finalizeForUser()
          This method removes the StringRight from the ACS list, from the metaright, from the lower and upper rights.
 ImmutableName getAcsName()
           
 java.lang.String getComment()
           
 StringMetaRight getEorMetaRight()
          Get the global Access Road right which is a generic description of this ACS right.
 ImmutableName getFullName()
          The full name is unique for the Access Road program.
 int getInternalKey()
           
 StringRight[] getLowerRights()
          Get the set of lower rights which are strictly lesser than this right without any intermediate right, following the network of rights.
 java.lang.String getNickName()
          Get a short name limited to 5 characters if positive, 6 characters if starts with '|' and positive, and 7 if negative, for displaying this right in the views.
 java.lang.String getRight()
          If the right is not typed, the result contains the kernel right only.
 java.lang.String getTargetClass()
           
 java.lang.String getTargetClassType()
           
 StringRight[] getUpperRights()
          Get the set of upper rights which are strictly greater than this right without any intermediate right, following the network of rights.
 int hashCode()
           
 boolean isDesactivated()
          Get if the right is desactivated.
 boolean isEmpty()
           
 boolean isGrantingRight()
           
 boolean isParent()
           
 boolean isSlave()
          A slave right has a strong link with a parent right.
 boolean isTargetClassed()
           
 boolean isTargetClassTyped()
           
 void setComment(java.lang.String _s)
           
 void setDesactivated(boolean _b)
          Set that the right is desactivated.
 void setParent(boolean _b)
          Set the right as parent of lower rights - the slaves - in a multi-level right.
 void setSlave(boolean _b)
          Set the right an unique upper right - the parent - in a multi-level right.
 java.lang.String toString()
           
 
Methods inherited from interface ARoad0.gBaseInterface.BaseObject
getName
 
Methods inherited from interface ARoad0.gBaseInterface.FinalizedObject
finalizeForBase
 
Methods inherited from interface ARoad0.gBaseInterface.BoundBean
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Method Detail

getAcsName

ImmutableName getAcsName()
Returns:
ImmutableName of the ACS that owns this object. Empty if it is an embedded right or a metaright.

getFullName

ImmutableName getFullName()
The full name is unique for the Access Road program. It contains generally more information than getName().

Specified by:
getFullName in interface BaseObject
Returns:
a copy of the name. Empty for an empty object.

getNickName

java.lang.String getNickName()
Get a short name limited to 5 characters if positive, 6 characters if starts with '|' and positive, and 7 if negative, for displaying this right in the views. If right_ is 'read', the nick name is the same. If right_ is 'read&execute', the nick name is 'read&'. If right_ is '|run_under|', the nick name is '|run_u'. If right_ contains '_', the nick name 2 last characters are '_%' where '%' is here the character at the right of the last '_' in right_. For example, 'write_for_directory' gives 'wri_d'. The nick name for a negative right starts with 'd_', if the right starts by 'deny_'. The other parts of the nick name are like for a positive right. If right is 'deny_read', the nick name is 'd_read'. If the right is 'deny_write_for_directory', the nick name is 'd_wri_d'. If the negative right does not start with 'deny_', it is processed like a positive right and the nick name size is limited to 5. This short name is NOT unique for the Access Road program, nor for the ACS if it is an ACS object.

Specified by:
getNickName in interface BaseObject
Returns:
the nick name. Never null.

isTargetClassed

boolean isTargetClassed()
Returns:
true if the right is always associated to a class for a target, as for exemple 'delete_Actor' for the class Actor.

isTargetClassTyped

boolean isTargetClassTyped()
Returns:
true if the right is always associated to a type for a target class, as for exemple in LCA Lotus Notes 'read_javascript' for the class Actor.

isGrantingRight

boolean isGrantingRight()
Returns:
true if the right is a granting right - the opposite one is a denying right.

isParent

boolean isParent()
Returns:
true if the right is a parent of lower rights - the slaves - in a multi-level right.

isSlave

boolean isSlave()
A slave right has a strong link with a parent right.

Returns:
true if the right has an unique upper right - the parent - in a multi-level right.

setParent

void setParent(boolean _b)
               throws BaseError
Set the right as parent of lower rights - the slaves - in a multi-level right. There is no inverse method. This method has to be used before the set of the lower rights. Caution: some lower rights may be not slaves, so this instance may be not parent for all its lower rights.

Parameters:
_b - is true to set the right as parent
Throws:
BaseError - if there are lower rights.

setSlave

void setSlave(boolean _b)
              throws BaseError
Set the right an unique upper right - the parent - in a multi-level right. There is no inverse method.

Parameters:
_b - is true to set the right as slave
Throws:
BaseError - if there is not exactly one upper right, or if it is not a parent.

setDesactivated

void setDesactivated(boolean _b)
Set that the right is desactivated. Used to create a list of flat rights with one single desactivated root.

Parameters:
_b - is true to desactivate the right

isDesactivated

boolean isDesactivated()
Get if the right is desactivated.


getRight

java.lang.String getRight()
If the right is not typed, the result contains the kernel right only. If the right is typed (for ACS rights only), the result contains the kernel right and the target class type.

Returns:
the right to apply

getInternalKey

int getInternalKey()
Returns:
the internal key

getTargetClass

java.lang.String getTargetClass()
Returns:
the class from which the type is provided. Null if the right is not classed.

getTargetClassType

java.lang.String getTargetClassType()
Returns:
the target typed right. Null if the right is not typed or if it is a metaright.

getUpperRights

StringRight[] getUpperRights()
Get the set of upper rights which are strictly greater than this right without any intermediate right, following the network of rights.

Returns:
is an array of connected rights which are strictly greater than this right. Never null but may be empty.

getLowerRights

StringRight[] getLowerRights()
Get the set of lower rights which are strictly lesser than this right without any intermediate right, following the network of rights.

Returns:
is an array of rights which are strictly lesser than right. Never null but may be empty.

getEorMetaRight

StringMetaRight getEorMetaRight()
Get the global Access Road right which is a generic description of this ACS right. Metarights are used in the rights comparision and analysis to compare rights from different ACS.

Returns:
as a generic description of the right. Is null only when the instance is embedded in a StringMetaRightImpl.

isEmpty

boolean isEmpty()
Returns:
true if the instance is equals to an empty instance

getComment

java.lang.String getComment()
Returns:
a comment which is associated to the right. May be null.

setComment

void setComment(java.lang.String _s)
Parameters:
_s - is a comment which is associated to the right.

equals

boolean equals(java.lang.Object _obj)
Compares the two StringRights.

Specified by:
equals in interface BaseObject
Overrides:
equals in class java.lang.Object
Parameters:
_obj - to compare
Returns:
true if the properties are the same

hashCode

int hashCode()
Specified by:
hashCode in interface BaseObject
Overrides:
hashCode in class java.lang.Object
Returns:
is the hashcode value for this instance. May be null.

compareTo

int compareTo(java.lang.Object _o)
              throws java.lang.ClassCastException
Compare two StringRight instances through the internal key and, if not null, acsname comparisons, whatever the right, sens, power and field. All metarights are superior to any acsright. The comparison of the rights xx and deny_xx returns 0.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
_o - to compare
Returns:
0 if the rights have the same internal key and acsname, a negative integer if this object is lesser than the argument, and a positive integer if this object is greater than the argument.
Throws:
java.lang.ClassCastException - - if the specified object's type prevents it from being compared to this current Object

finalizeForUser

void finalizeForUser()
                     throws UpDateError
This method removes the StringRight from the ACS list, from the metaright, from the lower and upper rights. If the instance is a parent, all slaves are also finalized.

Specified by:
finalizeForUser in interface FinalizedObjectForUser
Throws:
UpDateError - if the ACS does not known the right (if it is a clone, typically), if the metaright is wrong, or if a lower or upper right is not correct.

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
getRight()