ARoad0.gBase
Class AssociateUtilityImpl

java.lang.Object
  extended by ARoad0.gBase.AssociateUtilityImpl
All Implemented Interfaces:
Singleton

public class AssociateUtilityImpl
extends java.lang.Object
implements Singleton

This class is a utility class for gBase to manage the association scripts. Associations to do are calls to constructors and methods in gBase, with all the required arguments.

Associations may be to process when a new object of a given class and type is created in an ACS, or when a child ACS specifies constraints on its ACSObject roots in its parent ACS. The AcsAddon classes are managed.

The first type of association is in the same ACS, at the creation or at the deletion of a new object which is called the master object. The second type of associations to handle is for a child ACS which has an associate, called root, in its parent ACSs.

For instance, it allows, after each creation of an account, to create a group in the same ACS having the same last component in its name, then to register the new account in this new group.

A second example is when a child ACS opening sets the creation of a root like an Actor in a direct or indirect parent ACS.

A third example is when a child ACS sets the integrity of a root in a parent ACS, as a criterion to ensure its proper working.

The main limitations are:

- it is not possible to add associations to a new AclEntry or a new Privilege. It is possible to create an AclEntry or a Privilege after the creation of an ACSObject, and then to edit the properties of this AclEntry or Privilege.

- it is possible to use an ACSObject as argument in a constructor or a method if its name may be get simply from the new object name or the ACS name. It is not possible to compute a name for instance from the parent name of the new object, or to get it through a given method called on this new object.

These limitations about the associations may be overcomed by the way of a dedicated AcsAddon. It is easy to add to a gBase class some methods for the handling of the object constructions. The AcsAddon designer has the choice to use an association for calling these specific methods, or to directly code their calling in the AcsAddon gBase classes. With an association, the script is visible in the GUI for the advanced users, on the contrary of a hard-coded function.

The allowed String map keys are described in the methods getL_MapKeyStartsForAssociationsOnNewObject and getL_MapKeyStartsForAllRoots.

The map values define one or several actions to process or to check. The keys that are applicable are searched for every creation/deletion of an ACSObject, and at every opening/closing of an ACS.

The controlAssociations method gives details on the syntax of the scripts.

See Also:
controlAssociations(ARoad0.gBase.ACSFactoryImpl, java.util.HashMap, java.lang.String, java.lang.String[], boolean)

Field Summary
private static int INITIAL_CAPACITY
           
private static AssociateUtilityImpl instance__
           
 
Constructor Summary
private AssociateUtilityImpl()
          with this private constructor, the compiler won't generate a default public constructor.
 
Method Summary
protected static java.util.List<java.lang.Object> addAssociateActions(BaseObject _object, java.lang.String[] _l_actions, ACS _acsChild)
          Executes the creating and updating commands.
static void addAssociatesAfterCreation(ACSObject _master)
          Executes the ACS associations after the creation of an ACSObject.
static java.util.List<java.lang.Object> addRootsInParentACSs(ACS _child, java.util.Map _m_asso)
          Applicates the creation commands for the ACS roots after the creation or the opening of a child ACS, in the case where these roots do not exist yet.
static java.lang.String controlAssociations(ACSFactoryImpl _factory, java.util.HashMap<java.lang.String,java.lang.String[]> _m_Associations, java.lang.String _masterKey, java.lang.String[] _l_values, boolean _withNumber)
          Checks up the two types of associations to handle for a new ACS.
static java.util.Map fillDerivedAssociations(ACSFactoryImpl _factory, ACS _refAcs, java.util.Map _associationMap)
          Called by ActionNewACSyst.fillDerivedACSproperties() to fill the new ACS with all the association scripts for new objects to be copied, or for the roots in the ACS parent.
static AssociateUtilityImpl getInstance()
          Only method to obtain the unique instance of AssociateUtilityImpl.
static java.lang.String[] getKeysForConstrainedChildACSMap()
          Gets the relations a root parent ACSObject may have with a constrained and opened child ACS.
static java.lang.Object[] getL_ArgumentsForAssociations(BaseObject _object, java.util.Map _m_arguments, java.lang.Boolean _creation, java.lang.String[] _l_values, java.lang.Class[] _l_argumentsClass, ACS _acsChild)
          Gets the arguments to use for a constructor in a method or an action.
protected static java.util.Map<ImmutableName,java.util.List<java.lang.String>> getL_AssociatesAndCalledMethods(BaseObject _object, java.lang.String[] _l_actions, ACS _acsChild)
          Parses the ACS association commands to get the associates in a large sens, and the methods which are implied.
