ARoad0.gBase
Class BasicImpl

java.lang.Object
  extended by ARoad0.gBase.BasicImpl
All Implemented Interfaces:
ACSObject, BaseBeanManager, BaseObject, Basic, BoundBean, Copyable, FinalizedObject, FinalizedObjectForUser, ImmutableBasic, PrivilegeUser, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
EligiblePartyImpl, ResourceImpl

public class BasicImpl
extends java.lang.Object
implements Basic, java.io.Serializable

This class is responsible for modeling the member of a folder (VirtualFolder or ViewInBase) in an ACS, and it ensures the handling of Privileges. It is the super class of EligibleParty and Resource. To let the PrivilegeSource capacity to EligibleParty, this class does not implement PrivilegeSource. Nonetheless, it handles fully privilege rights so its subclasses have not to do it. The PrivilegeForTypes are managed directly by this class. The PrivilegeForLinks are also managed directly, or with cascading in the subclass Resource.

This class implements the common alias methods for its subclasses which are ImmutableSource or ImmutableTarget. There are two types of alias relation this class may handle:

- the internal hard alias produces a direct alias-to-reference relation in the same ACS, and the two objects know this relation,

- the soft alias produces an indirect reference-to-alias relation where the alias is external, and it does not register this relation. It is the responsibility of the ACS associations or the AcsAddon code to set an internal alias for one new ACSObject, as an alias or as an alias reference. On the other hand, the soft alias relation may be only set by an AcsAddon.

This class is a javabean with the following bound properties: 'Comment', 'ImpliedOpenViews', 'VirtualFolders', 'ResourceType' or 'EPType', 'M_ConstrainedChildACS', 'HardAliasReference', 'HardAlias', 'SoftAlias', 'AcsOfSoftReferences' and 'hasSoftAlias'.

The listeners are proper to this instance. Excepting for EPRViewInBaseImpl, they are 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.

This class is a composite class which uses the following embedded classes as private attributes: - CFolderMemberImpl for handling VirtualFolders and ViewInBases

- optional CPrivilegeUserImpl for handling PrivilegeForTypes and PrivilegeForLinks

- optional CAliasImpl for handling the hard and soft aliasing relations

This class has several subclasses in this package. All variables are private to secure the white box inheritances from this class, excepting for final variables and actorActivated_, for which the value is associated to the class and has to be set by the Actor constructors.

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

See Also:
CFolderMemberImpl, CPrivilegeUserImpl, CAliasImpl, Serialized Form

Field Summary
protected  ImmutableACS aCS_
           
protected  ImmutableName aCS_Name_
           
protected  CAliasImpl aliasHandler_
          Optional alias handler of this instance.
protected  java.beans.PropertyChangeSupport changeSupport_
          Manages all the property change listeners of this class and its subclasses.
protected  java.lang.String comment_
           
static BasicImpl EMPTY_INSTANCE
          A reusable empty instance for initialization, to avoid the use of 'new' for temporary values.
protected  CFolderMemberImpl folderMember_
          folders handler of this instance, both for view links and optionally, for virtual folder links.
protected static int INCREMENT_CAPACITY
           
protected static int INITIAL_CAPACITY
           
protected static int INITIAL_CAPACITY_2
           
protected  ImmutableName iS_Name_
           
protected  java.util.HashMap<java.lang.String,ImmutableName[]> m_ConstrainedChildACS_
          A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.
protected  ImmutableName name_
           
protected static int PRIME
           
protected  CPrivilegeUserImpl privHandler_
          This optional privileges handler is used only by the subclasses, EligiblePartyImpl and ResourceImpl.
static java.io.ObjectStreamField[] serialPersistentFields
          variable for the JDK 2 serialization
private static long serialVersionUID
           
protected  java.lang.String type_
          This is the Resource type or the EligibleParty type, to set by one of the relevant constructors.
 
Constructor Summary
  BasicImpl()
          Default constructor.
protected BasicImpl(ImmutableName _name, ACS _acs)
          Used for the creation of a Basic by the subclass constructors.
 
