ARoad0.gBase
Class GroupIDImpl

java.lang.Object
  extended by ARoad0.gBase.BasicImpl
      extended by ARoad0.gBase.EligiblePartyImpl
          extended by ARoad0.gBase.GroupIDMemberImpl
              extended by ARoad0.gBase.GroupIDImpl
All Implemented Interfaces:
ACSObject, BaseBeanManager, BaseObject, Basic, BoundBean, Copyable, EligibleParty, FinalizedObject, FinalizedObjectForUser, GroupID, GroupIDMember, ImmutableBasic, ImmutableEligibleParty, ImmutableGroupID, ImmutableGroupIDMember, ImmutablePrivilegeSource, ImmutableSource, ImmutableTarget, PrivilegeSource, PrivilegeUser, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
GroupIDMySQLImpl

public class GroupIDImpl
extends GroupIDMemberImpl
implements GroupID, java.io.Serializable

This class is responsible for modeling a GroupIDMember that owns a set of members, and which has Account/Group rights on Resources. Typically, it handles a set of user accounts and groupIDs. The membership links between the groupID and each member are managed by the GroupID. Resources and actors may also be registered as owned by a groupID, in two different lists. An actor may also have a groupID as a current group under which it runs, and such an actor is registered in a third list.

It is a javabean with the following bound properties: 'l_Members', 'l_GroupIDCurrentActors', 'l_GroupIDOwnResources', 'l_GroupIDCurrentActorsAsSecondaryGroup'. The listeners are proper to this instance, outside gBase, transient (not serialized in this instance backup). They are called in any order. They receive only a copy of the new value, to protect the property. All the exceptions from the listeners are catched, and a dialog box is displayed to inform the user.

This class has several subclasses in this package and in the AcsAddon packages. Most of the variables are protected.

See Also:
Serialized Form

Field Summary
static GroupIDImpl EMPTY_INSTANCE
          A reusable empty instance for initialization, to avoid the use of 'new' for temporary values.
protected  Actor[] l_currentActors_
           
protected  GroupIDMember[] l_Members_
           
protected  Resource[] l_ownResources_
           
protected  Actor[] l_secGroupActors_
           
protected  int order_
           
static java.io.ObjectStreamField[] serialPersistentFields
          variable for the JDK 2 serialization
private static long serialVersionUID__
           
 
Fields inherited from class ARoad0.gBase.GroupIDMemberImpl
isAdmin_, l_Groups_
 
Fields inherited from class ARoad0.gBase.EligiblePartyImpl
m_AclEntriesResources_
 
Fields inherited from class ARoad0.gBase.BasicImpl
aCS_, aCS_Name_, aliasHandler_, changeSupport_, comment_, folderMember_, INCREMENT_CAPACITY, INITIAL_CAPACITY, INITIAL_CAPACITY_2, iS_Name_, m_ConstrainedChildACS_, name_, PRIME, privHandler_, type_
 
Constructor Summary
GroupIDImpl()
          Default constructor
GroupIDImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, java.lang.Boolean _isAdmin)
          Constructor used in the beamer by the editor for the ACS EP list, from 'New'.
GroupIDImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, boolean _isAdmin, boolean _toRegisterInManager)
          Used for the creation of a groupID.
 
Method Summary
protected  void addCurrentActor(Actor _act)
          Used by Actor.setEorCurrentGroupID.
 void addEorMember(GroupIDMember _gm)
          Adds a GroupIDMember as a member of this groupID, and update the member through the addGroupToGM method.
protected  void addOwnActorAsSecondaryGroup(Actor _act)
          Invoked by Actor.setEorL_SecondaryGroup().
