ARoad0.gBase
Class VirtualFolderImpl

java.lang.Object
  extended by ARoad0.gBase.FolderAbst
      extended by ARoad0.gBase.VirtualFolderImpl
All Implemented Interfaces:
ACSObject, BaseBeanManager, BaseObject, BoundBean, FinalizedObject, FinalizedObjectForUser, Folder, ImmutableFolder, ImmutableLeaf, ImmutableNode, ImmutablePrivilegeTarget, ImmutableSource, ImmutableTarget, ImmutableVirtualFolder, Leaf, Node, PrivilegeTarget, PrivilegeUser, VirtualFolder, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Comparable, java.util.EventListener
Direct Known Subclasses:
VirtualFolderMySQLImpl

public class VirtualFolderImpl
extends FolderAbst
implements VirtualFolder, java.io.Serializable

This class is a container of Resources belonging to one ACS, responsible for being a PrivilegeTarget, an alias or an alias reference. A VirtualFolder is also an ImmutableSource. It manages HAS_VIRTUAL_MEMBER relations to its members. The relation VirtualFolder/member is weak. The deleting of the container does not delete the members, on the contrary of Directory. There are two main types of virtual folders, where the members are always Resources:

- for Resource members which are not EligibleParties ('RES_VFOLDER' type)

- for Resource members which may be EligibleParties ('EP_VFOLDER' type)

Thus, an Virtual Folder is an access target, and it is an access source only as reference of an alias or as container of its members.

The default behavior in the rights propagation is the RIGHTS_PASSING_OFF_TO_MEMBERS mode. This means that the VirtualFolder transfers none of its rights as target to its members. In the other mode RIGHTS_PASSING_ON_TO_MEMBERS, the ACS has set this mode for its virtual folders, and all the virtual folder rights are transfered to its members.

Trees of virtual folders are possible. There is no rights inheritance in the tree for the generic gBase classes, but an AcsAddon may override the hook methods. A virtual folder may be included in:

- a virtual tree of Resource Folders, which is not the Resources tree in the ACS,

- or a virtual tree of Eligible Party Folders.

The virtual folder manages:

- its members, as any folder, and they are Basics of one ACS; they are not deleted when this folder is deleted, on the contrary of Directory children,

- its children, as any node, and they are virtual folders (no Basic) which are deleted when this node is deleted,

- its privileges, as any privilege target, and this may include external LINKED_FOR_ONE_TO_ONE privileges.

For each virtual folder type, there is in an ACS only one folders tree and then, one folder root.

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 or internal, and it does not register this relation.

As a FolderAbst, the members are not serialized when a VirtualFolderImpl instance is saved. It is the responsability of BaseManagerImpl to call ACSImpl.closeVirtualFolders() to prepare the virtual folders before their saving. This class is a composite class which uses the following embedded classes as private attributes:

- CFolderMemberImpl for handling only EPRViewInBases (no VirtualFolders!)

- CPrivilegeUserImpl for handling PrivilegeForTypes and PrivilegeForLinks as target

- optional CNodeImpl for handling the VirtualFolder children

- optional CAliasImpl for handling the hard and soft alias relations

If there is a folder tree, it is possible to force each member to be member at most one time in all the folder tree (EP or Resource tree). There is no link between the members of a virtual folder and the members of children of this folder. There is no link between the privileges of a virtual folder and the privileges of its children. As any node, the deleting of a virtual folder implies the deleting of its children. The typed privileges may be apply to the two current types of virtual folder. They may be used to defined default virtual folder rights. There is no property 'ACS controllers' in a virtual folder having external LINKED_FOR_ONE_TO_ONE privileges, contrary to the Resource.

It is a javabean with the following bound properties (see also the superclass): 'ImpliedOpenViews', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'Children', 'VirtualFolderType','HardAliasReference', 'HardAlias', 'SoftAlias' 'AcsOfSoftReferences' and 'hasSoftAlias'.

The superclass FolderAbst needs to be prepared before a saving and after a restoring. This is the responsability of the ACS methods 'close/fillVirtualFolders', called by the BaseManager when an ACS is saved or opened. If the restoring is already done, there is no action.

This class has several subclasses in the AcsAddon packages. Most of the variables are protected. Note: no clone() method.

See Also:
CFolderMemberImpl, CPrivilegeUserImpl, CNodeImpl, CAliasImpl, See the Copyright., Serialized Form

Field Summary
protected  ACS aCS_
           
protected  CAliasImpl aliasHandler_
          Optional alias handler of this instance.
static VirtualFolderImpl EMPTY_INSTANCE
           
static java.lang.String EP_VFOLDER
          The VFType when the folder is for Eligible Parties which are also Resources, excluding the GroupIDMembers.
protected  CFolderMemberImpl folderMember_
          folders handler of this instance, only for ViewInBase links.
protected  boolean memberOneTimeInTree_
          True if an ACSObject cannot be in a folders tree more than one time, as member of one of the virtual folders.
protected  CNodeImpl nodeHandler_
          children handler of this instance
protected  ImmutableVirtualFolder parent_
           