Method Summary
protected  void addAcsOfSoftReferences(ImmutableName _acs)
          Adds the ACS name of an external or internal soft reference to the master as soft alias.
protected  void addConstrainedChildACS(java.lang.String _key, ImmutableName[] _l_acs)
          A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.
protected  void addEorSoftAlias(ImmutableName _alias)
          Adds an internal or external soft alias.
protected  void addInVFolderList(VirtualFolder _folder)
          Registers the folder as containing this instance.
protected  void addInViewList(ViewInBase _view)
          Registers the view as containing this BaseObject.
 void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
          Adds a listener to the bean, for all the bound properties.
 void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
          Adds a listener to the bean.
 java.lang.Object clone()
          Returns a copy without registering the new object in the ACSs, and without links to the privileges of this instance.
 int compareTo(java.lang.Object _o)
          The comparison is based on the name compareTo() method of each leaf, except when there is a node.
 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  BasicImpl copyOwnVariables(BasicImpl _result)
          UNUSED This method provides a copy of the instance variables.
 boolean equals(java.lang.Object _obj)
          Does not compare the comment.
protected  void finalize()
          This method removes the Basic from the ACS lists, but there is no guarantee that the JVM calls this method before the end of the application.
 void finalizeForBase()
          This method cuts the linked privileges links, if any, and removes the instance in the virtual folders, if any.
 void finalizeForUser()
          This method controls the immutability of the object, removes the associates, then calls finalizeForBase().
protected  void finalizeFromDeserialization()
          NO USE.
 void firePropertyChange(java.lang.String _propertyName, java.lang.Object _oldValue, java.lang.Object _newValue)
          Fires an event to every registered listener, in any order.
 ImmutableName getAcsName()
           
 java.lang.String getComment()
           
 ImmutableACS getEorACS()
           
 ACSObject getEorAliasAsInternalHardReference()
          Get the unique ACSObject, if any, of this ACS for which this object is an internal hard reference.
 ACSObject getEorReferenceAsInternalHardAlias()
          Get the unique ACSObject, if any, of this ACS as reference for which this object is an internal hard alias.
 ImmutableName getFullName()
          The full name is unique for the Access Road program.
 boolean getHasSoftAlias()
          This property is not displayed in the GUI.
 java.util.List<ViewInBase> getImpliedViews()
          Get the open views containing this BaseObject.
 ImmutableName getIS_Name()
          The Basic owns to an access control system (ACS) which owns to an information system (IS).
 ImmutableName[] getL_AcsOfSoftReferences()
          Gets a sorted array of names of the ACS of the soft references.
 ImmutableName[] getL_SoftAlias()
          Gets a sorted array of names of the internal or external soft alias.
 java.util.Map<java.lang.String,ImmutableName[]> getM_ConstrainedChildACS()
          A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.
 ImmutableName getName()
          The name is unique for the Access Road program.
 java.lang.String getNickName()
          This short name is NOT unique for the Access Road program nor the ACS if it is an ACS object.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
          Returns the change listeners for a property.
 long getSerialVersionUID()
          For the java serialization.
 java.lang.String getType()
          The type is defined at the creation of the object, then it may be updated by the user.
 java.util.List<VirtualFolder> getVirtualFolders()
          Gets the virtual folders containing the master.
 int hashCode()
           
protected  void removeAcsOfSoftReferences(ImmutableName _acs)
          Removes an external or internal alias from the master as soft reference.
protected  void removeConstrainedChildACS(java.lang.String _key, ImmutableName[] _l_acs)
          A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.
protected  void removeEorSoftAlias(ImmutableName _alias)
          Removes an external or internal alias.
protected  boolean removeInVFolderList(VirtualFolder _folder)
          Unregisters the folder when it does not contain this instance.