protected  void addOwnResource(Resource _res)
          Used by Resource.setEorGroupID().
 java.lang.Object clone()
          Clone without register the new object in the ACSs.
 boolean containsAsIndirectMember(ImmutableGroupIDMember _ep)
          Test if an eligible party is an indirect member of this GroupID, or if it is an hard alias having a reference which is an indirect member.
 boolean containsAsIndirectMemberWithoutAliasing(ImmutableGroupIDMember _ep)
          Test if an eligible party is an indirect member of this GroupID, and do not test if it is an alias having a reference which is an indirect member.
 boolean containsAsMember(ImmutableGroupIDMember _ep)
          Tests if an eligible party is a direct member of this GroupID, or if it has an alias which is a direct member.
 boolean containsAsMemberWithoutAliasing(ImmutableGroupIDMember _ep)
          Deprecated. _ep to test
 java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager)
          This method provides a copy of the instance with another name.
protected  GroupIDImpl copyOwnVariables(GroupIDImpl _result, boolean _withoutInternalAcl)
          This method provides a copy of the instance variables.
 java.lang.Object copyWithoutInternalAcl(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager)
          This method provides a copy of the instance as copy(), but without copying the EligibleParty internal aclEntries.
 boolean equals(java.lang.Object _obj)
          Does not compare the comment.
protected  void finalize()
          This method removes the groupID from the ACS lists, but there is no guaranee that the JVM calls this method before the end of the application.
 void finalizeForBase()
          This method removes the members, and the resources through the variable groupID_ and, for Actors, through currentGroupID_ and l_SecondaryGroup_.
protected  void finalizeFromDeserialization()
          This method finalizes each group members, since it is used after a deserialization.
 Actor[] getEorL_GroupIDCurrentActors()
          A current actor runs under this groupID.
 Actor[] getEorL_GroupIDCurrentActorsAsSecondaryGroup()
          Get the actors in the ACS that have, in the role of a running processes, this group as a secondary groupID.
 Resource[] getEorL_GroupIDOwnResources()
          A currentGroupID or a secondary groupID is a property of an actor, which is a kind of resource.
 ImmutableGroupIDMember[] getEorL_Members()
          Get the ordered array of this GroupID members.
 GroupID getFirstIntermediateForIndirectMember(ImmutableGroupIDMember _ep)
          Gets the first member which contains the argument as member or indirect member.
static AclEntry[] getL_ConditionalACLsOfOneConditionGroupIndirectMember(ImmutableGroupID _grp)
          NO USE.
static ImmutableGroupID[] getL_IntermediateGroupsOfAclConditionalGroups(ImmutableAclEntry _acl)
          Gets, for a conditional AclEntry, all the effective or potential intermediate GroupIDs, in the chain from the source to each condition group.
 int getOrder()
           
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
          Returns the change listeners for a property.
 long getSerialVersionUID()
          For the java serialization.
 int hashCode()
           
 boolean isConditionalACLtoResetAfterMembershipChangeInThisGroup(ImmutableAclEntry _acl, ImmutableGroupIDMember _member)
          Detects if it is a conditional AclEntry from this group ACS, for which a change in the groupidmember membership relation to this group is able to change the membership chain from the AclEntry source to at least one condition group of the AclEntry.
 boolean ownsResource(Resource _res)
           
protected  void removeCurrentActor(Actor _act)
          Used by Actor.finalizeForBase(), Actor.setEorCurrentGroupID().
 void removeEorMember(GroupIDMember _gm)
          Removes a groupID member, and update the member through the removeGroupToGM method, if the group is not immutable.
protected  void removeOwnActorAsSecondaryGroup(Actor _act)
          Invoked by Actor.setEorL_SecondaryGroup() and Actor.finalizeForBase().
protected  void removeOwnResource(Resource _res)
          Used by Resource.setEorGroupID() and finalizeForBase().
 void setEorL_Members(GroupIDMember[] _L)
          Defines the groupID members, and updates the members through the add/removeGroupToGM methods.
 void setOrder(int _i)
          Set the order of the GroupID which determines its priority among in access control decisions - on Unix : 16-bit group identifier (GID).
 java.lang.String toString()
          Gets the name last component of the instance.
 
Methods inherited from class ARoad0.gBase.GroupIDMemberImpl
addGroupToGM, addPropertyChangeListener, copy, copyOwnVariables, copyWithoutAcl, getEorL_GroupID, isAdmin, removeGroupToGM, removePropertyChangeListener
 