static java.util.List<java.lang.String> getL_LimitedFirstValuesForAssociation(java.lang.String _key)
          This method defines the first value for an association.
static java.util.Set<java.lang.String> getL_MapKeyMatchingForAssociationsOnNewObject(ACSObject _obj)
          Defines the possible cases for associations, and it depends on the argument type.
static java.util.List<java.lang.String> getL_MapKeyStartsForAllRoots()
          This method returns the allowed startings for the values which are used as map keys for the child ACS roots.
static java.util.List<java.lang.String> getL_MapKeyStartsForAssociationsOnNewObject()
          This method returns the allowed startings for the values which are used as map keys for associations on new objects.
static java.lang.reflect.Method[] getL_MethodsForKeyOfAssociations(ACSRun _factory, java.lang.String _masterKey)
          Gets the methods which are applicable for a given criteria in the map of associations for objects.
static java.util.Set<ImmutableName> getL_RootsWithoutDeletingInParentACSs(ACS _child)
          Gets the roots that a child ACS needs to have in its parent ACS, and which are not to delete at the closing of the child ACS.
static java.util.HashMap<java.lang.String,java.lang.String[]> getM_FilteredAssociations(java.util.HashMap<java.lang.String,java.lang.String[]> _m_Associations, boolean _filtered)
          Gets the associations to handle by the mean of actions to do by the program.
protected static void removeAssociateActions(BaseObject _object, java.lang.String[] _l_actions, ACS _acsChild)
          Executes the deleting and updating operations in the ACS association commands.
static void removeAssociatesAfterDeletion(ACSObject _deletedObject, ACS _acsChild)
          Removes the ACS associations after the deletion of an ACSObject.
static void removeRootsInParentACSs(java.util.Map _m_asso, ACS _child)
          Executes the deleting commands for the ACS roots at the closing of a child ACS, in the case where this deleting is required.
static java.lang.Object[] setFinalArgumentsForAssociateCreation(java.lang.Object[] _l_argumentsValues, java.beans.BeanDescriptor _beanDescriptor)
          Sets the absolute arguments to use in the call of the constructor, through an analyze of the relative names to concatenate.
static java.util.List<java.lang.String[]> splitActionSetsForAssociations(java.lang.String[] _l_values)
          Splits the list of numbered actions to return arrays where are put all the actions having the same number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance__

private static AssociateUtilityImpl instance__

INITIAL_CAPACITY

private static final int INITIAL_CAPACITY
See Also:
Constant Field Values
Constructor Detail

AssociateUtilityImpl

private AssociateUtilityImpl()
with this private constructor, the compiler won't generate a default public constructor.

Method Detail

getInstance

public static AssociateUtilityImpl getInstance()
Only method to obtain the unique instance of AssociateUtilityImpl.

Returns:
AssociateUtilityImpl

getL_MapKeyStartsForAssociationsOnNewObject

public static final java.util.List<java.lang.String> getL_MapKeyStartsForAssociationsOnNewObject()
This method returns the allowed startings for the values which are used as map keys for associations on new objects. Does not allow the associations on new AclEntries or Privileges. Not used for the child ACS roots.

The allowed keys are starting by a range of values including:

- 'Class'.'Property'.<Value>.XXX: a new object property has the value XXX;

- 'Class'.'Property'.<ValueContains>.XXX: a new object property value contains the value XXX; when the property is a Name, this is the name last component which contains the value XXX.

- 'Class'.'Property'.<Class>.XXX: a new object property has a class with exactly the simple name XXX;

- 'Class'.'Property'.<NameStartsWith>.XXX: the new object property name starts with the ACS name plus the subname XXX;

- 'Class'.<NameStartsWith>.XXX: the new object name of the class starts with the ACS name plus the subname XXX;

- <Class>.<Value>.XXX: the new object class is exactly gBase.XXX, both for a generic class and for an AcsAddon class;

The first word 'Class' may have the value 'Resource', 'Directory', 'Actor', 'GroupID', 'UserID' or 'VirtualFolder'. The key starting 'ACS.Name.<Value>' is forbidden there, since it is reserved to associations for the roots. Any implied object property has to be an argument in the object constructor. If a returned value is ending by a point, it is a true starting value. Otherwise, it is a completed value which forbids any adding.

Returns:
List containing the allowed String values
See Also:
addAssociatesAfterCreation(ARoad0.gBaseInterface.ACSObject), getL_MapKeyStartsForAllRoots()