protected  boolean removeInViewList(ViewInBase _view)
          Unregisters the view when it does not contain this BaseObject.
 void removePropertyChangeListener(java.beans.PropertyChangeListener _l)
          Removes a listener to the bean, for all the bound properties.
 void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
          Removes a listener to the bean.
 void setComment(java.lang.String _s)
          Set any comment related to this Basic.
protected  void setEorAliasAsInternalHardReference(ACSObject _ali)
          Set the unique ACSObject, if any, of this ACS for which this object is an internal hard reference.
protected  void setEorReferenceAsInternalHardAlias(ACSObject _ref)
          Set the unique ACSObject, if any, of this ACS for which this object is an internal hard alias.
protected  void setType(java.lang.String _type)
          If the argument is allowed by the ACS, sets the type of this instance.
 java.lang.String toString()
          Gets the name last component of the instance.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

name_

protected ImmutableName name_

comment_

protected java.lang.String comment_

aCS_

protected ImmutableACS aCS_

iS_Name_

protected ImmutableName iS_Name_

aCS_Name_

protected ImmutableName aCS_Name_

PRIME

protected static final int PRIME
See Also:
Constant Field Values

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
See Also:
Constant Field Values

INITIAL_CAPACITY_2

protected static final int INITIAL_CAPACITY_2
See Also:
Constant Field Values

INCREMENT_CAPACITY

protected static final int INCREMENT_CAPACITY
See Also:
Constant Field Values

type_

protected java.lang.String type_
This is the Resource type or the EligibleParty type, to set by one of the relevant constructors. The type is used by PrivilegeForType instances.


m_ConstrainedChildACS_

protected java.util.HashMap<java.lang.String,ImmutableName[]> m_ConstrainedChildACS_
A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>. Each relation is associated to a key with the same name.


folderMember_

protected CFolderMemberImpl folderMember_
folders handler of this instance, both for view links and optionally, for virtual folder links.


privHandler_

protected CPrivilegeUserImpl privHandler_
This optional privileges handler is used only by the subclasses, EligiblePartyImpl and ResourceImpl.


aliasHandler_

protected CAliasImpl aliasHandler_
Optional alias handler of this instance.


changeSupport_

protected transient java.beans.PropertyChangeSupport changeSupport_
Manages all the property change listeners of this class and its subclasses. GetPropertyChangelisteners() allows the AcsAddon to have the listeners for a given property.


EMPTY_INSTANCE

public static final BasicImpl 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

BasicImpl

public BasicImpl()
Default constructor. No registration in the ACS.


BasicImpl

protected BasicImpl(ImmutableName _name,
                    ACS _acs)
             throws CreateError
Used for the creation of a Basic by the subclass constructors. For an UserID or a GroupID, adds '<U>' or '<G>' between the ACS name and the end of _name. Controls if the name is not a virtual folder name or an ACS name. Used by copy(). The properties privHandler_ and aliasHandler_ remains null. The user error messages are the followings:

- The name of the new instance is null.

- The name of the new instance contains a character that is not a letter.

- The found IS name is null.

- This is the name of a node or an area in the Information System, or the name of a virtual folder in the same ACS. Caution: this constructor does not register the new instance in the ACS; it is done by the subclasses.

Parameters:
_name - of the eligible party to create, before the adding of the component '<G>' if it is a GroupID or '<U>' if it is an UserID. Never null.
_acs - is the main ACS of the Basic to create. Never null.
Throws:
CreateError - if the instance name is null, if it contains a character that is not a letter, or contains '::' or '>>', if the IS name is unknown in the ACS name, if it is the name of a node or area in the information system, or the name of a virtual folder.
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. Each internal variable that is an external object reference have a shallow copy (no deep copy). Most of the properties are copied, but not the list of ViewInBase that contains this instance. Most of the privileges are copied. Caution: does not copy the privilege if _result does not belong to _acs and if there are no privilege in the _result ACS which has a similar name - that is that have the same short privilege name. Calls copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copy in interface Copyable
Parameters:
_name - is a copy name. Usually creates as an extension of _parent name.
_acs - is a main ACS of the copy to create. May not be the ACS of this instance.
_parent - is not used.
_toRegisterInManager - is not used.
Returns:
BasicImpl
Throws:
CreateError - of the constructor with the same parameters