Methods inherited from class ARoad0.gBase.EligiblePartyImpl
addAclEntryToEP, addEorPrivilegeForLinksToSource, addEorPrivilegeForTypeToSource, copyOwnVariables, deleteAclEntries, getEorL_AclConnectedResources, getEorL_SourcePrivilegeForLinks, getEorL_SourcePrivilegeForTypes, getEorL_SourcePrivileges, getEPType, removeAclEntryToEP, removeEorPrivilegeToSource, setEPType
 
Methods inherited from class ARoad0.gBase.BasicImpl
addAcsOfSoftReferences, addConstrainedChildACS, addEorSoftAlias, addInVFolderList, addInViewList, addPropertyChangeListener, compareTo, copyOwnVariables, finalizeForUser, firePropertyChange, getAcsName, getComment, getEorACS, getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getFullName, getHasSoftAlias, getImpliedViews, getIS_Name, getL_AcsOfSoftReferences, getL_SoftAlias, getM_ConstrainedChildACS, getName, getNickName, getType, getVirtualFolders, removeAcsOfSoftReferences, removeConstrainedChildACS, removeEorSoftAlias, removeInVFolderList, removeInViewList, removePropertyChangeListener, setComment, setEorAliasAsInternalHardReference, setEorReferenceAsInternalHardAlias, setType
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ARoad0.gBaseInterface.GroupIDMember
addGroupToGM, removeGroupToGM
 
Methods inherited from interface ARoad0.gBaseInterface.EligibleParty
setEPType
 
Methods inherited from interface ARoad0.gBaseInterface.Basic
finalizeForUser, setComment
 
Methods inherited from interface ARoad0.gBaseInterface.PrivilegeSource
addEorPrivilegeForTypeToSource, removeEorPrivilegeToSource
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableGroupIDMember
getEorL_GroupID, isAdmin
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableEligibleParty
getEorL_AclConnectedResources, getEPType, getM_ConstrainedChildACS
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableBasic
getComment, getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getImpliedViews, getIS_Name, getL_AcsOfSoftReferences, getL_SoftAlias, getVirtualFolders
 
Methods inherited from interface ARoad0.gBaseInterface.BoundBean
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutablePrivilegeSource
getEorL_SourcePrivilegeForLinks, getEorL_SourcePrivilegeForTypes, getEorL_SourcePrivileges
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableSource
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias, getType
 
Methods inherited from interface ARoad0.gBaseInterface.ACSObject
getAcsName, getEorACS
 
Methods inherited from interface ARoad0.gBaseInterface.BaseObject
getFullName, getName, getNickName
 
Methods inherited from interface ARoad0.gBaseInterface.BaseBeanManager
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableTarget
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias, getType
 

Field Detail

serialVersionUID__

private static final long serialVersionUID__
See Also:
Constant Field Values

l_Members_

protected GroupIDMember[] l_Members_

order_

protected int order_

l_ownResources_

protected Resource[] l_ownResources_

l_currentActors_

protected Actor[] l_currentActors_

l_secGroupActors_

protected Actor[] l_secGroupActors_

EMPTY_INSTANCE

public static final GroupIDImpl EMPTY_INSTANCE
A reusable empty instance for initialization, to avoid the use of 'new' for temporary values. Caution: never change the state of the returned instance.


serialPersistentFields

public static final java.io.ObjectStreamField[] serialPersistentFields
variable for the JDK 2 serialization

Constructor Detail

GroupIDImpl

public GroupIDImpl()
Default constructor


GroupIDImpl

public GroupIDImpl(ImmutableName _name,
                   ACS _acs,
                   java.lang.String _epType,
                   java.lang.Boolean _isAdmin)
            throws CreateError
Constructor used in the beamer by the editor for the ACS EP list, from 'New'. The last component of _name cannot end with '_tree>' to avoid any confusion with the second nodes under GROUPS in the explorer.