protected  CPrivilegeUserImpl privHandler_
          privileges handler of this instance
static java.lang.String RES_VFOLDER
          The VFType when the folder is for simple Resources only, which are not Eligible Parties.
static java.io.ObjectStreamField[] serialPersistentFields
          variable for the JDK 2 serialization
protected  java.lang.String VFType_
          The default value of VFType_ is never used
 
Fields inherited from class ARoad0.gBase.FolderAbst
baseError_, changeSupport_, comment_, connectedToSeveralACS_, INITIAL_CAPACITY, INITIAL_CAPACITY_5, l_connectedACSNames_, m_BaseObjects_, m_ObjectsNames_, name_, PRIME, type_
 
Constructor Summary
VirtualFolderImpl()
          Default constructor
VirtualFolderImpl(ImmutableName _name, ACS _acs, VirtualFolder _parent, java.lang.String _type, java.lang.Boolean _forResourcesOnly)
          Used by the beamer editor for the ACS VirtualFolders list, from the 'New' button, and by the gWork.AcsFactory.
VirtualFolderImpl(ImmutableName _name, ACS _acs, VirtualFolder _parent, java.lang.String _type, java.lang.Boolean _forResourcesOnly, boolean _toRegisterInManager)
          This is the main constructor.
 
Method Summary
protected  void addAcsOfSoftReferences(ImmutableName _acs)
          Adds the ACS name of an external or internal soft reference to the master as soft alias.
 void addEorBaseObject(BaseObject _obj)
          Adds a member to this virtual folder.
protected  void addEorChild(ImmutableLeaf _child)
          Adds a child to this Node.
protected  void addEorPrivilegeForLinksToTarget(PrivilegeForLinks _priv)
          Sets a privilege as applicable to this access target.n.
 void addEorPrivilegeForTypeToTarget(PrivilegeForType _priv)
          Sets a privilege as applicable to this access target, and called only by the program.
protected  void addEorSoftAlias(ImmutableName _alias)
          Adds an internal or external soft alias.
protected  void addInViewList(ViewInBase _view)
          Registers the view as containing this BaseObject.
 void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
          Adds a listener to the bean.
 void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
          Adds a listener to the bean.
 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, Node _parent, java.lang.Boolean _toRegisterInManager)
          This method provides a copy of the instance with another name, without children copying because the copy order will not be always correct.
protected  VirtualFolderImpl copyOwnVariables(VirtualFolderImpl _result)
          UNUSED This method provides a copy of the instance variables.
protected static boolean detectMemberInFolderTree(ACS _acs, java.lang.String _folderType, ACSObject _obj)
          This method is used when memberOneTimeInTree_ is true, to detect the member in all the folders of the tree, for given virtual folder type.
 boolean equals(java.lang.Object _obj)
          Tests of equals() on name, children and parent.
 int fastHashCode()
          Deprecated.  
 void finalizeForBase()
          All the internal maps are set to null and the folder is unregistered in its ACS.
 void finalizeForUser()
          This method controls the immutability of the object, removes the associates, then calls finalizeForBase().
protected  void finalizeFromDeserialization()
          This method does not finalize the attributes, since there are only weak links.
 ImmutableName getAcsName()
           
 ImmutableACS getEorACS()
           
 ACSObject getEorAliasAsInternalHardReference()
          Get the unique ACSObject, if any, of this ACS for which this object is an internal hard reference.
 java.util.List<PrivilegeForLinks> getEorImmutableL_TargetInheritedLinkedPrivileges()
          Gets all the immutable list of the inherited linked privileges of the target.
 ImmutableVirtualFolder[] getEorL_Children()
          An array of external object references on the children of this node.
protected  java.util.List<PrivilegeForLinks> getEorL_TargetInheritedLinkedPrivileges()
          Gets all the inherited linked privileges of this target.
 java.util.List getEorL_TargetPrivilegeForLinks()
          Gets all the PrivilegeForLinks linked to this target, not the privilegeForTypes.
 java.util.List getEorL_TargetPrivilegeForTypes()
          Gets all the PrivilegeForTypes of this target.
 java.util.List getEorL_TargetPrivileges()
          Gets all the privileges linked to this target.
 ImmutableNode getEorParent()
          Gets the current parent node of the leaf
 ACSObject getEorReferenceAsInternalHardAlias()
          Get the unique ACSObject, if any, of this ACS as reference for which this object is an internal hard alias.
 boolean getHasSoftAlias()
          This property is not displayed in the GUI.
 java.util.List getImpliedViews()
          Get the open ViewInBases containing this BaseObject.
 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 for the external soft aliases.
 java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedLinkedPRIRights()
          Gets the internal map of the inherited linked privilege rights, where the key is the name of the EligibleParty having the rights, extended with, as last component, the parent order of the direct or indirect parent which has given the rights.
 java.lang.String getMainVFType()
          The virtual folder main type is defined by the constructor.
 boolean getMemberOneTimeInTree()
          True if the ACS does not allow an ACSObject to be more than one time in the folders tree of relevant type (EP tree or Resource tree).
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
          Returns the change listeners for a property.