getIS_Name

public ImmutableName getIS_Name()
The Basic owns to an access control system (ACS) which owns to an information system (IS). IS name is usually the first component of the ACS name. Not described in the BeanInfo.

Specified by:
getIS_Name in interface ImmutableBasic
Returns:
ImmutableName of the IS

getEorACS

public ImmutableACS getEorACS()
Specified by:
getEorACS in interface ACSObject
Returns:
ImmutableACS is an External Object Reference to the ACS that owns this Basic (main ACS)

getAcsName

public ImmutableName getAcsName()
Specified by:
getAcsName in interface ACSObject
Returns:
ImmutableName of the ACS that owns this object

setComment

public void setComment(java.lang.String _s)
Set any comment related to this Basic. It is a bound property.

Specified by:
setComment in interface Basic
Parameters:
_s - is a comment which is associated to the Basic.

getComment

public java.lang.String getComment()
Specified by:
getComment in interface ImmutableBasic
Returns:
comment which is associated to the Basic. May be null.

getName

public ImmutableName getName()
The name is unique for the Access Road program.

Specified by:
getName in interface BaseObject
Returns:
a copy of the Basic name. May be empty, but not null.

getFullName

public ImmutableName getFullName()
The full name is unique for the Access Road program. It is there equal to the name returned by getName().

Specified by:
getFullName in interface BaseObject
Returns:
a copy of the Basic full name. May be empty, but not null.

getNickName

public java.lang.String getNickName()
This short name is NOT unique for the Access Road program nor the ACS if it is an ACS object. It is often the last component name.

Specified by:
getNickName in interface BaseObject
Returns:
the Basic nick name. May be null.

getType

public java.lang.String getType()
The type is defined at the creation of the object, then it may be updated by the user. It has several uses:

- to define the type updating policy from the ACS,

- for defining the authorized rights for each kind of rights (ACL, AGO...),

- to manage the capacity to delete the instance,

- and by the PrivilegeForType instances to apply their rights.

It is the resource type if the object is a Resource, the EP type if it is an EP. So, this method from Immutable Source and ImmutableTarget (not from ImmutableBasic) is for the Basic subclasses.

Returns:
String of type, as for exemple "executable" or "file". Never null.

getEorReferenceAsInternalHardAlias

public final ACSObject getEorReferenceAsInternalHardAlias()
Get the unique ACSObject, if any, of this ACS as reference for which this object is an internal hard alias. This class implements the common alias methods for its subclasses which are ImmutableSource or ImmutableTarget.

Specified by:
getEorReferenceAsInternalHardAlias in interface ImmutableBasic
Returns:
the hard reference. May be null.

getEorAliasAsInternalHardReference

public final ACSObject getEorAliasAsInternalHardReference()
Get the unique ACSObject, if any, of this ACS for which this object is an internal hard reference. This class implements the common alias methods for its subclasses which are ImmutableSource or ImmutableTarget.

Specified by:
getEorAliasAsInternalHardReference in interface ImmutableBasic
Returns:
the hard alias. May be null.

getL_SoftAlias

public final ImmutableName[] getL_SoftAlias()
Gets a sorted array of names of the internal or external soft alias. This class implements the common alias methods for its subclasses which are ImmutableSource or ImmutableTarget.

Specified by:
getL_SoftAlias in interface ImmutableBasic
Returns:
ImmutableName[] of the soft alias. May be null but not empty.

getL_AcsOfSoftReferences

public final ImmutableName[] getL_AcsOfSoftReferences()
Gets a sorted array of names of the ACS of the soft references.

Specified by:
getL_AcsOfSoftReferences in interface ImmutableBasic
Returns:
ImmutableName[] of the ACS. May be null but not empty.

getHasSoftAlias

public final boolean getHasSoftAlias()
This property is not displayed in the GUI. This class implements the common alias methods for its subclasses which are ImmutableSource or ImmutableTarget.