Parameters:
_name - ImmutableName of the groupID
_acs - ACS of the groupID
_epType - is the eligible party type, and may be null if the ACS allows it.
_isAdmin - true only if the instance has an administrative role in the ACS, for the technical administration or the users
Throws:
CreateError - if _name ends with '_tree>', or if ACSImpl.newEorEligibleParty() throws it - the instance must then be deleted !

GroupIDImpl

public GroupIDImpl(ImmutableName _name,
                   ACS _acs,
                   java.lang.String _epType,
                   boolean _isAdmin,
                   boolean _toRegisterInManager)
            throws CreateError
Used for the creation of a groupID. This method is used by copy().

Parameters:
_name - ImmutableName of the eligible party to create
_acs - Main ACS of the eligible party to create
_epType - is the eligible party type, and may be null if the ACS allows it.
_isAdmin - true only if the instance has an administrative role in the ACS, for the technical administration or the users
_toRegisterInManager - false if this method must not register the instance in its ACS.
Throws:
CreateError - if ACSImpl.newEorEligibleParty() throws it - the instance must then be deleted !
Method Detail

copy

public java.lang.Object copy(ImmutableName _name,
                             ACS _acs,
                             Directory _parent,
                             java.lang.Boolean _toRegisterInManager)
                      throws CreateError
This method provides a copy of the instance with another name. The copy order is 3 times the source order. Does not copy the GroupID members, nor the own resources, the current actors, the own actors. To copy all these links, you have to copy first the GroupID, then to copy the GroupIDMembers, the Resources and the Actors to copy the links. Call copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copy in interface Copyable
Overrides:
copy in class EligiblePartyImpl
Parameters:
_name - copy name. Usually creates as an extension of _parent name.
_acs - main ACS of the copy to create. May not be the ACS of this instance.
_parent - is not used, wathever the value.
_toRegisterInManager - false if this method must not register the instance in the ACS.
Returns:
a new instance of GroupImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs, or addAclEntry() exceptions.

copyWithoutInternalAcl

public java.lang.Object copyWithoutInternalAcl(ImmutableName _name,
                                               ACS _acs,
                                               Directory _parent,
                                               java.lang.Boolean _toRegisterInManager)
                                        throws CreateError
This method provides a copy of the instance as copy(), but without copying the EligibleParty internal aclEntries. The copy order is 3 times the source order. Does not copy the GroupID members, nor the own resources, the current actors, the own actors. To copy all these links, you have to copy first the GroupID, then to copy the GroupIDMembers, the Resources and the Actors to copy the links. Calls copyOwnVariables(). Called by ACSImpl.copy(). This method is overridden by the subclasses.

Specified by:
copyWithoutInternalAcl in interface EligibleParty
Overrides:
copyWithoutInternalAcl in class EligiblePartyImpl
Parameters:
_name - copy name. Usually creates as an extension of _parent name.
_acs - main ACS of the copy to create. May not be the ACS of this instance.
_parent - is not used, wathever the value.
_toRegisterInManager - false if this method must not register the instance in the ACS.
Returns:
a new instance of GroupImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs.

setEorL_Members

public void setEorL_Members(GroupIDMember[] _L)
                     throws CreateError
Defines the groupID members, and updates the members through the add/removeGroupToGM methods. This method is synchronized on l_Members_. Fire an 'l_Members' event. Not used by the GUI which used add/removeEorMember(). Does not control the type. Called by finalizeForBase(null) and gWork.AcsFactory. Control the presence of a loop between groupIDs. Note: members are independant to the own actors and current actors of the groupID.

Specified by:
setEorL_Members in interface GroupID
Parameters:
_L - is the members of the GroupID. May be null. The new children array is sorted with ImmutableEligibleParty.compareTo(); null and empty instances are removed.
Throws:
java.lang.InternalError - if one element is not known by the main ACS, if the main ACS has no registered eligible parties.
CreateError - if a _L element does not belong to the ACS, or if it is a GroupID which has this instance has direct or indirect member

addEorMember

public void addEorMember(GroupIDMember _gm)
                  throws CreateError