protected  void removeAcsOfSoftReferences(ImmutableName _acs)
          Removes an external or internal alias from the master as soft reference.
 void removeEorBaseObject(BaseObject _obj)
          Removes a member to the folder and unregisters it in the object.
protected  void removeEorChild(ImmutableLeaf _child)
          Removes a child from this Node.
 void removeEorPrivilegeToTarget(Privilege _priv)
          Unregisters the privilege when it is no more used by this privilege target.
protected  void removeEorSoftAlias(ImmutableName _alias)
          Removes a soft alias.
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.
 void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
          removes a listener to the bean for the properties: Used for the superclass properties, and for: 'ImpliedOpenViews', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'TaPrivReadyFromParent', 'AllowTaPrivFromParent', 'Children'.
 void resetInheritedPrivilegeRights(PrivilegeForLinks _lpri)
          Resets the inherited Privilege rights after an user edition.
 void resetInheritedPrivilegeRightsOfChildren(PrivilegeForLinks _lpri)
          Resets the inherited Privilege rights in the children, if the Privilege inheritance is applicable.
 PrivilegeForLinks selectInheritedPrivilege(PrivilegeForLinks _lpri, java.lang.String _type)
          Returns the Privilege to use as inherited Privilege in a child.
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 setEorL_TargetInheritedLinkedPrivileges(java.util.ArrayList<PrivilegeForLinks> _l_priv)
          Sets all the inherited linked privileges for this target.
protected  void setEorReferenceAsInternalHardAlias(ACSObject _ref)
          Set the unique ACSObject, if any, of this ACS for which this object is an internal hard alias.
 void setType(java.lang.String _type)
          If the argument is allowed by the ACS, sets the secondary type of this instance.
static VirtualFolder valueOf(ImmutableName _name, ACS _acs, VirtualFolder _parent, java.lang.String _type, java.lang.Boolean _forResourcesOnly)
          No use, since CollectionPropertyEditor calls BaseObjectHandler.
 
Methods inherited from class ARoad0.gBase.FolderAbst
addOwnListening, containsBaseObject, finalize, finalizeForCopy, firePropertyChange, getComment, getConnectedToSeveralACS, getEorBaseError, getEorL_ConnectedACSNames, getEorM_BaseObjects, getFullName, getName, getNickName, getSerialVersionUID, getType, hashCode, isEmpty, prepareAfterRestoring, prepareBeforeSaving, prepareDataAfterRestoring, propertyChange, removeOwnListening, setComment, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableSource
getType
 
Methods inherited from interface ARoad0.gBaseInterface.Folder
propertyChange, setComment
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableFolder
containsBaseObject, getComment, getConnectedToSeveralACS, getEorL_ConnectedACSNames, getEorM_BaseObjects, getType, isEmpty
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutablePrivilegeTarget
getType
 
Methods inherited from interface ARoad0.gBaseInterface.BaseObject
getFullName, getName, getNickName, hashCode
 

Field Detail

EP_VFOLDER

public static final java.lang.String EP_VFOLDER
The VFType when the folder is for Eligible Parties which are also Resources, excluding the GroupIDMembers.

See Also:
Constant Field Values

RES_VFOLDER

public static final java.lang.String RES_VFOLDER
The VFType when the folder is for simple Resources only, which are not Eligible Parties.

See Also:
Constant Field Values

aCS_

protected ACS aCS_

parent_

protected ImmutableVirtualFolder parent_

VFType_

protected java.lang.String VFType_
The default value of VFType_ is never used


folderMember_

protected transient CFolderMemberImpl folderMember_
folders handler of this instance, only for ViewInBase links. Then it is a transient property.


privHandler_

protected CPrivilegeUserImpl privHandler_
privileges handler of this instance


nodeHandler_

protected CNodeImpl nodeHandler_
children handler of this instance


aliasHandler_

protected CAliasImpl aliasHandler_
Optional alias handler of this instance.


memberOneTimeInTree_

protected boolean memberOneTimeInTree_
True if an ACSObject cannot be in a folders tree more than one time, as member of one of the virtual folders. If false, several folders in an ACS may have the same object as member. This is set by the ACS.


EMPTY_INSTANCE

public static final VirtualFolderImpl EMPTY_INSTANCE

serialPersistentFields

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

Constructor Detail

VirtualFolderImpl

public VirtualFolderImpl()
Default constructor


VirtualFolderImpl

public VirtualFolderImpl(ImmutableName _name,
                         ACS _acs,
                         VirtualFolder _parent,
                         java.lang.String _type,
                         java.lang.Boolean _forResourcesOnly)
                  throws CreateError
Used by the beamer editor for the ACS VirtualFolders list, from the 'New' button, and by the gWork.AcsFactory. Calls the other constructor.