Specified by:
getHasSoftAlias in interface ImmutableBasic
Returns:
true if there is at least one external or internal soft alias.

getImpliedViews

public java.util.List<ViewInBase> getImpliedViews()
Get the open views containing this BaseObject.

Specified by:
getImpliedViews in interface ImmutableBasic
Returns:
List of ViewInBase. May be empty, but never null.

getM_ConstrainedChildACS

public java.util.Map<java.lang.String,ImmutableName[]> getM_ConstrainedChildACS()
A constrained (opened or closed) child ACS has one or several of the following relations to this object:

<ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.

Each relation is associated to a key with the same name.

Returns:
a map of 3 ACS name lists for the 3 keys. May be empty but never null. A value may be an empty array but is never null.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
Adds a listener to the bean, for all the bound properties.

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

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: 'Comment', 'ImpliedOpenViews', 'VirtualFolders', 'ResourceType' or 'EPType', 'M_ConstrainedChildACS'. The following properties are managed by aliasHandler_: 'HardAliasReference', 'HardAlias', 'SoftAlias', 'AcsOfSoftReferences' and 'hasSoftAlias'. Called for all the subclasses, then there is no check up of the property name if it is not one of the previously named properties.

Specified by:
addPropertyChangeListener in interface BaseBeanManager
Specified by:
addPropertyChangeListener in interface BoundBean
Parameters:
_propertyName - String is the 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.beans.PropertyChangeListener _l)
Removes a listener to the bean, for all the bound properties. Used by ViewInBaseImpl.

Specified by:
removePropertyChangeListener in interface BaseBeanManager
Specified by:
removePropertyChangeListener in interface BoundBean
Parameters:
_l - PropertyChangeListener to remove

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: 'Comment', 'ImpliedOpenViews', 'VirtualFolders', 'ResourceType' or 'EPType', 'M_ConstrainedChildACS'. The following properties are managed by aliasHandler_: 'HardAliasReference', 'HardAlias', 'SoftAlias', 'AcsOfSoftReferences' and 'hasSoftAlias'. Called for all the subclasses, then there is no check up of the property name if it is not one of the previously named properties. Note: using this method does not remove a listener which has been registered through addPropertyChangeListener(PropertyChangeListener _l).

Specified by:
removePropertyChangeListener in interface BaseBeanManager
Specified by:
removePropertyChangeListener in interface BoundBean
Parameters:
_propertyName - String is the 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
Parameters:
_propertyName - name of the listened property.
Returns:
the change listeners. May be null or empty.

clone

public java.lang.Object clone()
Returns a copy without registering the new object in the ACSs, and without links to the privileges of this instance. Caution: since the clone() interface is broken, copy constructors should be better. Caution: don't use any updating method on this clone, because that may destroy the base integrity.

Overrides:
clone in class java.lang.Object
Returns:
Object - The names are cloned. The external object references are not cloned (see "Eor" in get method). The links between the EOR and the new instance are not set, but the lists of OER are cloned (viewInBase and privileges) so it is possible to get these active objects.
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object _obj)
Does not compare the comment. Works even if the instance is user-finalized.