Adds a GroupIDMember as a member of this groupID, and update the member through the addGroupToGM method. Controls the presence of a loop through nested groupIDs, including aliasings. Controls the ACS constraints for 'GroupIDMember.NoMemberOf', 'GroupID.MemberFromAdmin', 'GroupID.NoUserIDAsMember', 'GroupID.NoGroupIDAsMember', 'GroupID.NoMoreThanOneMember', 'GroupID.TypesOfMemberFor', 'GroupIDMember.NoMoreThanOneGroup.' to checkup the operation is allowed by the ACS. Calls isConditionalACLtoResetAfterMembershipChangeInThisGroup() and AclEntry.resetRightsAsInheritedAclEntry(). This method is synchronized on l_Members_. Fire an 'l_Members' event.

Specified by:
addEorMember in interface GroupID
Parameters:
_gm - new member of the GroupID. No action if null, empty.
Throws:
CreateError - if _gm is a GroupID which has this instance has direct or indirect member, if _gm is already a member, or if the _gm type is not authorized by the ACS, or if the type does not allow the operation, if this group is immutable, or if it is mutable and not the new member.

removeEorMember

public void removeEorMember(GroupIDMember _gm)
                     throws CreateError
Removes a groupID member, and update the member through the removeGroupToGM method, if the group is not immutable. Calls isConditionalACLtoResetAfterMembershipChangeInThisGroup() and AclEntry.resetRightsAsInheritedAclEntry(). This method is synchronized on l_Members_.

Specified by:
removeEorMember in interface GroupID
Parameters:
_gm - member of the GroupID. No action if unknown, null, empty.
Throws:
CreateError - if the type does not allow the operation

getEorL_Members

public ImmutableGroupIDMember[] getEorL_Members()
Get the ordered array of this GroupID members. If empty, returns GroupIDMemberImpl[0].

Specified by:
getEorL_Members in interface ImmutableGroupID
Returns:
a copy of GroupID members. Never null. This is an ordered list without null member, and without empty member after the first update.

containsAsMember

public boolean containsAsMember(ImmutableGroupIDMember _ep)
Tests if an eligible party is a direct member of this GroupID, or if it has an alias which is a direct member. It is an identity test, not with equals(). Returns for the moment the same result as containsAsMemberWithoutAliasing(). Synchronized on l_Members_.

Specified by:
containsAsMember in interface ImmutableGroupID
Parameters:
_ep - to test
Returns:
true if _ep is a member of the GroupID.

containsAsMemberWithoutAliasing

public boolean containsAsMemberWithoutAliasing(ImmutableGroupIDMember _ep)
Deprecated. _ep to test

Test if an eligible party is a direct member of this GroupID, and do not test if it has an alias which is a direct member. Return actually the same result that containsAsMember(). Called by UserID.setEorPrimGroup(). Synchronized on l_Members_.

Specified by:
containsAsMemberWithoutAliasing in interface ImmutableGroupID
Returns:
true if _ep is a member of the GroupID.

containsAsIndirectMember

public boolean containsAsIndirectMember(ImmutableGroupIDMember _ep)
Test if an eligible party is an indirect member of this GroupID, or if it is an hard alias having a reference which is an indirect member. Caution: if the argument is the alias of a GroupIDMember, the test is applied only to the reference as potential member, and not to the argument. Synchronized on l_Members_.

Specified by:
containsAsIndirectMember in interface ImmutableGroupID
Parameters:
_ep - to test
Returns:
true if _ep is an indirect member of the GroupID, or its alias reference.

getFirstIntermediateForIndirectMember

public GroupID getFirstIntermediateForIndirectMember(ImmutableGroupIDMember _ep)
Gets the first member which contains the argument as member or indirect member. Calls containsAsMember() and containsAsIndirectMember(). Returns null if _ep is a member. Synchronized on l_Members_.

Specified by:
getFirstIntermediateForIndirectMember in interface ImmutableGroupID
Parameters:
_ep - to test. May be null.
Returns:
the first member. May be null.