Parameters:
_name - name of the folder name. Its last component is added to the _parent name if _parent is not null, or to the _acs name, to get the folder name. Never null.
_acs - is the main ACS of the folder to create. Never null.
_parent - is the folder which contains this folder, and with the same type; may be null or immutable.
_type - is the folder type. Used like the Resource type. If null, the internal value is "<undefined>". Not the main type, get through getMainVFType.
_forResourcesOnly - defines the basic folder type; true if the folder manages only Resources as children (RES_VFOLDER type), and false when Resource Eligible Parties may also be children (EP_VFOLDER type)
Throws:
CreateError - if _m_BaseObjects contains a null, no ACSObject, empty-name or not _acs object, or with double link in the folders tree for a ACS, if _parent has not the same folder type, if the name is the name of a known IS node, VirtualFolder, Resource or EligibleParty, or if the object type is not managed by the ACS.

VirtualFolderImpl

public VirtualFolderImpl(ImmutableName _name,
                         ACS _acs,
                         VirtualFolder _parent,
                         java.lang.String _type,
                         java.lang.Boolean _forResourcesOnly,
                         boolean _toRegisterInManager)
                  throws CreateError
This is the main constructor. If the parent is null and if there is no root in the folders tree, registers this instance as root in the ACS. The relevant sources and targets register/unregister the typed privilege when the source, the target or the privilege is created/deleted, so sources and targets know their typed privileges, but typed privileges do not know the sources and targets which use them. This is NOT true for the TYPED_FOR_SEED privileges, which have external sources and targets having no link to these privileges. The property aliasHandler_ remains null in this constructor.

Parameters:
_name - name of the folder name. Its last component is added to the _parent name if _parent is not null, or to the _acs name, to get the folder name. Never null.
_acs - is the main ACS of the folder to create. Never null.
_parent - is the folder which contains this folder, and with the same type; may be null or immutable.
_type - is the folder type. Used like the Resource type. If null, the internal value is "<undefined>". Not the main type, get through getMainVFType.
_forResourcesOnly - defines the basic folder type; true if the folder manages only Resources as children (RES_VFOLDER type), and false when Resource Eligible Parties may also be children (EP_VFOLDER type)
_toRegisterInManager - false if this method must not register the instance in its ACS.
Throws:
CreateError - if _m_BaseObjects contains a null, no ACSObject, empty-name or not _acs object, or with double link in the folders tree for a ACS, if _parent has not the same folder type, if the name is the name of a known IS node, VirtualFolder, Resource or EligibleParty, or if the object type is not managed by the ACS.
Method Detail

valueOf

public static VirtualFolder valueOf(ImmutableName _name,
                                    ACS _acs,
                                    VirtualFolder _parent,
                                    java.lang.String _type,
                                    java.lang.Boolean _forResourcesOnly)
                             throws CreateError
No use, since CollectionPropertyEditor calls BaseObjectHandler. Calls the main constructor. Caution: it has to not be used as a Resource name in the same ACS, because linked privileges have resources and folders as targets.

Parameters:
_name - of the view. It is copied.
_acs - is the main ACS of the folder to create. Never null.
_parent - is the folder which contains this folder, and with the same type; may be null.
_type - is the folder type. If null, the internal value is "". Used for some typed privileges. The main type is get through getMainVFType.
_forResourcesOnly - defines the basic folder type; true if the folder manages only Resources as children (RES_VFOLDER type), and false when Resource Eligible Parties may also be children (EP_VFOLDER type)
Throws:
CreateError - if _acs is null, or from the constructor.

copy

public java.lang.Object copy(ImmutableName _name,
                             ACS _acs,
                             Node _parent,
                             java.lang.Boolean _toRegisterInManager)
                      throws CreateError
This method provides a copy of the instance with another name, without children copying because the copy order will not be always correct.

Parameters:
_name - is the copy name. Caution: it has to not be used as a Resource name in the same ACS, because linked privileges have resources and folders as targets.
_acs - is the main ACS of the copy to create. May not be the ACS of this instance.
_parent - is the VirtualFolder (not Node!) which belongs to _acs and will have the copy. May be null.
_toRegisterInManager - false if this method must not register the instance in the ACS.
Returns:
Object is a copy as VirtualFolderImpl instance
Throws:
CreateError - of the constructor with the same parameters, or if _parent is not a virtual folder, or _parent ACS is not _acs.

copyOwnVariables

