ARoad0.gBaseInterface
Interface ImmutableAclEntry

All Superinterfaces:
ACSObject, BaseObject, java.lang.Cloneable, java.lang.Comparable, DetailledName, FinalizedObject, FinalizedObjectForUser
All Known Subinterfaces:
AclEntry
All Known Implementing Classes:
AclEntryImpl

public interface ImmutableAclEntry
extends java.lang.Cloneable, ACSObject, DetailledName, java.lang.Comparable

This important interface is responsible for modeling an access control entry which manages some access rights or some access restrictions from an eligible party to a resource. An AclEntry is external if its eligible party or its resource is from an ACS which is not the ACS of the AclEntry. It is possible to have a third ACS for the other end. It is not possible to have the same ACS for the two ends and another ACS for the ACL. For an internal ACL, the ACL ACS is the ACS of the two ends. An AclEntry is conditional when it uses some condition group(s). There are two types of conditional AclEntry, the simple-condition (or flexible) ACL and the right-condition ACL. A conditional ACL is for a GroupIDMember or an Actor (new in 0.7.1) as source. An external ACL may be conditional. Then, it cannot have more than one condition group, and this group has to belong to the ACS of one of the two ends (that is not always the ACL ACS). A resource in an ACS addon may inherit the ACL of its (in)direct parent(s), following the inheritance rules of the ACS addon.

The AclEntry is an alternative to the Privilege, but it allows the change of its rights while the Privilege cannot do it. The conditional AclEntry is an alternative to the LINKED_IF_ALL_SOURCES privilege, but it is focused to deliver rights to one source which has to be member of the condition groups.

The form of the detailled name for an internal ACL is:

- incomplete Eligible Party name >> incomplete Resource name || grant OR deny || first condition group last component.

For an external ACL, the form of the detailled name is:

- ACS: ACS_name | (full or incomplete) Eligible Party name >> (full or incomplete) Resource name || grant OR deny || <Source ACS group> OR <Target ACS group> || first condition group last component.

An Eligible Party or Resource name is incomplete if it belongs to the AclEntry ACS. The condition group is put in the name or the detailled name only for a flexible conditional AclEntry. '<XXXX ACS group>' is used only for an external ACL, when the condition group belongs to the XXXX ACS.

It is a javabean with the following bound properties: 'Comment', 'AclRights', 'ConditionSourceGroups'.

See Also:
EligibleParty, Resource

Method Summary
 java.lang.Object clone()
          Used by ACS.closeAclEntriesTo() when the links to other ACS have to be cut and cloned.
 AclEntry copy(Resource _newRes)
          Copy the AclEntry for a resource of the same ACS.
 boolean equals(java.lang.Object _obj)
           
 boolean getEnabledRights()
          Gets false only for a conditional AclEntry where the GroupIDMember source is not (in)direct member of a condition group.
 ImmutableACS getEorACS()
           
 ImmutableEligibleParty getEorEP()
           
 ImmutableACS getEorResACS()
           
 ImmutableResource getEorResource()
           
 ImmutableName getEpName()
          Caution: does not return a clone.
 java.util.List<ImmutableGroupID> getL_ConditionSourceGroups()
          To activate the ACL rights in a conditional AclEntry, the EP, if it is a groupmember, has to be member of each conditional GroupID.
 StringRight[] getL_Rights()
          Gets the effective rights for the eligible party upon the resource.
 ImmutableName getNameOfEpACS()
          Caution: does not return a clone.
 ImmutableName getNameOfResACS()
          Caution: does not return a clone.
 StringRight[] getNoConditionalRight()
          Gets the list of the internal conditional or no-conditional rights for the eligible party upon the resource, whatever the compliance to the conditions if there are some conditional groups.
 boolean getPositiveRight()
           
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
          Returns the change listeners for a property.
 ImmutableName getResName()
          Caution: does not return a clone.
 java.lang.String getResType()
          To use when it is possible to replace getEorResource().
 long getSerialVersionUID()
           
 java.lang.String getSource()
          Gets the access source displayed in the beamer.
 java.lang.String getTarget()
          Gets the access target displayed in the beamer.
 int hashCode()
           
 boolean isConditionalAclEntry()
          Gets true for a right-defined or a flexible conditional AclEntry.
 boolean isEmpty()
           
 boolean isExternalAclEntry()
          An external ACL has the source or the target from another ACS than the ACL ACS.
 boolean isRightDefinedConditionalAclEntry()
          Gets true for a right-defined conditional AclEntry.
 java.lang.String toString()
          The String presentation of the AclEntry
 
Methods inherited from interface ARoad0.gBaseInterface.ACSObject
getAcsName
 
Methods inherited from interface ARoad0.gBaseInterface.BaseObject
getFullName, getName, getNickName
 
Methods inherited from interface ARoad0.gBaseInterface.DetailledName
getDetailledName, getDetailledNameFromName, getKeyPropertiesFromDetailledName, getNameFromDetailledName
 
Methods inherited from interface ARoad0.gBaseInterface.FinalizedObjectForUser
finalizeForUser
 
Methods inherited from interface ARoad0.gBaseInterface.FinalizedObject
finalizeForBase
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getSource

java.lang.String getSource()
Gets the access source displayed in the beamer. The format is: 'full ep name as string'+'(ACL)'.

Returns:
String is the source name. May be null.

getTarget

java.lang.String getTarget()
Gets the access target displayed in the beamer. The format is: 'full resource name as string'+'(ACL)'.