Specified by:
equals in interface BaseObject
Overrides:
equals in class java.lang.Object
Parameters:
_obj -
Returns:
boolean true if _obj is an instance of BasicImpl (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 java.lang.Object
Returns:
the hashcode derived from the type and folder meber hashcodes

getSerialVersionUID

public long getSerialVersionUID()
For the java serialization.

Specified by:
getSerialVersionUID in interface ImmutableBasic
Returns:
long

compareTo

public int compareTo(java.lang.Object _o)
              throws java.lang.ClassCastException
The comparison is based on the name compareTo() method of each leaf, except when there is a node. This method is based on name_, so Basic.compareTo(same instance) does not return 0, but a positive or a negative value. The nodes are always smaller than the leaves.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
_o - to compare must be an ImmutableLeaf
Returns:
int 0 if the leaves are equals, a negative integer if this leaf is lesser than the argument, and a positive integer if this leaf 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

public void finalizeForUser()
                     throws UpDateError
This method controls the immutability of the object, removes the associates, then calls finalizeForBase(). An unused object has to be deleted to inform the other objects, and this method HAS TO BE CALLED before deleting this object. Called by the GUI. Calls finalizeForBase() and ACSFactoryUtilityImpl.removeAssociatesAfterDeletion() to remove the associates. This method does not raise PropertyChangeEvents since the BeanInfo for this class specifies that its ACS informs the listeners when this instance is finalized. To test if an instance has been finalized, uses (folderMember_ == null).

Specified by:
finalizeForUser in interface Basic
Specified by:
finalizeForUser in interface FinalizedObjectForUser
Throws:
UpDateError - if the object type contains 'byAcsCreator', starts with or ends with 'immutable', or from finalizeFromBase() or AssociateUtilityImpl.removeAssociatesAfterDeletion()

finalizeForBase

public void finalizeForBase()
                     throws UpDateError
This method cuts the linked privileges links, if any, and removes the instance in the virtual folders, if any. It is public to let the gWork methods to call it, but is is not described in the BeanInfo since the beamer must use only finalizeForUser() to delete an object. Called by finalizeForUser(), which controls the immutability of the object and removes the associates before the call. This method is called by finalize() and the overridding methods. Caution: the overridding methods in ResourceImpl and EligiblePartyImpl unregister the instance in its ACS. Calls setType() with a null argument, to unregister the instance in the associated privileges. An unused object has to be deleted to inform the others objects, and this method HAS TO BE CALLED before deleting the Basic. This method does not raise PropertyChangeEvents since the BeanInfo for this class specifies that its ACS informs the listeners when this instance is finalized. To test if an instance has been finalized, uses (folderMember_ == null).

Specified by:
finalizeForBase in interface FinalizedObject
Throws:
UpDateError - if the CPrivilegeUserImpl or CFolderMemberImpl throws it.

toString

public java.lang.String toString()
Gets the name last component of the instance. Used in the explorer to display the element. Never null.

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

setEorReferenceAsInternalHardAlias

protected void setEorReferenceAsInternalHardAlias(ACSObject _ref)
                                           throws UpDateError
Set the unique ACSObject, if any, of this ACS for which this object is an internal hard alias. The generic gBase package does not call this method, nor the user from the GUI. It is the responsibility of the ACS associations or the AcsAddon code to set an internal alias for one new ACSObject, as an alias or as an alias reference. If the instance is already a reference, it cannot become an alias. Fires the property change 'HardAliasReference'.

Parameters:
_ref - the reference. May be null.
Throws:
UpDateError - _ref does not belong to the same ACS or the type is immutable

setEorAliasAsInternalHardReference

protected void setEorAliasAsInternalHardReference(ACSObject _ali)
                                           throws UpDateError
Set the unique ACSObject, if any, of this ACS for which this object is an internal hard reference. The generic gBase package does not call this method, nor the user from the GUI. It is the responsibility of the ACS associations or the AcsAddon code to set an internal alias for one new ACSObject, as an alias or as an alias reference. If the instance is already an alias, it cannot become a reference. Fires the property change 'HardAlias'.

Parameters:
_ali - the alias. May be null.
Throws:
UpDateError - _basic does not belong to the same ACS or the master is already an alias

addEorSoftAlias

protected void addEorSoftAlias(ImmutableName _alias)
                        throws UpDateError
Adds an internal or external soft alias. The alias is not updated. Used only by the ACS. Has to be used by the AcsAddon from a gBase class. Fires the events 'SoftAlias' and 'hasSoftAlias'.

Parameters:
_alias - ACSObject. No action if null, or already known.
Throws:
UpDateError - the type is immutable

removeEorSoftAlias

protected void removeEorSoftAlias(ImmutableName _alias)
                           throws UpDateError
Removes an external or internal alias. The external alias is not updated. Used only by the ACS, in an AcsAddon and from a gBase class. Detects the alias through a name comparison. Fires the 'SoftAlias' and the 'hasSoftAlias' property change events. If firePropertyChange() throws an exception, displays an user message. No action if the list is null.

Parameters:
_alias - is a registered alias. No action if null.
Throws:
UpDateError - if _alias is not known.

addAcsOfSoftReferences

protected void addAcsOfSoftReferences(ImmutableName _acs)
                               throws UpDateError
Adds the ACS name of an external or internal soft reference to the master as soft alias. The reference is not updated there but by the ACS calling method. Used only by the ACS, which may add controls on the parameter class. Has to be used by the AcsAddon. Fires the event 'AcsOfSoftReferences'.

Parameters:
_acs - ACS name. No action if null, or already known.
Throws:
UpDateError - if the type is immutable

removeAcsOfSoftReferences

protected void removeAcsOfSoftReferences(ImmutableName _acs)
                                  throws UpDateError
Removes an external or internal alias from the master as soft reference. The alias is not updated there but by the ACS calling method. Used only by the ACS, which may add controls on the parameter class. Detects the alias through a name comparison. Fires 'AcsOfSoftReferences' property change events. If firePropertyChange() throws an exception, displays an user message. No action if the list is null.

Parameters:
_acs - ACS name. No action if null.
Throws:
UpDateError - if _acs is not known.

addInViewList

protected void addInViewList(ViewInBase _view)
Registers the view as containing this BaseObject. Called by EPRViewInBaseImpl.addEorResource/EligibleParty(). Fires 'ImpliedOpenViews' event.

Parameters:
_view - to add

removeInViewList

protected boolean removeInViewList(ViewInBase _view)
Unregisters the view when it does not contain this BaseObject. Called by EPRViewInBaseImpl.removeEorResource/EligibleParty(). Fires 'ImpliedOpenViews' event.

Parameters:
_view - to remove
Returns:
false if the view is unknown

addConstrainedChildACS

protected void addConstrainedChildACS(java.lang.String _key,
                                      ImmutableName[] _l_acs)
A constrained (opened or closed) child ACS has one or several of the following relations to this object:

<ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.

Each relation is associated to a key with the same name, given by ACSFactoryUtilityImpl.getKeysForConstrainedChildACSMap(). Fires a 'M_ConstrainedChildACS' event. Called by the child ACS setAcsRelationsInIS() method.

Parameters:
_key - must be among the allowed keys. Otherwise, throws an InternalError.
_l_acs - array of constrained and opened child ACSs to add. Noop if null or empty.

removeConstrainedChildACS

protected void removeConstrainedChildACS(java.lang.String _key,
                                         ImmutableName[] _l_acs)
                                  throws UpDateError
A constrained (opened or closed) child ACS has one or several of the following relations to this object:

<ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.

Each relation is associated to a key with the same name. Fires a 'M_ConstrainedChildACS' event. Calls ACSFactoryUtilityImpl.getKeysForConstrainedChildACSMap(). Called by the child ACS.

Parameters:
_key - must be among the allowed keys.
_l_acs - constrained and opened child ACSs to remove. To set to null for deleting _key in the map. May be empty but without null element.
Throws:
UpDateError - if:

- the key is null or unknown,

- one value in _l_acs is null,

- a value is not registered.


addInVFolderList

protected void addInVFolderList(VirtualFolder _folder)
                         throws CreateError
Registers the folder as containing this instance. Called by VirtualFolderImpl.addEorBaseObject(). Fires 'VirtualFolders' event.

Parameters:
_folder - to add
Throws:
CreateError - if the ACS does not manage the virtual folders.

getVirtualFolders

public java.util.List<VirtualFolder> getVirtualFolders()
Gets the virtual folders containing the master.

Specified by:
getVirtualFolders in interface ImmutableBasic
Returns:
List of VirtualFolders. May be empty, but never null.

removeInVFolderList

protected boolean removeInVFolderList(VirtualFolder _folder)
                               throws CreateError
Unregisters the folder when it does not contain this instance. Called by VirtualFolderImpl.removeEorBaseObject(). Fires 'VirtualFolders' event.

Returns:
boolean false if the folder is unknown
Throws:
CreateError - if the ACS does not manage the virtual folders.

setType

protected void setType(java.lang.String _type)
                throws UpDateError
If the argument is allowed by the ACS, sets the type of this instance. If the object is a Resource, the value is equal to the resource type. If the object is an EligibleParty, the value is equal to the EP type. This method is used by the subclasses constructors, and to switch from/to an '<immutable>' type.

An '<immutable>' type forbids most of the updatings of the instance. Indeed, it is possible to switch for example from 'actor' to '<immutable> actor', but not to 'immutable group'. The rule is that the 'immutable ' key word, if it is used, must be at the start or at the end of the type.

From the default value 'undefined', any updating may be done. The user cannot change the type if it starts with '<byAcsCreator>', but the program can do it. For doing it, '12345678901234567890' is a program-reserved value. Even if it is not allowed by the ACS, '12345678901234567890' is the only new value it is not possible to change from a type starting with '<byAcsCreator>'. If the current type does not start with '<byAcsCreator>' but contains it, the type is editable while the instance cannot be finalized by the user. From '12345678901234567890', any new value may be set from the allowed ones, and this starting value is the only one which allows to set a value containing '<byAcsCreator>'.

Since the typed privileges use depends on the type, this method registers the typed privileges having the same type (modulo the key word '<immutable>'). However, this is not true for the for_seed typed privileges, nor for the specific ones, because a specific privilege cannot be created if the source or the target is not there. A switching from/to an '<immutable>' type to the other format never changes the associated PrivilegeForTypes.

Every change in this method should be done in VirtualFolderImpl.setType(). Fires a property change on 'ResourceType' or 'EPType'. This method is indirectly called from the GUI. Called by finalizeForBase(), ResourceImpl.setResourceType() and EligiblePartyImpl.setEPType(), at the request of their subclass constructor, or for the GUI. Calls ACSImpl.getM_TypesAndGUIPolicy() and getM_TypeOrientedPolicy(), BaseUtilityImpl.getObjectTypeWithoutImmutable().

Parameters:
_type - as for instance "Cayro_file" or "tablespace". May be null, or equals to the current type.
Throws:
UpDateError - if the new value and the old one are not compatible, or if the type handling for privileges throws it.

copyOwnVariables

protected BasicImpl copyOwnVariables(BasicImpl _result)
                              throws CreateError
UNUSED This method provides a copy of the instance variables. Each internal variable that is an external object reference has a shallow copy (no deep copy). Copy the privileges only if it is possible. Called by copy() and by the copyOwnVariables() methods of the subclasses.

Parameters:
_result - to update with this instance variables copies
Returns:
the updated _result
Throws:
CreateError - from CFolderMemberImpl and CPrivilegeUserImpl

firePropertyChange

public void firePropertyChange(java.lang.String _propertyName,
                               java.lang.Object _oldValue,
                               java.lang.Object _newValue)
Fires an event to every registered listener, in any order. For the bound properties 'Comment'. These following properties are fired by folderMember_, not by this method: 'ImpliedOpenViews', 'VirtualFolders'. The following properties are fired by aliasHandler_, not by this method: 'HardAliasReference', 'HardAlias', 'SoftAlias' and 'hasSoftAlias'. Called by all the updating methods from all the subclasses, then there is no check up of the property name, including calls from AcsAddon classes like from BasesSetMySQLImpl.resetInheritedAclEntryRightsOfChildren().

Parameters:
_propertyName - of the changing property
_oldValue - of the property
_newValue - of the property. No operation if equal to _oldValue and not null.

finalize

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

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

finalizeFromDeserialization

protected void finalizeFromDeserialization()
NO USE. This method finalizes all the attributes, but not the ACS. 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, but not the private bound properties sets. Called by EPRViewInBaseImpl only.