ARoad0.gBase
Class GroupIDMemberImpl

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

public class GroupIDMemberImpl
extends EligiblePartyImpl
implements java.io.Serializable, GroupIDMember

This class is responsible for modeling the entity which is a GroupID member. This class offers a method to get the groups the instance is member of. It is a javabean with the following bound properties: 'AssociatedGroups'. 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 GroupIDMemberImpl EMPTY_INSTANCE
          A reusable empty instance for initialization, to avoid the use of 'new' for temporary values.
protected  boolean isAdmin_
          true only if the instance has an administrative role in the ACS, for the technical administration or the users administration.
protected  GroupIDImpl[] l_Groups_
          array of groupIDs that own directly this GroupIDMember.
static java.io.ObjectStreamField[] serialPersistentFields
          variable for the JDK 2 serialization ("l_Groups_",GroupIDImpl[].class), ("isAdmin_", Boolean.TYPE)
private static long serialVersionUID__
           
 
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
GroupIDMemberImpl()
          Simple constructor that calls EligiblePartyImpl().
GroupIDMemberImpl(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'.
GroupIDMemberImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, boolean _isAdmin, boolean _toRegisterInManager)
          Used for the creation of a GroupIDMember alias, without base registration.
 
Method Summary
 void addGroupToGM(GroupID _grp)
          Adds a group for which this GroupIDMember is a member.
 void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
          Adds a listener to the bean.
 java.lang.Object clone()
          Clone without register the new object in the ACSs.
 java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Object _aliasRef, java.lang.Boolean _toRegisterInManager)
          This method provides a copy of the instance with another name.
protected  GroupIDMemberImpl copyOwnVariables(GroupIDMemberImpl _result, boolean _withoutInternalAcl)
          This method provides a copy of the instance variables.
 java.lang.Object copyWithoutAcl(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Object _aliasRef, java.lang.Boolean _toRegisterInManager)
          This method provides a copy of the instance as copy() but without copying the aclEntries.
 boolean equals(java.lang.Object _obj)
          Does not compare the comment.
protected  void finalize()
          This method removes the GroupIDMember from the ACS lists, but there is no guaranee that the JVM calls this method before the end of the application.
 void finalizeForBase()
          super.finalizeForBase() removes the GroupIDMember in the ACS lists (main and controllers), and removes it in the resources connected through an AclEntry.
protected  void finalizeFromDeserialization()
          This method finalizes each group in the groups set, since it is used after a deserialization.
 ImmutableGroupID[] getEorL_GroupID()
          Gets the groups for which this GroupIDMember is a member.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
          Returns the change listeners for a property.
 long getSerialVersionUID()
          For the java serialization.
 int hashCode()
           
 boolean isAdmin()
          True only if the group member has an administrative role in the ACS, for the technical administration or the users administration.
 void removeGroupToGM(ImmutableGroupID _grp)
          Removes a group for which this GroupIDMember is a member.
 void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
          Removes a listener to the bean.
 java.lang.String toString()
          Gets the name last component of the instance.
 
Methods inherited from class ARoad0.gBase.EligiblePartyImpl
addAclEntryToEP, addEorPrivilegeForLinksToSource, addEorPrivilegeForTypeToSource, copy, copyOwnVariables, copyWithoutInternalAcl, 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.EligibleParty
copyWithoutInternalAcl, 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.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.Copyable
copy
 
Methods inherited from interface ARoad0.gBaseInterface.BoundBean
addPropertyChangeListener, 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, 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

isAdmin_

protected boolean isAdmin_
true only if the instance has an administrative role in the ACS, for the technical administration or the users administration.


l_Groups_

protected GroupIDImpl[] l_Groups_
array of groupIDs that own directly this GroupIDMember. Initialized to new GroupIDImpl[0]


EMPTY_INSTANCE

public static final GroupIDMemberImpl 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 ("l_Groups_",GroupIDImpl[].class), ("isAdmin_", Boolean.TYPE)

Constructor Detail

GroupIDMemberImpl

public GroupIDMemberImpl()
Simple constructor that calls EligiblePartyImpl().


GroupIDMemberImpl

public GroupIDMemberImpl(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'.

Parameters:
_name - ImmutableName of the GroupIDMember as a kind of eligible party
_acs - ACS owning the GroupIDMember
_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 administration.
Throws:
CreateError - if ACSImpl.newEorEligibleParty() throws it - the instance must then be deleted !

GroupIDMemberImpl

public GroupIDMemberImpl(ImmutableName _name,
                         ACS _acs,
                         java.lang.String _epType,
                         boolean _isAdmin,
                         boolean _toRegisterInManager)
                  throws CreateError
Used for the creation of a GroupIDMember alias, without base registration.

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 administration.
_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.Object _aliasRef,
                             java.lang.Boolean _toRegisterInManager)
                      throws CreateError
This method provides a copy of the instance with another name. Register the copy in every GroupID as member, if it is the same ACS, or else in every GroupID copy which is found. Call copyOwnVariables(). This method is overridden by the subclasses.

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.
_aliasRef - this argument is not used there.
_toRegisterInManager - false if this method must not register the instance in the ACS.
Returns:
a new instance of GroupIDMemberImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs, or addAclEntry() exceptions.