containsAsIndirectMemberWithoutAliasing

public boolean containsAsIndirectMemberWithoutAliasing(ImmutableGroupIDMember _ep)
Test if an eligible party is an indirect member of this GroupID, and do not test if it is an alias having a reference which is an indirect member. Synchronized on l_Members_.

Specified by:
containsAsIndirectMemberWithoutAliasing in interface ImmutableGroupID
Returns:
true if _ep is a member of the GroupID.

getPropertyChangeListeners

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

Specified by:
getPropertyChangeListeners in interface ImmutableBasic
Overrides:
getPropertyChangeListeners in class GroupIDMemberImpl
Parameters:
_propertyName - name of the listened property.
Returns:
the change listeners. May be null or empty.

setOrder

public void setOrder(int _i)
Set the order of the GroupID which determines its priority among in access control decisions - on Unix : 16-bit group identifier (GID). Not used by the GUI

Specified by:
setOrder in interface GroupID
Parameters:
_i - is the order of the groupID - on Unix : 16-bit group identifier (GID)

getOrder

public int getOrder()
Specified by:
getOrder in interface ImmutableGroupID
Returns:
the order of the groupID - on Unix : 16-bit user identifier (UID)

addOwnActorAsSecondaryGroup

protected void addOwnActorAsSecondaryGroup(Actor _act)
Invoked by Actor.setEorL_SecondaryGroup(). Fires an event 'l_GroupIDCurrentActorsAsSecondaryGroup'.

Parameters:
_act - Actor for which this groupID is a secondary groupID. May be null.

getEorL_GroupIDOwnResources

public Resource[] getEorL_GroupIDOwnResources()
A currentGroupID or a secondary groupID is a property of an actor, which is a kind of resource. But these actors are NOT returned by this method.

Specified by:
getEorL_GroupIDOwnResources in interface ImmutableGroupID
Returns:
array of the resources in the ACS for which this group is their primary groupID. May be empty, but never null.

ownsResource

public boolean ownsResource(Resource _res)
Specified by:
ownsResource in interface ImmutableGroupID
Returns:
true if it owns the resource.

getEorL_GroupIDCurrentActors

public Actor[] getEorL_GroupIDCurrentActors()
A current actor runs under this groupID. A current actor may be an own resource of this groupID or not.

Specified by:
getEorL_GroupIDCurrentActors in interface ImmutableGroupID
Returns:
array of the current actors attached to this groupID. May be empty but not null.

getEorL_GroupIDCurrentActorsAsSecondaryGroup

public Actor[] getEorL_GroupIDCurrentActorsAsSecondaryGroup()
Get the actors in the ACS that have, in the role of a running processes, this group as a secondary groupID. If this groupID is the main groupID or the current groupID of an actor, it is NOT returned by this method.

Specified by:
getEorL_GroupIDCurrentActorsAsSecondaryGroup in interface ImmutableGroupID
Returns:
array of the actors in the ACS that have this group as a secondary groupID. May be empty but not null.

finalizeForBase

public void finalizeForBase()
                     throws UpDateError
This method removes the members, and the resources through the variable groupID_ and, for Actors, through currentGroupID_ and l_SecondaryGroup_. It deletes the conditional AclEntries having this group as condition. super.finalizeForBase() removes the groupID in the ACS lists (main and controllers), and removes in the resources connected through an aclEntry. This method removes in userIDs the primary group if it is this. Overrides the super method and calls it at the end. An unused object has to be deleted to inform the others objects, and this method HAS TO BE USED before deleting the groupID. Note: when this method is called by the EligiblePartyImpl constructor, the proper variables of this class are not still initialized.

Specified by:
finalizeForBase in interface FinalizedObject
Overrides:
finalizeForBase in class GroupIDMemberImpl
Throws:
UpDateError - if the userID is unknown of the main ACS (if it is a clone, typically), if this instance is registered has the primary group of another-ACS userID, or if it is a conditional group in an AclEntry which is not well finalized

finalizeFromDeserialization