protected VirtualFolderImpl copyOwnVariables(VirtualFolderImpl _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

detectMemberInFolderTree

protected static final boolean detectMemberInFolderTree(ACS _acs,
                                                        java.lang.String _folderType,
                                                        ACSObject _obj)
This method is used when memberOneTimeInTree_ is true, to detect the member in all the folders of the tree, for given virtual folder type. No exception if the member is there more than one time.

Parameters:
_acs - is the ACS of the folders tree
_folderType - is RES_VFOLDER or EP_VFOLDER
_obj - is a new member which could be already in the folder tree
Returns:
boolean true if _obj has been detected one time or more in the tree. Always false if one parameter is null, or if _folderType is not a folder type.

getEorACS

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

getMainVFType

public java.lang.String getMainVFType()
The virtual folder main type is defined by the constructor.

Specified by:
getMainVFType in interface ImmutableVirtualFolder
Returns:
String of main VF type, which is "RES_VFOLDER" or "EP_VFOLDER". Not null.

setType

public void setType(java.lang.String _type)
             throws UpDateError
If the argument is allowed by the ACS, sets the secondary type of this instance. The main type is EP_VFOLDER or RES_VFOLDER. This method is used by the constructor, 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. To do that, '<12345678901234567890>' is a program-reserved value. Even if it is not allowed by the ACS, '<12345678901234567890>' is the only new value it is possible to change from a type 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 '<1234567890123456789>', 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 BasicImpl.setType(). This method is called from the GUI, by finalizeForBase() and by the constructor. Calls ACS.getM_TypesAndGUIPolicy() to have the allowed values, if any, for the keys 'VirtualFolder.ResourceVFType' and 'VirtualFolder.EPVFType'. If there is no allowed values, all the values are possible.

Calls also ACSImpl.getM_TypeOrientedPolicy(), BaseUtilityImpl.getObjectTypeWithoutImmutable(). Fires the event 'VirtualFolderType'.

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.

addEorBaseObject

public void addEorBaseObject(BaseObject _obj)
                      throws CreateError
Adds a member to this virtual folder. For a RES_VFOLDER, it has to be a Resource and not an EligibleParty. For a EP_VFOLDER, the member has to be a Resource and it may be an EligibleParty. A member is not a child in the folders tree. If each member has to be limited to one instance in the folders tree, and this is controlled. Uses ACSImpl.getM_TypeOrientedPolicy().'VirtualFolder.TypesOfMemberFor.' to control the type of the new member. Calls BasicImpl.addInVFolderList(). Overrides FolderAbst.addEorBaseObject() to control the new member and to register this instance in the argument, then calls the super method.

Specified by:
addEorBaseObject in interface Folder
Overrides:
addEorBaseObject in class FolderAbst
Parameters:
_obj - non-null ACSObject to add in the folder (Resource or EligibleParty)
Throws:
CreateError - if the object is already known by the view, if it is known in the tree when it is restricted to one instance, or it is not a resource or an actor (following the main type), or if its ACS is not the folder ACS, or the object type is not authorized.

removeEorBaseObject

public void removeEorBaseObject(BaseObject _obj)
                         throws CreateError
Removes a member to the folder and unregisters it in the object. Overrides the superclass method.

Specified by:
removeEorBaseObject in interface Folder
Overrides:
removeEorBaseObject in class FolderAbst
Parameters:
_obj - non-null object to remove in the folder
Throws:
CreateError - if the object name is empty, or the object is not known by the folder.

getImpliedViews

public java.util.List getImpliedViews()
Get the open ViewInBases containing this BaseObject.

Returns:
List of ViewInBase. May be empty, but never null.

getEorReferenceAsInternalHardAlias

public ACSObject getEorReferenceAsInternalHardAlias()
Get the unique ACSObject, if any, of this ACS as reference for which this object is an internal hard alias.

Specified by:
getEorReferenceAsInternalHardAlias in interface ImmutableSource
Specified by:
getEorReferenceAsInternalHardAlias in interface ImmutableTarget
Returns:
the reference. May be null.

getEorAliasAsInternalHardReference

public ACSObject getEorAliasAsInternalHardReference()
Get the unique ACSObject, if any, of this ACS for which this object is an internal hard reference.

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

getHasSoftAlias

public final boolean getHasSoftAlias()
This property is not displayed in the GUI.

Specified by:
getHasSoftAlias in interface ImmutableSource
Specified by:
getHasSoftAlias in interface ImmutableTarget
Returns:
true if there is at least one external soft alias.

getL_SoftAlias

public final ImmutableName[] getL_SoftAlias()
Gets a sorted array of names for the external soft aliases.

Specified by:
getL_SoftAlias in interface ImmutableSource
Specified by:
getL_SoftAlias in interface ImmutableTarget
Returns:
ImmutableName[]. 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 ImmutableSource
Specified by:
getL_AcsOfSoftReferences in interface ImmutableTarget
Returns:
ImmutableName[] of the ACS. May be null but not empty.

equals

public boolean equals(java.lang.Object _obj)
Tests of equals() on name, children and parent.

Specified by:
equals in interface BaseObject
Specified by:
equals in interface ImmutableVirtualFolder
Overrides:
equals in class java.lang.Object
Parameters:
_obj - to compare to this instance
Returns:
true if _obj is a VirtualFolderImpl instance (or an instance of an extended class) equals to the current one

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
Adds a listener to the bean. Used for the superclass properties, and for: 'ImpliedOpenViews', 'OneTargetPrivilege', 'TaPrivReadyFromParent', 'AllowTaPrivFromParent', 'Children'. The following properties are managed by aliasHandler_: 'HardAliasReference', 'HardAlias', 'SoftAlias', 'AcsOfSoftReferences' and 'hasSoftAlias'.

Specified by:
addPropertyChangeListener in interface BaseBeanManager
Specified by:
addPropertyChangeListener in interface BoundBean
Specified by:
addPropertyChangeListener in interface Folder
Overrides:
addPropertyChangeListener in class FolderAbst
Parameters:
_l - 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 for the superclass properties, and for: 'ImpliedOpenViews', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'TaPrivReadyFromParent', 'AllowTaPrivFromParent', 'Children'. The following properties are managed by aliasHandler_: 'HardAliasReference', 'HardAlias', 'SoftAlias', 'AcsOfSoftReferences' and 'hasSoftAlias'.

Specified by:
addPropertyChangeListener in interface BaseBeanManager
Specified by:
addPropertyChangeListener in interface BoundBean
Specified by:
addPropertyChangeListener in interface Folder
Overrides:
addPropertyChangeListener in class FolderAbst
Parameters:
_propertyName - is the name of the property
_l - 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.

Specified by:
removePropertyChangeListener in interface BaseBeanManager
Specified by:
removePropertyChangeListener in interface BoundBean
Specified by:
removePropertyChangeListener in interface Folder
Overrides:
removePropertyChangeListener in class FolderAbst
Parameters:
_l - to remove

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String _propertyName,
                                         java.beans.PropertyChangeListener _l)