copyWithoutAcl

public java.lang.Object copyWithoutAcl(ImmutableName _name,
                                       ACS _acs,
                                       Directory _parent,
                                       java.lang.Object _aliasRef,
                                       java.lang.Boolean _toRegisterInManager)
                                throws CreateError
This method provides a copy of the instance as copy() but without copying the aclEntries. Register the copy in every GroupID as member, if it is the same ACS, or else in every GroupID copy which is found. _aliasRef may belong to another ACS than this instance ACS. Call copyOwnVariables(). This method is overridden by the subclasses.

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.
_aliasRef - this argument is not used there.
_toRegisterInManager - false if this method must not register the instance in the ACS.
Returns:
a new instance of GroupIDMemberImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs, or addAclEntry() exceptions.

getEorL_GroupID

public ImmutableGroupID[] getEorL_GroupID()
Gets the groups for which this GroupIDMember is a member.

Specified by:
getEorL_GroupID in interface ImmutableGroupIDMember
Returns:
a copy of the groups from this eligible party ACS. Never null. It may be an empty array.

isAdmin

public boolean isAdmin()
True only if the group member has an administrative role in the ACS, for the technical administration or the users administration.

Specified by:
isAdmin in interface ImmutableGroupIDMember

finalize

protected void finalize()
                 throws java.lang.Throwable
This method removes the GroupIDMember 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 BasicImpl
Throws:
java.lang.Throwable

finalizeForBase

public void finalizeForBase()
                     throws UpDateError
super.finalizeForBase() removes the GroupIDMember in the ACS lists (main and controllers), and removes it in the resources connected through an AclEntry. This method removes the instance in the groups it is member, and before, the groups array is set to null. This method HAS TO BE USED before deleting the GroupIDMember. 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 EligiblePartyImpl
Throws:
UpDateError - if the GroupIDMember is unknown of the main ACS (if it is a clone, typically), or if a linked immutable object fires an exception

finalizeFromDeserialization

protected void finalizeFromDeserialization()
This method finalizes each group in the groups set, 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 EligiblePartyImpl

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 EligiblePartyImpl
Returns:
Object; is not registred in the ACSs. The names, the type, the comment, the alias, the umask, 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 EligiblePartyImpl
Parameters:
_obj - Object to compare
Returns:
true if _obj is an instance of GroupIDMemberImpl (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 EligiblePartyImpl
Returns:
the hashcode derived from the name of the first groupID, the type and folder member hashcodes

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String _propertyName,
                                      java.beans.PropertyChangeListener _l)
Adds a listener to the bean. Used by Gui1.CommonPropertyEditor for the properties: 'AssociatedGroups'. Calls the super method.

Specified by:
addPropertyChangeListener in interface BaseBeanManager
Specified by:
addPropertyChangeListener in interface BoundBean
Overrides:
addPropertyChangeListener in class EligiblePartyImpl
Parameters:
_propertyName - name of the property
_l - PropertyChangeListener to add. Caution: the listener must NOT have specific hashCode() and equals() methods, to work with HashSet in the removing operations.

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String _propertyName,
                                         java.beans.PropertyChangeListener _l)
Removes a listener to the bean. Used by Gui1.CommonPropertyEditor for the properties: 'AssociatedGroups'. Note: using this method does not remove a listener which has been registered through addPropertyChangeListener(PropertyChangeListener _l). Calls the super method.

Specified by:
removePropertyChangeListener in interface BaseBeanManager
Specified by:
removePropertyChangeListener in interface BoundBean
Overrides:
removePropertyChangeListener in class EligiblePartyImpl
Parameters:
_propertyName - name of the property
_l - PropertyChangeListener to remove

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 EligiblePartyImpl
Parameters:
_propertyName - name of the listened property.
Returns:
the change listeners. May be null or empty.

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 BasicImpl
Returns:
a string from the name last component

getSerialVersionUID

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

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

copyOwnVariables

protected GroupIDMemberImpl copyOwnVariables(GroupIDMemberImpl _result,
                                             boolean _withoutInternalAcl)
                                      throws CreateError
This method provides a copy of the instance variables. Registers the copy in every GroupID as member, if it is the same ACS, or else in every GroupID which has a sililar name - that is ending to the same component. 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 - of l_Groups_[i].addEorMember()

addGroupToGM

public void addGroupToGM(GroupID _grp)
Adds a group for which this GroupIDMember is a member. Fires changes on 'AssociatedGroups'. Used only by GroupIDImpl. Overridden and called by UserIDImpl.

Specified by:
addGroupToGM in interface GroupIDMember
Parameters:
_grp - is the groupID to add. No action if it is null or known.

removeGroupToGM

public void removeGroupToGM(ImmutableGroupID _grp)
Removes a group for which this GroupIDMember is a member. Fires changes on 'AssociatedGroups'. No exception if _grp is not registered. Used only by GroupIDImpl. Overridden by UserIDImpl which calls it.

Specified by:
removeGroupToGM in interface GroupIDMember
Parameters:
_grp - group to remove
Throws:
java.lang.InternalError - if _grp is not found