getL_MapKeyMatchingForAssociationsOnNewObject

public static final java.util.Set<java.lang.String> getL_MapKeyMatchingForAssociationsOnNewObject(ACSObject _obj)
Defines the possible cases for associations, and it depends on the argument type. The possible types are 'Resource', 'Directory', 'Actor', 'UserID', 'GroupID' and 'VirtualFolder'. Only one type is selected, if any. Not for child ACS roots. Called by add/removeAssociatesAfterCreation() and ACSFactoryImpl.addAssociationsToNewObject().

Parameters:
_obj - just-created by the GUI, having or not some associates
Returns:
List containing the keys which match to the new object. May be null or empty.
See Also:
getL_MapKeyStartsForAssociationsOnNewObject()

getL_MapKeyStartsForAllRoots

public static final java.util.List<java.lang.String> getL_MapKeyStartsForAllRoots()
This method returns the allowed startings for the values which are used as map keys for the child ACS roots. Not used for associations on new objects.

The criteria is a map key with one allowed form for the starting, which is 'ACS.Name.<Value>.'. Any implied object property has to be an argument in the object constructor. If a returned value is ending by a point, it is a true starting value. Otherwise, it is a complete value which forbids any adding.

Returns:
List containing the allowed String values
See Also:
ACSFactoryImpl.addOpeningNoClosingRoots(java.lang.String, java.lang.String[]), getL_MapKeyStartsForAssociationsOnNewObject()

getM_FilteredAssociations

public static final java.util.HashMap<java.lang.String,java.lang.String[]> getM_FilteredAssociations(java.util.HashMap<java.lang.String,java.lang.String[]> _m_Associations,
                                                                                                     boolean _filtered)
Gets the associations to handle by the mean of actions to do by the program. Actions have numbers from 1 to 999. Called by controlAssociations(), ACSFactoryImpl.addAssociations(), getM_AssociationsOnNewObject(), getM_OpeningAndClosingRoots(), getM_OpeningNoClosingRoots(), getM_IntegrityRoots() and createACS().

Parameters:
_m_Associations - actions to do. May be null or empty.
_filtered - true if, since the internal map may contain values where the first characters are not 'N.', 'NN.' nor 'NNN.', the first no-number value and all the followings are not returned by this method
Returns:
a copied map where the key is a String, and the value is an array of Strings, started (if _filtered false) or not by a number between 1 to 999 followed by a point. May be empty, but not null.

controlAssociations

public static final java.lang.String controlAssociations(ACSFactoryImpl _factory,
                                                         java.util.HashMap<java.lang.String,java.lang.String[]> _m_Associations,
                                                         java.lang.String _masterKey,
                                                         java.lang.String[] _l_values,
                                                         boolean _withNumber)
Checks up the two types of associations to handle for a new ACS. The first type of association is in the same ACS, at the creation or at the deletion of a new object which is called the master object. The second type of associations to handle is for a child ACS which has an associate, called root, in its parent ACSs.

It is not possible to add associations to a new AclEntry or a new Privilege. The allowed String map keys are described in the methods getL_MapKeyStartsForAssociationsOnNewObject and getL_MapKeyStartsForAllRoots.

The map values define one or several actions to process or to check. The keys that are applicable are searched for every creation/deletion of an ACSObject, and at every opening/closing of an ACS.

In the allowed String map values, the first value has a specific type among 5 possible forms.

After the first value, the allowed String map values have another specific type among 10 possible forms. For the masters, the values after the first one are all starting by one of the 9 'PropertyName' forms, since the association specifies then the arguments to use. For the child ACS roots, it is more complex since there are 2 options after the first value:

1 - the association specifies a root in the parent ACS which should be there or created at the child ACS opening, or should be deleted at the child ACS closing, and then the allowed map values, after the first one, are arguments to create it, to check its presence or to delete it, and these arguments are like the master arguments, using both <AssociateClass> and some <CalledMethod> first values,

2 - the association specifies a root integrity as a criterion for the working of the child ACS, and this means that any change on the inner properties of the root may alterate the working of the child ACS, including all its not-simulated root inner properties (for instance a child ACS parameter, if the root is a configuration text file); then, the first value is starting by the key word <AssociateClass>, the second value is a 'PropertyName' to give the name of this root, and the third and last value is the key word '<GeneralCriterion>.<RootIntegrity>'.

Action specification:

There are 5 allowed forms for the first value of the action N for the masters, but only 3 authorized forms for the child ACS roots:

- <AssociateClass>.XXX which specifies the class name XXX in the generic gBase or in the AcsAddon gBase, without the 'Impl' end, of an associate object to build up or to finalize when the master is build up or finalized, or the child ACS root to open, to close or to check up

- <CalledMethod>.<Master>.YYY which specifies the method YYY to call on the master (forbidden for child ACS roots),

- <CalledMethod>.<ACS>.YYY which specifies the method YYY to call on the master or the parent ACS; for the masters, the only authorized values are 'handleAssociationsForInnerObject', for the parent ACS, there is no method restriction,

- <CalledMethod>.<Action>.C.ZZZ which specifies the method ZZZ to call on the associate previously created by the action number C

- <CalledMethod>.<Object>.XXX+<Class>+YYY+<Value>+ZZZ which specifies the method ZZZ to call on the future ACSObject having the name XXX and the class ZZZ, where the parameters must be the master or an associate (to set the reverse operation when it is finalized) (forbidden for child ACS roots).

With '<AssociateClass>', the associate instance is not created if it is returned by BaseUtilityImpl.getBaseObject() from the name in the first argument. As usual ,the associate is then put in the list of accessible objects for any '<CalledMethod>.<Action>' association.

Argument specification:

After each first value, there is the optional list of the specifications for the arguments. Arguments may be for an object constructor, for the root integrity marker (case 1) or for the method named in the action (cases 2 to 5). There is one specification per argument, so one command per argument.

Each argument specification must fulfill one of the 10 allowed forms. They are presented herein without the number 'N.', sometimes at the start for the action N:

(1) 'PropertyName'.<Null>: null value for the argument having the name 'PropertyName'.

For any first value. For the master creating/deleting, and for the child ACS root opening/deleting.

(2) 'PropertyName'.<Master>: the master is the argument

For any first value. For the master creating/deleting only, and for the child ACS root opening/deleting where 'Master' is the parent ACS.

(3) 'PropertyName'.<MasterCreation>: boolean true if the master is creating,

false if it is finalizing. For any first value. For the master creating/deleting, and for the child ACS root creating/deleting.

(4) 'PropertyName'.<ArgumentValue>.C: the associate number C object.

For any first value. For the master creating/deleting, and for the child ACS root opening/deleting.

(5) 'PropertyName'.<Value>.XXX: the argument is XXX as String, ImmutableName

if it is the property type, true/false if the type is boolean, or any BaseObject get from its name. For any first value. For the master creating/deleting, and for the child ACS root opening/deleting.

(6) 'PropertyName'.<Value>.XXX+<MasterValue>+YYY: the master value

for the same property in its BeanInfo (the read method has to not return an array), with some optional pre and post String values if the property type is String. For any first value. For the master creating/deleting, and for the child ACS root opening/deleting where 'Master' is the parent ACS.

> (7) 'PropertyName'.<Value>.XXX+<MasterNameLastComponent>+YYY:

the last component in the master name, with some optional pre and post Name values as Strings. For any first value. For the master creating/deleting, and for the child ACS root opening/deleting where 'Master' is the parent ACS.

(8) 'PropertyName'.<Value>.<MasterNameContext>+YYY

the context in the master name, with a post Name value as String For any first value. For the master creating/deleting, and for the child ACS root opening/deleting where 'Master' is the parent ACS.

(9) 'PropertyName'.<Value>.<ACSName>+YYY: the ACS name,

with a post Name value as String. For any first value. For the master creating/deleting, it is the master ACS name. For the child ACS root opening/deleting and the integrity criteria, it is the parent ACS name.

(10) 'PropertyName'.<Value>.XXX+<ChildNameLastComponent>+YYY:

the last component in the child ACS name, with some optional pre and post Name values as Strings. For any first value. Only for the child ACS root opening/deleting and the integrity criteria.

The root integrity marker is not an argument specification. It is the 11th allowed form after the first value, and only one occurence is authorized in the array of values. If it is there, '<GeneralCriterion>.' must always be in the last value:

- <GeneralCriterion>.<RootIntegrity>: any change on the inner properties

of the root may alterate the working of the child ACS,

including all the not-simulated root inner properties.

Only after a <AssociateClass> first value, and

a 'Name.<Value>.<ACSName>+' second value

with the parent ACS name, and only for a child ACS integrity criteria.