removes a listener to the bean for the properties: Used for the superclass properties, and for: 'ImpliedOpenViews', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'TaPrivReadyFromParent', 'AllowTaPrivFromParent', 'Children'. The following properties are managed by aliasHandler_: 'HardAliasReference', 'HardAlias', 'SoftAlias', 'AcsOfSoftReferences' and 'hasSoftAlias'.

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

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 to set an internal alias for one new ACSObject, as an alias or as an alias reference. 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 an ACS addon 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 an alias 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 an AcsAddon from a gBase class. Fires the events 'SoftAlias' and 'hasSoftAlias'.

Parameters:
_alias - internal or external ACSObject. No action if null, or already known.
Throws:
UpDateError - _alias belongs to the same ACS or the type is immutable
java.lang.InternalError - if the list is null. If firePropertyChange() throws an exception, displays an user message.

removeEorSoftAlias

protected void removeEorSoftAlias(ImmutableName _alias)
                           throws UpDateError
Removes a soft alias. The 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 an external 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.

finalizeForUser

public void finalizeForUser()
                     throws UpDateError
This method controls the immutability of the object, removes the associates, then calls finalizeForBase().

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

finalizeForBase

public void finalizeForBase()
                     throws UpDateError
All the internal maps are set to null and the folder is unregistered in its ACS. Called by finalizeForUser(). Calls superclass finalizeForBase(). The relevant sources and targets register/unregister the typed privilege when the source, the target or the privilege is created/deleted, so sources and targets know their typed privileges, but typed privileges do not know the sources and targets which use them. This is NOT true for TYPED_FOR_SEED privileges, which have external sources and targets having no link to these privileges. Calls setType() to unregister the typed privielges.

Specified by:
finalizeForBase in interface FinalizedObject
Overrides:
finalizeForBase in class FolderAbst
Throws:
UpDateError - from Basic.removeInVFolderList()

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. The nodes are always smaller than the leaves.

Specified by:
compareTo in interface ImmutableLeaf
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

getAcsName

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

getEorL_Children

public ImmutableVirtualFolder[] getEorL_Children()
An array of external object references on the children of this node. Children are not members. The returned type is set to allow BaseUtilityImpl to found the true returned type from the method signature, for BaseObjectHandler when it has to create a new child from the property editor.

Specified by:
getEorL_Children in interface ImmutableVirtualFolder
Returns:
the children. May be null but not empty.

getEorParent

public ImmutableNode getEorParent()
Gets the current parent node of the leaf

Specified by:
getEorParent in interface ImmutableLeaf
Returns:
ImmutableNode is a reference on the current parent node. May be null.

getEorL_TargetPrivilegeForLinks

public java.util.List getEorL_TargetPrivilegeForLinks()
Gets all the PrivilegeForLinks linked to this target, not the privilegeForTypes. Returns only the direct privileges, since the cascading is not activated in VirtualFolders.

Specified by:
getEorL_TargetPrivilegeForLinks in interface ImmutablePrivilegeTarget
Returns:
List of PrivilegeForLinks. May be empty, but never null.

getEorL_TargetPrivilegeForTypes

public java.util.List getEorL_TargetPrivilegeForTypes()
Gets all the PrivilegeForTypes of this target. Does not include the TYPED_FOR_SEED and TYPED_CLASSED_SPECIFIC privileges.

Specified by:
getEorL_TargetPrivilegeForTypes in interface ImmutablePrivilegeTarget
Returns:
List of PrivilegeForTypes. May be empty, but never null.

getEorL_TargetPrivileges

public java.util.List getEorL_TargetPrivileges()
Gets all the privileges linked to this target. There is two types of privilege links (allowed or not by the ACS):

- PrivilegeForLinks: linked privilege established for a couple (ACSObject, privilege),

- PrivilegeForType: typed privilege, where the ACSObject and the privilege has a common type, but without the TYPED_FOR_SEED and TYPED_CLASSED_SPECIFIC privileges.

Specified by:
getEorL_TargetPrivileges in interface ImmutablePrivilegeTarget
Returns:
List of Privileges. May be empty, but never null.