Returns:
String is the target name. May be null.

isEmpty

boolean isEmpty()
Returns:
boolean true if equal to new AclEntryImpl()

getEorResource

ImmutableResource getEorResource()
Returns:
an external object reference to the resource that applies this AclEntry, without backup copy. Quite low, since it uses resourceACS.getEorM_Resources().

getEorEP

ImmutableEligibleParty getEorEP()

getL_Rights

StringRight[] getL_Rights()
Gets the effective rights for the eligible party upon the resource. If there is no condition group, the effective rights are the internal rights as returned by getNoConditionalRight(). If there are conditional groups and if the eligible party is a group member, the eligible party has to be a direct or indirect member of each conditional group, to return the internal rights. Otherwise, the condition rights are not workable, and an empty array is returned. If the eligible party is not a group member, the condition group(s) are forbbiden.

Returns:
String[] of rights as READ, CONNECT, DELETE... for the couple (resource, eligible party). Never null. May be an empty array.

getNoConditionalRight

StringRight[] getNoConditionalRight()
Gets the list of the internal conditional or no-conditional rights for the eligible party upon the resource, whatever the compliance to the conditions if there are some conditional groups.

Returns:
String[] of rights as READ, CONNECT, DELETE... for the couple (resource, eligible party). Never null. May be an empty array .

getEorACS

ImmutableACS getEorACS()
Specified by:
getEorACS in interface ACSObject
Returns:
ImmutableACS of this AclEntry, as an External Object Reference

getEorResACS

ImmutableACS getEorResACS()
Returns:
ImmutableACS of the AclEntry resource, as an External Object Reference.

getPositiveRight

boolean getPositiveRight()
Returns:
true if the right allows access to the resource, false if it forbids access.

getEpName

ImmutableName getEpName()
Caution: does not return a clone.

Returns:
ImmutableName of the AclEntry EligibleParty. May be null.

getResName

ImmutableName getResName()
Caution: does not return a clone.

Returns:
ImmutableName of the AclEntry resource. May be NameImpl.EMPTY_INSTANCE.

getResType

java.lang.String getResType()
To use when it is possible to replace getEorResource().

Returns:
the AclEntry resource type.

getNameOfEpACS

ImmutableName getNameOfEpACS()
Caution: does not return a clone.

Returns:
ImmutableName of the AclEntry EligibleParty ACS. May be null.

getNameOfResACS

ImmutableName getNameOfResACS()
Caution: does not return a clone.

Returns:
ImmutableName of the AclEntry resource ACS. May be null.

getL_ConditionSourceGroups

java.util.List<ImmutableGroupID> getL_ConditionSourceGroups()
To activate the ACL rights in a conditional AclEntry, the EP, if it is a groupmember, has to be member of each conditional GroupID. If the EP is not a groupmember, the effective rights are null.

Returns:
list of the conditional groups. May be empty, not null.

isRightDefinedConditionalAclEntry

boolean isRightDefinedConditionalAclEntry()
Gets true for a right-defined conditional AclEntry.

Returns:
true if the first right is a conditional right

isConditionalAclEntry

boolean isConditionalAclEntry()
Gets true for a right-defined or a flexible conditional AclEntry.

Returns:
true if the condition groups list is not null

isExternalAclEntry

boolean isExternalAclEntry()
An external ACL has the source or the target from another ACS than the ACL ACS. It may be a conditional ACL.

Returns:
true if the source or the target is from another ACS

getEnabledRights

boolean getEnabledRights()
Gets false only for a conditional AclEntry where the GroupIDMember source is not (in)direct member of a condition group. A conditional ACL having an Actor as source has always enabled rights (new in 0.7.1).

Returns:
true if the rights are workable

getPropertyChangeListeners

java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
Returns the change listeners for a property. Used by the AcsAddons.

Parameters:
_propertyName - name of the listened property.
Returns:
the change listeners. May be null or empty.

clone

java.lang.Object clone()
Used by ACS.closeAclEntriesTo() when the links to other ACS have to be cut and cloned. The ACS, the EP and the resource ACS are null in the returned AclEntry, and getEorResource() returns null. The properties are protected, so may be accessed by the package. Caution: the clone is not registered in its ACS, its resource or its EP, but equals() returns true when it compares a clone and its source.

Returns:
Object without external references (ACS, resource ACS and EligibleParty) and copy of the other properties, including the condition groups.

copy

AclEntry copy(Resource _newRes)
              throws CreateError
Copy the AclEntry for a resource of the same ACS. The AclEntry contains the same properties than this instance, and it is registered in its ACS, resource and EP.

Parameters:
_newRes - is a resource belonging to the same ACS
Returns:
an AclEntry with a new resource and a copy of the other properties.
Throws:
java.lang.InternalError - if _newRes is null.
CreateError - if _ep is already recorded in this resource with the same ACS and sens, or thrown by the ACS.newEorAclEntry().

equals

boolean equals(java.lang.Object _obj)
Specified by:
equals in interface BaseObject
Overrides:
equals in class java.lang.Object
Parameters:
_obj - is an Object to compare
Returns:
true if the variables are equals - not only identicals - and are from the _same_ class implementing AclEntry interface.

hashCode

int hashCode()
Specified by:
hashCode in interface BaseObject
Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode value for this object

getSerialVersionUID

long getSerialVersionUID()
Returns:
long is the uid used for serialization of the instance.

toString

java.lang.String toString()
The String presentation of the AclEntry

Overrides:
toString in class java.lang.Object
Returns:
String