Controls in this method are on the presence of the class and the constructor, or the presence of the method, the number of arguments, but no control on arguments for the syntax, the types or the values. Meanwhile, it checks up for <AssociateClass> the argument names (not the values) from the BeanInfo descriptor of these names, returned by the value 'constrArgumentPropertyNames'. The returned message 'Error: lack of arguments' is the only error message used by AssociationMapPropertyEditor. Caution: any change in this method has to be also done in Gui1.AssociationMapPropertyEditor.addRestrictedValueElements(). Gui1.ActionMapPropertyEditor.addValueElements() uses the control message. Calls getL_MethodsForKeyOfAssociations(). Called by ACSFactoryImpl.checkACSbeforeCreation(), add/removeAssociations().

Parameters:
_factory - caller of this method
_m_Associations - actions to do. May be null or empty.
_masterKey - the key in the associations map. It must start with 'ACS.Name.<Value>.' for the child ACS roots.
_l_values - is a String array which contains the values for the criteria. Never null but the lenght may be 0.
_withNumber - true if all the items in _l_values have to start with 'N.', and false otherwise.
Returns:
null if the checking rules are fulfilled, or a message which explains the first integrity error, and starts with 'Error: ' or 'Error to delete:'.
See Also:
getL_MapKeyStartsForAssociationsOnNewObject(), getL_MapKeyStartsForAllRoots()

getL_MethodsForKeyOfAssociations

public static final java.lang.reflect.Method[] getL_MethodsForKeyOfAssociations(ACSRun _factory,
                                                                                java.lang.String _masterKey)
Gets the methods which are applicable for a given criteria in the map of associations for objects. Used also for the child ACS roots key. The master key is a map key among the followings:

- 'Class'.'Property'.<Value>.XXX: a new object property has the value XXX;

- 'Class'.'Property'.<ValueContains>.XXX: a new object property value contains the value XXX;

- 'Class'.'Property'.<Class>.XXX: a new object property has exactly the class XXX;

- 'Class'.'Property'.<NameStartsWith>.XXX: the new object property name starts with the ACS name plus the subname XXX;

- 'Class'.<NameStartsWith>.XXX: the new object name of the class starts with the ACS name plus the subname XXX;

- <Class>.<Value>.XXX: the new object class is exactly ARoad0.gBase.XXX;

- <Class>.<ValueImplements>.XXX: the new object class is a subclass of ARoad0.gBase.XXX;

- for a child ACS roots key, it is a classic class or an extension class from an AcsAddon.

Called by controlAssociations().

Parameters:
_factory - for which associations are set, to find the AcsAddon class if necessary; it is the root ACS for the root associations
_masterKey - the key in the associations map, the first value of a numbered action, a classic class or an extension class from an ACSAddon.
Returns:
array of the applicable methods for the master, or null.
See Also:
getL_MapKeyStartsForAssociationsOnNewObject(), ACSFactoryUtilityImpl.L_CLASSIC_CLASS_KEYS, ACSFactoryUtilityImpl.ACSADDON_EXTENSION_CLASSES

splitActionSetsForAssociations

public static final java.util.List<java.lang.String[]> splitActionSetsForAssociations(java.lang.String[] _l_values)
Splits the list of numbered actions to return arrays where are put all the actions having the same number. Then there is one array per number. Called by ACSFactoryImpl.checkACSbeforeCreation(), add/removeAssociateActions(), getL_AssociatesAndCalledMethods().

Parameters:
_l_values - values in an association map for an acs and a given key. Not null.
Returns:
each set of actions having the same number, is in an array in the list. Never null but may be empty.

getL_ArgumentsForAssociations

public static final java.lang.Object[] getL_ArgumentsForAssociations(BaseObject _object,
                                                                     java.util.Map _m_arguments,
                                                                     java.lang.Boolean _creation,
                                                                     java.lang.String[] _l_values,
                                                                     java.lang.Class[] _l_argumentsClass,
                                                                     ACS _acsChild)
                                                              throws BaseError
Gets the arguments to use for a constructor in a method or an action. Each useful item in the argument _l_values must belong to a set of 10 allowed forms, presented herein without the number 'N.' at the start, for the action N:

- 'PropertyName'.<Null>: null value for the argument having the name 'PropertyName'.

For any first value. For the master creating/deleting,

and for the child ACS root opening/deleting.

- 'PropertyName'.<Master>: the master is the argument

For any first value. For the master creating/deleting only,

and for the child ACS root opening/deleting where 'Master' is the parent ACS.

> - 'PropertyName'.<MasterCreation>: boolean true if the master is creating,

false if it is finalizing

For any first value. For the master creating/deleting,