addEorPrivilegeForTypeToTarget

public void addEorPrivilegeForTypeToTarget(PrivilegeForType _priv)
                                    throws BaseError
Sets a privilege as applicable to this access target, and called only by the program. This method is called only by PrivilegeForTypeImpl at any creation/deletion of a typed privilege or an access target. For PrivilegeForTypes, only the TYPED and TYPED_CLASSED privilege may be argument. This is false for the TYPED_CLASSED_SPECIFIC and TYPED_FOR_SEED privileges, and this produces the throwning of an InternalError. Called by setType() to the indirect request of the VirtualFolderImpl constructor. Fires 'OneTargetTypedPrivilege' events.

Specified by:
addEorPrivilegeForTypeToTarget in interface PrivilegeTarget
Parameters:
_priv - to register in the target
Throws:
BaseError - if this instance is not a privilege target, if the privilege second type is not authorized for this target.

addEorPrivilegeForLinksToTarget

protected void addEorPrivilegeForLinksToTarget(PrivilegeForLinks _priv)
                                        throws BaseError
Sets a privilege as applicable to this access target.n. Called by PrivilegeForLinksImpl.addEorPrivilegeTargetLink() which checks the type of the target to forbid a change on an immutable target. Fires 'OneTargetLinkedPrivilege' events.

Parameters:
_priv - to register in the target
Throws:
BaseError - if this instance is not a privilege target, if the privilege second type is not authorized for this target.

removeEorPrivilegeToTarget

public void removeEorPrivilegeToTarget(Privilege _priv)
                                throws BaseError
Unregisters the privilege when it is no more used by this privilege target. Called by PrivilegeForLinksImpl and PrivilegeForTypeImpl, NOT by the GUI. PrivilegeForLinksImpl.removeEorPrivilegeTargetLink() checks the type of the target to forbid a change on an immutable target. Fires 'OneTargetTypedPrivilege' or 'OneTargetLinkedPrivilege' events.

Specified by:
removeEorPrivilegeToTarget in interface PrivilegeTarget
Parameters:
_priv - to remove
Throws:
BaseError - if the privilege and this source is unknown.

getEorImmutableL_TargetInheritedLinkedPrivileges

public java.util.List<PrivilegeForLinks> getEorImmutableL_TargetInheritedLinkedPrivileges()
Gets all the immutable list of the inherited linked privileges of the target. The LINKED_IF_ALL_SOURCE type is forbidden, and any privilege having more than one target. To use by the consumers in the gWork packages, which deny any access if the returned value is null when the privilege inheritance is managed. It is recommanded to avoid getEorL_TargetInheritedLinkedPrivileges() for these consumers. Null is the default and immutable returned value in this generic gBase class, and this has to be changed in an AcsAddon implementing the inheritance Called by gWork.LinkRights.withAccessThroughNodesTreeFromEP() and getL_accessRightsThroughNodesTree(). Caution: a clone is not registered in its ACS, nor in its sources and targets. However, it is possible in the beamer to navigate from a cloned privilege to its targets or sources.

Specified by:
getEorImmutableL_TargetInheritedLinkedPrivileges in interface ImmutablePrivilegeTarget
Returns:
immutable list of Linked Privileges. May be null but never empty.

getEorL_TargetInheritedLinkedPrivileges

protected java.util.List<PrivilegeForLinks> getEorL_TargetInheritedLinkedPrivileges()
Gets all the inherited linked privileges of this target. The LINKED_IF_ALL_SOURCE type is forbidden, and any privilege having more than one target. To use by the parent in the gBase package, to prepare the updating of the list with a call to setEorL_TargetInheritedLinkedPrivileges(). No use in this generic gBase package, so for the AcsAddon packages. In the BeanInfo class of the VirtualFolder subclass that extends this class in an AcsAddon package, this property has to be put in the pane ' PRI Inheritance '. The privilege may be a clone, and the target may not be this instance. Caution: a clone is not registered in its ACS, nor in its sources and targets. However, it is possible in the beamer to navigate from a cloned privilege to its targets or sources.

Returns:
mutable list of Linked Privileges. May be a new empty list or an old empty list, but never null.

getM_TargetInheritedLinkedPRIRights

public java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedLinkedPRIRights()
Gets the internal map of the inherited linked privilege rights, where the key is the name of the EligibleParty having the rights, extended with, as last component, the parent order of the direct or indirect parent which has given the rights. For instance, the direct parent has the string '1', and its direct parent has the string '2' as parent order in the last name component, and so on. The map value is a non-null StringRight array of inherited rights, and it may be empty. Called by gWork.LinkRights.withAccessThroughNodesTreeFromEP() and getL_accessRightsThroughNodesTree(), but only in the AcsAddons implementing the linked privilege inheritance. Such an AcsAddon may also choose to not use this property.

Specified by:
getM_TargetInheritedLinkedPRIRights in interface ImmutablePrivilegeTarget
Returns:
unmodifiable map of inherited rights from the linked privileges. May be empty but never null.

setEorL_TargetInheritedLinkedPrivileges