protected void finalizeFromDeserialization()
This method finalizes each group members, since it is used after a deserialization. There, the attributes have been deserialized but are not 'true' objects of the base. The instance is NOT removed as a listener, since there is no listener. The internal maps are set to null. Does not call finalizeForBase(). Called only by EPRViewInBaseImpl.

Overrides:
finalizeFromDeserialization in class GroupIDMemberImpl

clone

public java.lang.Object clone()
Clone without register the new object in the ACSs. Caution: don't use any modifying method that may altere the integrity of the base.

Overrides:
clone in class GroupIDMemberImpl
Returns:
Object; is not registred in the ACSs. The names, the type, the comment, the alias, the order are cloned. The external object references are not cloned (see "Eor" in get method).
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object _obj)
Description copied from class: EligiblePartyImpl
Does not compare the comment.

Specified by:
equals in interface BaseObject
Overrides:
equals in class GroupIDMemberImpl
Parameters:
_obj - object to compare
Returns:
true if _obj is an instance of GroupIDImpl (or a derived class) equals to this instance (with the same class)

hashCode

public int hashCode()
Specified by:
hashCode in interface BaseObject
Overrides:
hashCode in class GroupIDMemberImpl
Returns:
the hashcode derived from the order, name of the first groupID and the first member, the type and folder member hashcodes

toString

public java.lang.String toString()
Description copied from class: BasicImpl
Gets the name last component of the instance. Used in the explorer to display the element. Never null.

Overrides:
toString in class GroupIDMemberImpl
Returns:
String: the variables of the instance : name (last component). May be null.

getSerialVersionUID

public long getSerialVersionUID()
Description copied from class: BasicImpl
For the java serialization.

Specified by:
getSerialVersionUID in interface ImmutableBasic
Overrides:
getSerialVersionUID in class GroupIDMemberImpl
Returns:
the static serialVersionUID__ of this class

getL_IntermediateGroupsOfAclConditionalGroups

public static ImmutableGroupID[] getL_IntermediateGroupsOfAclConditionalGroups(ImmutableAclEntry _acl)
Gets, for a conditional AclEntry, all the effective or potential intermediate GroupIDs, in the chain from the source to each condition group. If the AclEntry source is not a member of one condition group, returns the near groups for which the source is an indirect member. The distance of these groups to the ACL source (number of intermediate groups) has to be inferior to 5. Calls AclEntry.getL_ConditionSourceGroups(), containsAsMember(), containsAsIndirectMember(), getFirstIntermediateForIndirectMember(). Called by getL_ConditionalACLsOfOneConditionGroupIndirectMember() to detect the need to call the method AclEntryImpl.resetRightsAsInheritedAclEntry(), and by Gui2.GraphicViewBaseListenerImpl and gWork.RighsMediatorImpl to listen the member changes in the condition groups.

Parameters:
_acl - AclEntry to analyze
Returns:
array of intermediate GroupIDs. Null if it is not a conditional AclEntry, the source is not a GroupIDMember, and empty if the source is a direct member of each condition group.

getL_ConditionalACLsOfOneConditionGroupIndirectMember

public static AclEntry[] getL_ConditionalACLsOfOneConditionGroupIndirectMember(ImmutableGroupID _grp)
NO USE. Gets, for a group, all the conditional AclEntries of the same ACS for which the group is in the membership chain from itself to at least one condition group. The aim is to return all the active AclEntries for which the rights have to be analyzed because a relevant membership relation may have changed. If the ACL inner rights are null (possible only for a flexible conditional ACL) the ACL is not returned, since it is not an active ACL. Calls ACS.getEorL_AclEntries() and getL_IntermediateGroupsOfAclConditionalGroups().

Parameters:
_grp - to analyze. Never null.
Returns:
conditional AclEntries for which _grp is in the membership chain from itself to at least one condition group. May be null.

isConditionalACLtoResetAfterMembershipChangeInThisGroup

public boolean isConditionalACLtoResetAfterMembershipChangeInThisGroup(ImmutableAclEntry _acl,
                                                                       ImmutableGroupIDMember _member)