and for the child ACS root creating/deleting.

- 'PropertyName'.<ArgumentValue>.C: the associate number C object

For any first value. For the master creating/deleting,

and for the child ACS root opening/deleting.

- 'PropertyName'.<Value>.XXX: the argument is XXX as String, ImmutableName

if it is the property type, true/false if the type is boolean or Boolean,

or any BaseObject get from its name

For any first value. For the master creating/deleting,

and for the child ACS root opening/deleting.

- 'PropertyName'.<Value>.XXX+<MasterValue>+YYY: the master value

for the same property in its BeanInfo (the read method has to not return an array),

with some optional pre and post String values

if the property type is String

For any first value. For the master creating/deleting,

and for the child ACS root opening/deleting where 'Master' is the parent ACS.

> - 'PropertyName'.<Value>.XXX+<MasterNameLastComponent>+YYY:

the last component in the master name, with some optional

pre and post Name values as Strings

For any first value. For the master creating/deleting,

and for the child ACS root opening/deleting where 'Master' is the parent ACS.

- 'PropertyName'.<Value>.<MasterNameContext>+YYY

the context in the master name, with a post Name value as String

For any first value. For the master creating/deleting,

and for the child ACS root opening/deleting where 'Master' is the parent ACS.

- 'PropertyName'.<Value>.<ACSName>+YYY: the ACS name,

with a post Name value as String

For any first value. For the master creating/deleting, it is

the master ACS name. For the child ACS root opening/deleting and the integrity criteria, it is the parent ACS name.

- 'PropertyName'.<Value>.XXX+<ChildNameLastComponent>+YYY:

the last component in the child ACS name, with some optional

pre and post Name values as Strings

For any first value. Only for the child ACS root opening/deleting and the integrity criteria.

The last item in the argument _l_values may start with '<GeneralCriterion>.', and it is then not returned by this method. Called by add/removeAssociateActions(), getL_AssociatesAndCallesMethods().

Parameters:
_object - just-created or just-finalized ACSObject, or parent ACS to update
_m_arguments - the previous associates or intermediate arguments as values in a map, where the key is the action number of the associate or argument. Never null but may be empty.
_creation - true if the master is creating, false if it is finalizing
_l_values - set of actions having the same number, where the first item defines the constructor or method to call (do not processed there), and the other items give the arguments or the returned value. Never null nor empty.
_l_argumentsClass - classes of the arguments for the constructor or the method to use. Never null.
_acsChild - Child ACS. Not null only when _object is a parent ACS to update.
Returns:
the arguments to use. An argument may be an array, for instance through '<ArgumentValue>'.
Throws:
BaseError - if _l_values is not correct

setFinalArgumentsForAssociateCreation

public static final java.lang.Object[] setFinalArgumentsForAssociateCreation(java.lang.Object[] _l_argumentsValues,
                                                                             java.beans.BeanDescriptor _beanDescriptor)
Sets the absolute arguments to use in the call of the constructor, through an analyze of the relative names to concatenate. The relative name is a String or an ImmutableName, and the argument to put as context is the name of a BaseObject.

This method is inspired by BaseObjectHandler.setFinalArguments(), since it reads the values 'constrArgumentConcatenedNameSource', 'constrArgumentClasses', and 'constrArgumentPropertyNames' in the BeanInfo class. This method follows also the naming policy for UserIDs and GroupIDs, from the EligiblePartyImpl constructor.

Called by addAssociateActions().

Parameters:
_l_argumentsValues - relative values set by getL_ActionArgumentsForAssociations(), which is updated by this method if it is a concatenated value.
_beanDescriptor - descriptor of the ACSObject to create, from its BeanInfo
Returns:
the updated _l_argumentsValues

addAssociatesAfterCreation

public static final void addAssociatesAfterCreation(ACSObject _master)
                                             throws BaseError
Executes the ACS associations after the creation of an ACSObject. Called by ActionNewResource, ActionNewEligibleParty. Calls addAssociateActions() that does the main job, and ActionNewEligibleParty.handleNewGroup().

Parameters:
_master - just-created object, having or not some associates and actions to process. Not null.
Throws:
BaseError - if the processing is not correct

removeAssociatesAfterDeletion

public static final void removeAssociatesAfterDeletion(ACSObject _deletedObject,
                                                       ACS _acsChild)
                                                throws BaseError
Removes the ACS associations after the deletion of an ACSObject. Called by Basic.finalizeForUser().