protected void setEorL_TargetInheritedLinkedPrivileges(java.util.ArrayList<PrivilegeForLinks> _l_priv)
Sets all the inherited linked privileges for this target. Called only by the parents. Do not register this instance in the inherited linked privileges. Calls setM_TargetInheritedLinkedPRIRights() to set the map (source name+order, StringRight[]). No use in this generic gBase package, so for the AcsAddon packages. Fires 'InheritedTargetPrivileges' events.

Parameters:
_l_priv - list of one-target Linked Privileges. May be empty, but never null.
Throws:
java.lang.InternalError - if a privilege has the LINKED_IF_ALL_SOURCE type, or if it has not exactly one target.

resetInheritedPrivilegeRights

public void resetInheritedPrivilegeRights(PrivilegeForLinks _lpri)
Resets the inherited Privilege rights after an user edition. Called by the parent when there is a change in the effective rights of an inherited Privilege. This is only when there is a change in the sources. Contrary to AclEntry, the rights are immutable and there is no conditional group. The subclassing of CPrivilegeUserImpl is possible in an AcsAddon, but it is also possible to overread the same method in a subclass of this class. Not described in the BeanInfo since the user does not call it. Note: the creation of the inherited Privilege in a child is not handled by the generic gBase package, while the rights updating of the inherited Privilege is handled. Called by resetInheritedPrivilegeRightsOfChildren().

Specified by:
resetInheritedPrivilegeRights in interface VirtualFolder
Parameters:
_lpri - inherited Privilege with updated rights. Never null.

selectInheritedPrivilege

public PrivilegeForLinks selectInheritedPrivilege(PrivilegeForLinks _lpri,
                                                  java.lang.String _type)
Returns the Privilege to use as inherited Privilege in a child. Empty method which returns the argument. Should be never called, and throws an InternalError. Has to be overridden into an AcsAddon handling the privilege inheritance.

Specified by:
selectInheritedPrivilege in interface ImmutablePrivilegeTarget
Specified by:
selectInheritedPrivilege in interface VirtualFolder
Parameters:
_lpri - the initial Privilege which may be given to the child
_type - type of a child, as VirtualFolder
Returns:
the inherited Privilege if the child inherits this initial Privilege, or null

resetInheritedPrivilegeRightsOfChildren

public void resetInheritedPrivilegeRightsOfChildren(PrivilegeForLinks _lpri)
Resets the inherited Privilege rights in the children, if the Privilege inheritance is applicable. There are two flows of data to manage the inherited Privileges:

- one at the privilege creation/deletion, and this is not done in the generic gBase package,

- one at their sources editing,

This method is called for handling the second case, to update the children of the VirtualFolder which is the target of the Privilege. Not described in the BeanInfo since the user does not call it. Called by PrivilegeForLinksImpl.resetRightsAsInheritedPrivilege().

Specified by:
resetInheritedPrivilegeRightsOfChildren in interface VirtualFolder
Parameters:
_lpri - inherited privilege with updated sources

getMemberOneTimeInTree

public boolean getMemberOneTimeInTree()
Description copied from interface: ImmutableVirtualFolder
True if the ACS does not allow an ACSObject to be more than one time in the folders tree of relevant type (EP tree or Resource tree).

Specified by:
getMemberOneTimeInTree in interface ImmutableVirtualFolder
Returns:
boolean true if the ACS does not allow an ACSObject to be more than one time in the folders tree of this folder.

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

addEorChild

protected void addEorChild(ImmutableLeaf _child)
Adds a child to this Node. A child is not a member. Used by the children constructor. Does not update the parent internal variable in the child. No control on the ACS type policy, since it is done in the VirtualFolderImpl constructor which calls this class for adding a new child. A parent type which contains 'immutable' does not forbid to add children to the parent. Detects the child through a name comparison. Fires the event 'Children'.

Parameters:
_child - is a VirtualFolder (not a simple leaf) to put in this Node. No action if null, or already known.
Throws:
java.lang.InternalError - if the leaves list is null, or if _child is not a VirtualFolder. If firePropertyChange() throws an exception, displays an user message.

removeEorChild

protected void removeEorChild(ImmutableLeaf _child)
                       throws UpDateError
Removes a child from this Node. Used by the children finalizing methods. Does not update the parent internal variable in the child. Detects the child presence through a name comparison. If firePropertyChange() throws an exception, displays an user message. No action if the children list is null, to speed up the finalizing of this instance, when children are called to be finalizing.

Parameters:
_child - is a virtual folder which is in this CNode. No action if null.
Throws:
UpDateError - if _child is not known.

finalizeFromDeserialization

protected void finalizeFromDeserialization()
This method does not finalize the attributes, since there are only weak links. It it is not necessary to cut them after a deserialization. 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. Does not call finalizeForBase(). Called by EPRViewInBaseImpl only.

Overrides:
finalizeFromDeserialization in class FolderAbst

fastHashCode

public int fastHashCode()
Deprecated. 

Returns:
the fastHashCode value for this object, faster than hashCode() because Resource.hashCode() is not called, the hashcodes of the children are not implied, only name_ and parent_ are used.