Detects if it is a conditional AclEntry from this group ACS, for which a change in the groupidmember membership relation to this group is able to change the membership chain from the AclEntry source to at least one condition group of the AclEntry. This group ACS has to manage the conditional Aclentries, and this is checked by this method. If the method returns true, the method AclEntryImpl.resetRightsAsInheritedAclEntry() has to be called because the AclEntry effective rights may have changed, after the membership change in this group. Returns false if there is no link from _acl.getEorEP() to _member. Returns false if there is no link from one _acl condition group to this group. Whatever the sens of the groupidmember membership change, that is an adding or a removing of _member in this group, this method says the AclEntry rights are changing. The simplest case is processed, where _member is the Acl source and this group is an _acl condition group. This method is faster than a suite of tests having the form conditionGroup.containsAsIndirectMember(aclSource) before and after the groupidmember membership change. Calls containsAsMember(), containsAsIndirectMember(), and not containsAsIndirectMemberWithoutAliasing(). Called by add/removeEorMember().

Parameters:
_acl - from the _member ACS. Never null.
_member - new or previous direct member of this group. Never null.
Returns:
true if _acl has to be reset through AclEntryImpl.resetRightsAsInheritedAclEntry(). Return false in all other cases, including an ACS which does not manage the conditional ACL, or a non-conditional _acl, or no identity or membership relation from the _acl source to _member, or no membership relation from this group to any _acl condition group.

copyOwnVariables

protected GroupIDImpl copyOwnVariables(GroupIDImpl _result,
                                       boolean _withoutInternalAcl)
                                throws CreateError
This method provides a copy of the instance variables. Copies the own actors and the result as groupIDMember (done by GroupIDMemberImpl.copyOwnVariables()). Does not copy the groupIDMembers (done by the copy() caller). Does not copy the own resources, nor the current actors, but the resource and actor copies do the job. The copy order is 3 times the source order. Called by copy() and by the copyOwnVariables() methods of the subclasses.

Parameters:
_result - to update with this instance variables copies
_withoutInternalAcl - true if the internal aclEntries - that is with a resource having the same ACS - must not be copied
Returns:
updated _result
Throws:
CreateError

addOwnResource

protected void addOwnResource(Resource _res)
Used by Resource.setEorGroupID(). Fire an 'l_GroupIDOwnResources' event.

Parameters:
_res - Resource owned by this groupID. May be null.

addCurrentActor

protected void addCurrentActor(Actor _act)
Used by Actor.setEorCurrentGroupID. Fire an event "l_GroupIDCurrentActors".

Parameters:
_act - Actor currently attached to this groupID. May be null.

removeOwnResource

protected void removeOwnResource(Resource _res)
                          throws UpDateError
Used by Resource.setEorGroupID() and finalizeForBase(). Fire an event on "l_GroupIDOwnResources".

Parameters:
_res - Resource to remove in this groupID
Throws:
UpDateError - if _res is null or unknown

removeCurrentActor

protected void removeCurrentActor(Actor _act)
                           throws UpDateError
Used by Actor.finalizeForBase(), Actor.setEorCurrentGroupID(). Fire an event.

Parameters:
_act - Actor to remove in this groupID
Throws:
UpDateError - if _act is null or unknown

removeOwnActorAsSecondaryGroup

protected void removeOwnActorAsSecondaryGroup(Actor _act)
                                       throws UpDateError
Invoked by Actor.setEorL_SecondaryGroup() and Actor.finalizeForBase(). Fires an event 'l_GroupIDCurrentActorsAsSecondaryGroup'.

Parameters:
_act - Actor to remove in this groupID
Throws:
UpDateError - if _act is null or unknown, but not if the actor list is null

finalize

protected void finalize()
                 throws java.lang.Throwable
This method removes the groupID from the ACS lists, but there is no guaranee that the JVM calls this method before the end of the application.

Overrides:
finalize in class GroupIDMemberImpl
Throws:
java.lang.Throwable
java.lang.Throwable