Parameters:
_deletedObject - just-deleted by the GUI, having or not some associates
_acsChild - Child ACS. Not null only when _object is a parent ACS to update.
Throws:
BaseError - if the processing is correct

addRootsInParentACSs

public static final java.util.List<java.lang.Object> addRootsInParentACSs(ACS _child,
                                                                          java.util.Map _m_asso)
                                                                   throws BaseError
Applicates the creation commands for the ACS roots after the creation or the opening of a child ACS, in the case where these roots do not exist yet. The creation commands in the argument _m_asso are get through a filtering of _child.getM_RootsForOpeningAndClosing() and/or _child.getM_RootCommandsForOpeningNoClosing(), for only one map key:

'ACS.Name.<Value>._parentACS_name'.

Called by ACSImpl.setAcsRelationsInIS(). Does not update the parent ACS map for child ACSs, nor the relevant root property. Calls addAssociateActions().

Parameters:
_child - is an open ACS having or not some associates and actions to process on its parent ACSs. Not null.
_m_asso - the applicable root commands for the ACS creation or opening. Never null.
Returns:
the associates created in the parent ACS, and the Objects that some called methods returns. May be empty but not null.
Throws:
BaseError - if the processing or a key is not correct

getL_RootsWithoutDeletingInParentACSs

public static final java.util.Set<ImmutableName> getL_RootsWithoutDeletingInParentACSs(ACS _child)
                                                                                throws BaseError
Gets the roots that a child ACS needs to have in its parent ACS, and which are not to delete at the closing of the child ACS. NO USE. The data is get from _child.getM_RootsForOpeningNoClosing(), for only one map key:

'ACS.Name.<Value>._parentACS_name'.

Call getL_AssociatesAndCalledMethods().

Parameters:
_child - is an open ACS having or not some associates and actions to process on its parent ACSs. Not null.
Returns:
root names. May be empty or null.
Throws:
BaseError - if the processing or a key is not correct

removeRootsInParentACSs

public static final void removeRootsInParentACSs(java.util.Map _m_asso,
                                                 ACS _child)
                                          throws BaseError
Executes the deleting commands for the ACS roots at the closing of a child ACS, in the case where this deleting is required. The deleting commands in the argument _m_asso are get through the child ACS getM_RootsForOpeningAndClosing() method, for only one type of map key:

'ACS.Name.<Value>._parentACS_name'.

Called by ACSImpl.finalizeForBase(). Calls removeAssociateActions().

Parameters:
_m_asso - the applicable commands for the root deletions. Never null.
_child - is an open ACS having or not some associates and actions to process on its parent ACSs. Not null.
Throws:
BaseError - if the processing is not correct

getL_LimitedFirstValuesForAssociation

public static final java.util.List<java.lang.String> getL_LimitedFirstValuesForAssociation(java.lang.String _key)
This method defines the first value for an association. For a new object, this method returns 5 values, and it returns 3 values for a child ACS. Called by ACSFactoryImpl for AssociationMapPropertyEditor, with an argument get from the BeanInfo.

Parameters:
_key - for the constrained values. The single workable value is 'ForChildACS'.
Returns:
list of the allowed values. Never empty nor null.

getKeysForConstrainedChildACSMap

public static java.lang.String[] getKeysForConstrainedChildACSMap()
Gets the relations a root parent ACSObject may have with a constrained and opened child ACS. There are 3 types of relation:

- '<ForChildAcsOpeningAndClosing>': the root parent ACSObject, or one of its property value, has to be there when the child ACS is opened, to ensure its ability to exist, and has to be closed or updated (for a property value) at its closing,

- '<ForChildAcsOpeningNoClosing>': the root parent ACSObject, or one of its property value, has to be there when the child ACS is opened, to ensure its ability to exist, but there is no constraint at its closing,

- '<ForChildAcsIntegrity>': the root parent ACSObject, or one of its property value, has to be there when the child ACS is opened, to ensure its ability to work well, in other words, following its specifications.

Each relation is associated to a key with the same name. Called by SimplePropertyEditor.getRestrictedValues() to display the Resource property 'M_ConstrainedChildACS', and by ResourceImpl.add/removeConstrainedChildACS().

Returns:
array of the 3 allowed keys.

fillDerivedAssociations

public static final java.util.Map fillDerivedAssociations(ACSFactoryImpl _factory,
                                                          ACS _refAcs,
                                                          java.util.Map _associationMap)
Called by ActionNewACSyst.fillDerivedACSproperties() to fill the new ACS with all the association scripts for new objects to be copied, or for the roots in the ACS parent. Replaces the _refAcs name by the _factory name in the scripts. Replaces in the map key, and for roots only, the _refAcs parent by the _factory parent. Removes the starting numbers in each command line. Derived from addAssociateActions().

Parameters:
_factory - of the new ACS
_refAcs - is the reference acs from which the new acs is build up when it is a derived acs
_associationMap - the associations to convert, from _refAcs
Returns:
new Map of associations for _factory, where the key is the association key, and the value is the list of String arrays, with one array for each elementary command

addAssociateActions

protected static final java.util.List<java.lang.Object> addAssociateActions(BaseObject _object,
                                                                            java.lang.String[] _l_actions,
                                                                            ACS _acsChild)
                                                                     throws BaseError
Executes the creating and updating commands. A '<GeneralCriterion>.' command is not processed, since it is about control, and not for object creation. With '<AssociateClass>', an instance is not created if it is returned by BaseUtilityImpl.getBaseObject() from the name in the first argument, and the instance is then put in the list of accessible objects for any '<CalledMethod>.<Action>' association. A called method may returns an object that has to be used by a next command as an argument. For the creation of a GroupID, calls ActionNewEligibleParty.handleNewGroup() to listen the new members group in the GUI. Caution: any returned ACSObject will be put in the root names lists of an ACS if it does not belong to this ACS. Then, when a root command calls a method to get an argument for a next root command, it should not be such an ACSObject, to avoid to be seen as a root. Note: fillDerivedAssociations() is directly written from this method. Called by addAssociatesAfterCreation() and addRootsInParentACSs(). Calls ActionNewEligibleParty.handleNewGroup() for any new GroupID.

Parameters:
_object - just-created ACSObject, having or not some associates and actions to process, or having a parent ACS to update. Not null.
_l_actions - is a set of commands to execute
_acsChild - Child ACS. Not null only when _object is a parent ACS to update.
Returns:
the associates created in the own ACS or in the parent ACS, and the Objects that some called methods returns. May be empty but not null.
Throws:
BaseError - if the processing is not correct
See Also:
controlAssociations(ARoad0.gBase.ACSFactoryImpl, java.util.HashMap, java.lang.String, java.lang.String[], boolean), ActionNewEligibleParty.handleNewGroup(ARoad0.gBaseInterface.ImmutableGroupID)

removeAssociateActions

protected static final void removeAssociateActions(BaseObject _object,
                                                   java.lang.String[] _l_actions,
                                                   ACS _acsChild)
                                            throws BaseError
Executes the deleting and updating operations in the ACS association commands. A '<GeneralCriterion>.' command is not processed. It is about control, and not removing. The commands N.<CalledMethod>.<Action>.C.ZZZ and N.<CalledMethod>.<Object>.XXX+<Class>+YYY+<Value>+ZZZ are no more processed, since the deleting of the master and associates should remove these actions. Called by removeAssociatesAfterCreation() and removeRootsInParentACSs().

Parameters:
_object - ACSObject having or not some associates and actions to process, or parent ACS to update. Not null.
_l_actions - is an association script to execute. Never null.
_acsChild - Child ACS. Not null only when _object is a parent ACS to update.
Throws:
BaseError - if the processing is not correct

getL_AssociatesAndCalledMethods

protected static final java.util.Map<ImmutableName,java.util.List<java.lang.String>> getL_AssociatesAndCalledMethods(BaseObject _object,
                                                                                                                     java.lang.String[] _l_actions,
                                                                                                                     ACS _acsChild)
                                                                                                              throws BaseError
Parses the ACS association commands to get the associates in a large sens, and the methods which are implied.

The status of a classical associate is described through the value '.<AssociateClass>.', where the key is the associate name.

The status of a root with an integrity constraint for a child ACS is described through the '<GeneralCriterion>.<RootIntegrity>', where the key is the root name.

The argument _object or its ACS may be a returned associate.

This method is directly written from the addAssociateActions() code, but it does not operate to create or update the associates. Called by ACSFactoryImpl.createACS() and ACSImpl.initializeInnerAcsRelationsInIS().

Parameters:
_object - just-created ACSObject, having or not some associates and actions to process, or parent ACS to update. Not null.
_l_actions - is an association script to execute
_acsChild - Child ACS. Not null only when _object is a parent ACS to update.
Returns:
the map where the key is the name of the associate, and the value is a list of the method names of the associate or, for an associate to create or to check, the value list contains respectively the String '..' or 'Throws:
BaseError - if the processing is not correct