ARoad0.AcsAddon.Accbee.MySQL.gBase
Class ResourceMySQLImpl

java.lang.Object
  extended by ARoad0.gBase.BasicImpl
      extended by ARoad0.gBase.ResourceImpl
          extended by ARoad0.AcsAddon.Accbee.MySQL.gBase.ResourceMySQLImpl
All Implemented Interfaces:
ResourceMySQL, ACSObject, ACSObjectAddon, BaseBeanManager, BaseObject, Basic, BoundBean, Copyable, FinalizedObject, FinalizedObjectForUser, ImmutableBasic, ImmutableLeaf, ImmutablePrivilegeTarget, ImmutableResource, ImmutableTarget, Leaf, PrivilegeTarget, PrivilegeUser, Resource, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class ResourceMySQLImpl
extends ResourceImpl
implements ResourceMySQL

This class is responsible for modeling a MySQL resource, mainly to implement the AclEntry sorting for the direct and the inherited ACL. The documentation of DirectoryMySQLImpl describes in details the ACL management.

This class implements the following rules, and informs the Access Road user with the same sentence as error message when they are not fulfilled with:

- A table column name must end with 'column'.

- An host group can have an AclEntry only for the target 'MySQL server'.

- A MySQL simple resource allows only conditional AclEntries.

- A MySQL conditional AclEntry cannot use a standard group. It is a javabean without specific bound properties. The 'InheritedTargetAclEntries' events are bound when the primary AclEntries map is changing. Excepting for EPRViewInBaseImpl, the listeners are outside gBase, they are transient (not serialized in this instance backup). They are called in any order. They receive only a copy of the new value, to protect the property. All the exceptions from the listeners are catched, and a dialog box is displayed to inform the user. This class has no subclass in this package.

See Also:
ResourceMySQLImpl, Serialized Form

Field Summary
static ResourceMySQLImpl EMPTY_INSTANCE
          A reusable empty instance for initialization, to avoid the use of 'new' for temporary values.
private static long serialVersionUID__
           
 
Fields inherited from class ARoad0.gBase.ResourceImpl
actorActivated_, groupID_, l_aclEntry_, l_groupRights_, l_inheritedT_AclEntries_, l_OpenAcsControllerNames_, l_ownerRights_, l_parentTreeAGRightsAllowToGoAcross_, l_rootRights_, m_inheritedT_ACLRights_, parent_, serialPersistentFields, userID_
 
Fields inherited from class ARoad0.gBase.BasicImpl
aCS_, aCS_Name_, aliasHandler_, changeSupport_, comment_, folderMember_, INCREMENT_CAPACITY, INITIAL_CAPACITY, INITIAL_CAPACITY_2, iS_Name_, m_ConstrainedChildACS_, name_, PRIME, privHandler_, type_
 
Constructor Summary
ResourceMySQLImpl()
          Default constructor.
ResourceMySQLImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType)
          Used by the beamer editor for the ACS resources list, from the 'New' button, and by the gWork.AcsFactory.
ResourceMySQLImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType, boolean _toRegisterInManager)
          Used by the other constructor.
 
Method Summary
 AclEntry addAclEntry(ImmutableACS _aclAcs, ImmutableEligibleParty _ep, StringRight[] _l_right, java.lang.Boolean _positiveRight, ImmutableGroupID _conditionGroup)
          Creates the AclEntry, and sorts the new AclEntry list.
static void addDatabaseGroupsACL(Resource _res)
          Currently unused.
 void addInheritedAclEntry(AclEntry _acl)
          Adds the inherited AclEntry.
 java.lang.Object clone()
          Clones without registering of the new object in the ACSs.
 java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager)
          Provides a copy of the instance with another name.
protected  ResourceMySQLImpl copyOwnAcl(ResourceMySQLImpl _result, boolean _withoutInternalAcl, boolean _withoutExternalAcl)
          This method provides a copy of the AclEntries, all the AclEntries (see restrictions) or only the external ones.
protected  ResourceMySQLImpl copyOwnVariables(ResourceMySQLImpl _result, boolean _withoutInternalAcl)
          This method provides a copy of the instance variables.
 java.lang.Object copyWithoutInternalAcl(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager)
          Provides a copy of the instance as Copyable.copy(), but without copying the internal aclEntries.
 void finalizeForBase()
          This method sets to null the primary inherited rights map.
protected  void finalizeFromDeserialization()
          Currently unused.
 java.util.Map<java.lang.String,java.lang.String> getAddonInnerPropertiesToListen()
          Gets the specific events to listen from an ACSObject, because these events should change the rights of an ACSObject in an ACS Addon.Returns always null, because these events are listened only to update the views containing these ACSObjects.
 java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedACLRights()
          Gets the internal map of the primary rights from each parent level of this resource.
 long getSerialVersionUID()
          For the java serialization.
 void removeAclEntry(ImmutableACS _aclAcs, ImmutableEligibleParty _ep, boolean _positiveRight, ImmutableGroupID _conditionGroup)
          Removes the AclEntry and the primary rights.
 void removeAclEntryWithoutFiring(ImmutableACS _aclAcs, ImmutableEligibleParty _ep, boolean _positiveRight, ImmutableGroupID _conditionGroup)
          Removes the direct AclEntry but without event firing.
 void removeInheritedAclEntry(AclEntry _acl)
          Removes the inherited AclEntries in the children.
 void resetInheritedAclEntryRights(AclEntry _acl)
          Resets the inherited AclEntry rights and the primary rights after the user editing of an AclEntry.
 AclEntry selectInheritedAclEntry(AclEntry _acl, java.lang.String _type)
          Returns the AclEntry to use as inherited AclEntry in a child.
static AclEntry selectInheritedAclEntry(ImmutableResource _res, AclEntry _acl, java.lang.String _type)
          Returns the AclEntry to use as inherited AclEntry in a chil of the MySQL resources tree.
protected  void setEorL_TargetInheritedAclEntries(java.util.ArrayList<AclEntry> _l_acl)
          Sets all the inherited AclEntries for this target.
protected  void setM_TargetInheritedACLRights(java.util.List<AclEntry> _l_acl)
          Sets the internal maps of the inherited AclEntry rights and the primary rights.
 
Methods inherited from class ARoad0.gBase.ResourceImpl
addAcsController, addEorPrivilegeForLinksToTarget, addEorPrivilegeForTypeToTarget, addPropertyChangeListener, compareTo, containsAclEntryToEP, copyOwnAcl, copyOwnVariables, equals, fireL_inheritedGroupRights, fireL_inheritedOwnerRights, getActorActivated, getAGOAccessFromTheParentAccount, getAGOAccessFromTheParentGroup, getEorGroupID, getEorImmutableL_TargetInheritedAclEntries, getEorImmutableL_TargetInheritedLinkedPrivileges, getEorL_EPthroughAclEntry, getEorL_TargetInheritedAclEntries, getEorL_TargetInheritedLinkedPrivileges, getEorL_TargetPrivilegeForLinks, getEorL_TargetPrivilegeForTypes, getEorL_TargetPrivileges, getEorParent, getEorUserID, getL_aclEntry, getL_AcsControllers, getL_groupRights, getL_inheritedGroupRights, getL_inheritedOwnerRights, getL_ownerRights, getL_rootRights, getM_TargetInheritedLinkedPRIRights, getPropertyChangeListeners, getResourceType, hashCode, hasTheAccountAndGroupOfParent, removeACL, removeAcsController, removeEorGroupID, removeEorPrivilegeToTarget, removeEorUserID, removePropertyChangeListener, resetInheritedPrivilegeRights, selectInheritedPrivilege, setAGOAccessFromTheParentAccount, setAGOAccessFromTheParentGroup, setEorGroupID, setEorParent, setEorUserID, setL_groupRights, setL_ownerRights, setL_rootRights, setResourceType, toString
 
Methods inherited from class ARoad0.gBase.BasicImpl
addAcsOfSoftReferences, addConstrainedChildACS, addEorSoftAlias, addInVFolderList, addInViewList, addPropertyChangeListener, copyOwnVariables, finalize, finalizeForUser, firePropertyChange, getAcsName, getComment, getEorACS, getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getFullName, getHasSoftAlias, getImpliedViews, getIS_Name, getL_AcsOfSoftReferences, getL_SoftAlias, getM_ConstrainedChildACS, getName, getNickName, getType, getVirtualFolders, removeAcsOfSoftReferences, removeConstrainedChildACS, removeEorSoftAlias, removeInVFolderList, removeInViewList, removePropertyChangeListener, setComment, setEorAliasAsInternalHardReference, setEorReferenceAsInternalHardAlias, setType
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ARoad0.gBaseInterface.Resource
resetInheritedPrivilegeRights, selectInheritedPrivilege, setEorGroupID, setEorUserID, setL_groupRights, setL_ownerRights, setL_rootRights, setResourceType
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableResource
containsAclEntryToEP, getActorActivated, getAGOAccessFromTheParentAccount, getAGOAccessFromTheParentGroup, getEorGroupID, getEorImmutableL_TargetInheritedAclEntries, getEorL_EPthroughAclEntry, getEorUserID, getL_aclEntry, getL_AcsControllers, getL_groupRights, getL_inheritedGroupRights, getL_inheritedOwnerRights, getL_ownerRights, getL_rootRights, getM_ConstrainedChildACS, getResourceType, hasTheAccountAndGroupOfParent
 
Methods inherited from interface ARoad0.gBaseInterface.Basic
finalizeForUser, setComment
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableBasic
getComment, getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getImpliedViews, getIS_Name, getL_AcsOfSoftReferences, getL_SoftAlias, getPropertyChangeListeners, getVirtualFolders
 
Methods inherited from interface ARoad0.gBaseInterface.PrivilegeTarget
addEorPrivilegeForTypeToTarget, removeEorPrivilegeToTarget
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutablePrivilegeTarget
getEorImmutableL_TargetInheritedLinkedPrivileges, getEorL_TargetPrivilegeForLinks, getEorL_TargetPrivilegeForTypes, getEorL_TargetPrivileges, getM_TargetInheritedLinkedPRIRights, getType
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableTarget
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias
 
Methods inherited from interface ARoad0.gBaseInterface.ACSObject
getAcsName, getEorACS
 
Methods inherited from interface ARoad0.gBaseInterface.BaseObject
equals, getFullName, getName, getNickName, hashCode
 

Field Detail

serialVersionUID__

private static final long serialVersionUID__
See Also:
Constant Field Values

EMPTY_INSTANCE

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

Constructor Detail

ResourceMySQLImpl

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


ResourceMySQLImpl

public ResourceMySQLImpl(ImmutableName _name,
                         ACS _acs,
                         Directory _parent,
                         UserID _owner,
                         java.lang.String _resourceType)
                  throws CreateError
Used by the beamer editor for the ACS resources list, from the 'New' button, and by the gWork.AcsFactory.

Parameters:
_name - of the resource
_acs - main ACS of the resource
_parent - of the resource; may be null.
_owner - owns the resource; may be null. Never used.
_resourceType - the resource type which drives the rights and the immutability of the instance. If null, the value is set to "".
Throws:
CreateError - if ACSImpl.newEorResource() throws it; the instance has then to be deleted !

ResourceMySQLImpl

public ResourceMySQLImpl(ImmutableName _name,
                         ACS _acs,
                         Directory _parent,
                         UserID _owner,
                         java.lang.String _resourceType,
                         boolean _toRegisterInManager)
                  throws CreateError
Used by the other constructor. The inherited AclEntries from the parent are added. A table column must have 'column' at the end of its name. Calls first the super constructor. Calls addDatabaseGroupsACL().

Parameters:
_name - of the resource
_acs - main ACS of the resource
_parent - owns the resource; may be null.
_owner - owns the resource; may be null. Never used.
_resourceType - the resource type which drives the rights and the immutability of the instance. If null, the value is set to "".
_toRegisterInManager - false if this method must not register the instance in its ACS.
Throws:
CreateError - if ACSImpl.newEorResource() throws it. The instance has then to be deleted !
Method Detail

getSerialVersionUID

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

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

getAddonInnerPropertiesToListen

public java.util.Map<java.lang.String,java.lang.String> getAddonInnerPropertiesToListen()
Gets the specific events to listen from an ACSObject, because these events should change the rights of an ACSObject in an ACS Addon.Returns always null, because these events are listened only to update the views containing these ACSObjects. This method does not cover the parent properties of a Resource or a VirtualFolder (see ARoad0.gBase.AcsAddon.getAddonParentPropertiesToListen()). To define the events, the map key may have the following values:

- 'THIS' to say that the single object to listen is the ACSObject,

- 'ACS.method_name' to say that the list of objects to listen is returned by the method 'method_name' in the Addon ACS class.

For each map key, the values have the following format:

'AAA.method_name IF BBB'

where:

- AAA: THIS (mandatory),

- method_name: 'get' method name of the ACSObject that is associated, in the relevant BeanInfo class, to the event to listen (mandatory)

- IF BBB: is optional, where BBB is TRUE, or FALSE, or NULL, or NOT-NULL, to say that the event must be listened if and only if the returned value of the method_name is respectively a boolean TRUE, or FALSE, or an object NULL, or NOT-NULL.

When the map value starts with 'ACS', the ACS method to call has the ACSObject as one argument. Otherwise, the ACS or the ACSObject method has no argument. Called by ARoad0.UtilityImpl.removeAddonParentPropertyChangeListener().

Specified by:
getAddonInnerPropertiesToListen in interface ACSObjectAddon
Returns:
map to define the specific ACS Addon events to listen. Is always null.
See Also:
AcsAddon.getAddonParentPropertiesToListen()

addAclEntry

public AclEntry addAclEntry(ImmutableACS _aclAcs,
                            ImmutableEligibleParty _ep,
                            StringRight[] _l_right,
                            java.lang.Boolean _positiveRight,
                            ImmutableGroupID _conditionGroup)
                     throws CreateError
Creates the AclEntry, and sorts the new AclEntry list. This method is derived from the same method in DirectoryMySQLImpl. On every child of the root 'MySQL server', a new conditional ACL for a pair (user@host or accounts-for-hosts group) produces a new ACL on the root for the same pair if it does not exist. This new root ACL has the right USAGE, and it is not deleted by default when the initial ACL is deleted. For a new non-conditional ACL on a database, there is no adding on the root.

The ACS types policy, with 'Resource.NoNonConditionalACL' and 'Resource.NoConditionalACL', sets that there is an empty 'AclEntry' property for the 'index' resources. Stops then restores the property change firing on 'AclRights'. The generic firing order on 'AclRights' and 'EPsThroughAclEntry' is inversed in this method. The four types of host groups can be used as ACL sources only for the databases, which are not ResourcemySQL. Calls BaseUtilityMySQLImpl.addInSortedAclList(). Calls the overridden method before the sorting of the list. The detailed sequence of calls is described at the method DirectoryMySQLImpl.addAclEntry().

Specified by:
addAclEntry in interface Resource
Overrides:
addAclEntry in class ResourceImpl
Parameters:
_aclAcs - ImmutableACS which owns the new AclEntry, and to be recorded as an ACS controller of this resource if it is not its main ACS.
_ep - eligible party connected to the resource through a new aclEntry.
_l_right - is an array of positive or negative rights of _ep on this resource (that is, if READ is a right, _ep can read on the resource). May be null.
_positiveRight - is true if the rights are set to authorize (grant), and false if they are set to forbid (deny).
_conditionGroup - first condition group. May be null.
Returns:
the new AclEntry.
Throws:
java.lang.InternalError - if this resource has a null name or a null ACS, or if _ep is not an EligiblePartyImpl nor an ActorImpl.
CreateError - if _ep or _aclAcs is null, or if _ep is already recorded in this resource with the same ACS, or thrown by the ACS.newEorAclEntry(), or without a condition group and not for an accounts-for-hosts group, or with condition group while the source is not an account
See Also:
DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)

removeAclEntry

public void removeAclEntry(ImmutableACS _aclAcs,
                           ImmutableEligibleParty _ep,
                           boolean _positiveRight,
                           ImmutableGroupID _conditionGroup)
                    throws UpDateError
Removes the AclEntry and the primary rights. Calls the overridden method first. Fires 'InheritedTargetAclEntries' events only to update the display of the primary rights map. The detailed sequence of calls for adding is described at the method addAclEntry() of DirectoryMySQLImpl.

Specified by:
removeAclEntry in interface Resource
Overrides:
removeAclEntry in class ResourceImpl
Parameters:
_aclAcs - ImmutableACS which owns the AclEntry, and is recorded as an ACS controller of this resource.
_ep - eligible party connected to the resource through an AclEntry. This method unrecords the relevant aclEntry in _ep, in this resource, and in the relevant ACS. The ACS of the aclEntry may be unrecorded in this resource if there are no other aclEntry owned by this ACS in this resource.
_positiveRight - is true if the rights are oriented to authorize, and false if they are oriented to forbid.
_conditionGroup - first condition group. May be null.
Throws:
UpDateError - if _ep is null, unknown, if _aclAcs is closed or unknown, or if the type does not allow this operation.
See Also:
DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)

addInheritedAclEntry

public void addInheritedAclEntry(AclEntry _acl)
Adds the inherited AclEntry. Called by DirectoryMySQLImpl.addAclEntry() and the same method, and by the constructor. An inherited AclEntry may have a Resource which is not this instance. The sorting in the ACL list is described in BaseUtilityMySQLImpl. From ResourceMySQL. Copied in DirectoryMySQLImpl and ActorMySQLImpl. Calls getEorL_TargetInheritedAclEntries(), BaseUtilityMySQLImpl.addInSortedInheritedAclList() and super.setEorL_TargetInheritedAclEntries() that fires 'InheritedTargetAclEntries'. Not described in the BeanInfo since the user does not call it. The detailed sequence of calls is described at the method DirectoryMySQLImpl.addAclEntry().

Specified by:
addInheritedAclEntry in interface ResourceMySQL
Parameters:
_acl - inherited AclEntry to put in the list at the right order
See Also:
DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)

removeInheritedAclEntry

public void removeInheritedAclEntry(AclEntry _acl)
                             throws UpDateError
Removes the inherited AclEntries in the children. From ResourceMySQL. Copied in DirectoryMySQLImpl and ActorMySQLImpl. Calls getEorL_TargetInheritedAclEntries() and setEorL_TargetInheritedAclEntries() that fires 'InheritedTargetAclEntries'. Not described in the BeanInfo since the user does not call it. The detailed sequence of calls for adding is described at the method DirectoryMySQLImpl.addAclEntry().

Specified by:
removeInheritedAclEntry in interface ResourceMySQL
Parameters:
_acl - inherited AclEntry
Throws:
UpDateError - if _acl is null or unknown
See Also:
DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)

selectInheritedAclEntry

public AclEntry selectInheritedAclEntry(AclEntry _acl,
                                        java.lang.String _type)
Returns the AclEntry to use as inherited AclEntry in a child. Returns null if the type contains 'index', 'directory', or starts with 'byAcsCreator'. Otherwise, returns the argument. Called by the constructors. Overrides the super method and does not call it. Calls the ResourceMySQL static method having the same name.

Specified by:
selectInheritedAclEntry in interface ImmutableResource
Overrides:
selectInheritedAclEntry in class ResourceImpl
Parameters:
_acl - the initial AclEntry which may be given to the child
_type - type of a child, as Resource
Returns:
the same AclEntry if the child inherits this initial AclEntry, or null

selectInheritedAclEntry

public static AclEntry selectInheritedAclEntry(ImmutableResource _res,
                                               AclEntry _acl,
                                               java.lang.String _type)
Returns the AclEntry to use as inherited AclEntry in a chil of the MySQL resources tree. Returns null if the type contains 'index', 'connections', 'user socket' or 'virtual_objects', of it it starts with 'byAcsCreator'. Otherwise, returns the argument. Called by the constructors. Overrides the super method and does not call it.

Parameters:
_res - the current instance is not used in the method
_acl - the initial AclEntry which may be given to the child
_type - type of a child, as Resource
Returns:
the same AclEntry if the child inherits this initial AclEntry, or null

resetInheritedAclEntryRights

public void resetInheritedAclEntryRights(AclEntry _acl)
Resets the inherited AclEntry rights and the primary rights after the user editing of an AclEntry. Called by the parent when there is a change in the effective rights of an inherited AclEntry, including a change in the condition group. Called by Directory.resetInheritedAclEntryRightsOfChildren(). Overreads the super method to update direct the two inherited ACL maps, and does not call it. The generic gBase package provides the handling of the listeners for the property changes 'InheritedTargetAclEntries', but without any firing of these changes. Calls setM_TargetInheritedACLRights(), since it is not possible to reset the two inherited rights maps without analyzing all the inherited AclEntries. Fires the 'InheritedTargetAclEntries' event.

Specified by:
resetInheritedAclEntryRights in interface ResourceMySQL
Specified by:
resetInheritedAclEntryRights in interface Resource
Overrides:
resetInheritedAclEntryRights in class ResourceImpl
Parameters:
_acl - inherited AclEntry with updated rights. Never null.

getM_TargetInheritedACLRights

public java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedACLRights()
Gets the internal map of the primary rights from each parent level of this resource. The primary rights are displayed into the beamer. They help the user to understand the connection pairs, since it covers the root 'MySQL server' rights, and to understand the complex database rights. Because this method overrides the Resource method, its name is 'TargetInheritedACL' rather than 'TargetPrimaryACL'. Overrides the Resource method to describe its use by the MySQL addon.

Specified by:
getM_TargetInheritedACLRights in interface ResourceMySQL
Specified by:
getM_TargetInheritedACLRights in interface ImmutableResource
Overrides:
getM_TargetInheritedACLRights in class ResourceImpl
Returns:
unmodifiable map of primary rights from the direct and inherited AclEntries. May be empty but never null.
See Also:
DirectoryMySQLImpl.getM_TargetInheritedACLRights()

removeAclEntryWithoutFiring

public void removeAclEntryWithoutFiring(ImmutableACS _aclAcs,
                                        ImmutableEligibleParty _ep,
                                        boolean _positiveRight,
                                        ImmutableGroupID _conditionGroup)
                                 throws UpDateError
Removes the direct AclEntry but without event firing. The purpose of this method is to avoid an unuseful sequence of firings when a lot of AclEntries are removed. It is called from the root 'MySQL server' method removeAclEntry() when it deletes all the direct ACL of a pair on the root children when the root ACL for this pair is deleted. Calls the overridden method and disables before all the firings for the 'AclRights' and 'EPsThroughAclEntry' events.

Specified by:
removeAclEntryWithoutFiring in interface ResourceMySQL
Parameters:
_aclAcs - ImmutableACS which owns the AclEntry, and is recorded as an ACS controller of this resource.
_ep - eligible party connected to the resource through an AclEntry. This method unrecords the relevant aclEntry in _ep, in this resource, and in the relevant ACS. The ACS of the aclEntry may be unrecorded in this resource if there are no other aclEntry owned by this ACS in this resource.
_positiveRight - is true if the rights are oriented to authorize, and false if they are oriented to forbid.
_conditionGroup - first condition group. May be null.
Throws:
UpDateError - if _ep is null, unknown, if _aclAcs is closed or unknown, or if the type does not allow this operation.
See Also:
DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)

clone

public java.lang.Object clone()
Clones without registering of the new object in the ACSs. Caution: don't use any updating method on this clone, because that may destroy the base integrity. A finalized instance returns a clone with getEorACS() which returns null, but getName() and getAcsName() operates.

Overrides:
clone in class ResourceImpl
Returns:
Object; is not registred in the ACSs. The names, the aclEntries, the AG rights, the ACS controller names are cloned. The AclEntries are weakly cloned, so they have no direct link to this resource. The external object references are not cloned
Throws:
java.lang.CloneNotSupportedException

finalizeForBase

public void finalizeForBase()
                     throws UpDateError
This method sets to null the primary inherited rights map. Overrides the super method and calls it at the end.

Specified by:
finalizeForBase in interface FinalizedObject
Overrides:
finalizeForBase in class ResourceImpl
Throws:
UpDateError - if the main ACS do not known the resource (if it is a clone without setName(), typically)

copy

public java.lang.Object copy(ImmutableName _name,
                             ACS _acs,
                             Directory _parent,
                             java.lang.Boolean _toRegisterInManager)
                      throws CreateError
Provides a copy of the instance with another name. Each internal variable that is an external object reference have a shallow copy (no deep copy). Most of the aclEntries are copied, but not the list of ViewInBase that contains this instance. Caution: does not copy the user and the group if _result does not belong to aCS_ and if there are no user or group in the _result ACS which have similar names - that is that are ended by the same last component in this instance user or group names.

For aclEntries, if _result ACS is not this resource ACS, and if the aclEntry ACS is this resource ACS, sets _result ACS as the aclEntry ACS of the copied acl. Caution: does not copy an aclEntry if:

- _acs is not this resource ACS,

- the acl eligible party ACS is this resource ACS,

- and there is no matched EligibleParty (with the same last components) in _acs

Calls copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copy in interface Copyable
Overrides:
copy in class ResourceImpl
Parameters:
_name - copy name. Usually creates as an extension of _parent name.
_acs - main ACS of the copy to create. May not be the ACS of this instance.
_parent - DirectoryImpl 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:
a new instance of ResourceImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs, or addAclEntry() exceptions.

copyWithoutInternalAcl

public java.lang.Object copyWithoutInternalAcl(ImmutableName _name,
                                               ACS _acs,
                                               Directory _parent,
                                               java.lang.Boolean _toRegisterInManager)
                                        throws CreateError
Provides a copy of the instance as Copyable.copy(), but without copying the internal aclEntries. It is used for ACSImpl.copy(), because all the EP must be copied first before the copy of all the resources with their aclEntries. Each internal variable that is an external object reference has a shallow copy (no deep copy), but without copy for the internal aclEntry nor the list of ViewInBase that contains this instance. Called from BaseUtilitiesImpl.copyDirectoriesAndActors(). Calls copyOwnVariables().

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

copyOwnVariables

protected ResourceMySQLImpl copyOwnVariables(ResourceMySQLImpl _result,
                                             boolean _withoutInternalAcl)
                                      throws CreateError
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). Most of the AclEntries are copied, but not the list of ViewInBase that contains this instance, nor comments. In most of the cases, the aclEntry arguments are copied, but see the exceptions. Called by copy() and by the copyOwnVariables() methods of the subclasses. Calls copyOwnAcl(). Caution: does not copy the user and the group if _result does not belong to aCS_ and if there are no user or group in the _result ACS which have similar names - that is that are ended by the same last component in this instance user or group names.

For aclEntries, if _result ACS is not this resource ACS, and if the aclEntry ACS is this resource ACS, sets _result ACS as the aclEntry ACS of the copied acl. Caution: does not copy an aclEntry if: - _result ACS is not this resource ACS, - the eligible party ACS is this resource ACS, - and there is no matched EligibleParty (with the same last components) in the _result ACS

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

copyOwnAcl

protected ResourceMySQLImpl copyOwnAcl(ResourceMySQLImpl _result,
                                       boolean _withoutInternalAcl,
                                       boolean _withoutExternalAcl)
                                throws CreateError
This method provides a copy of the AclEntries, all the AclEntries (see restrictions) or only the external ones. Most of the aclEntries are copied, but not the list of ViewInBase that contains this instance, nor comments. If _result ACS is not this resource ACS, and if the aclEntry ACS is this resource ACS, sets _result ACS as the aclEntry ACS of the copied acl. Called by copyOwnVariables() and by BaseUtilityMySQLImpl.copyDirectoryChildrenForACS().

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

finalizeFromDeserialization

protected void finalizeFromDeserialization()
Currently unused. This method sets to null the primary inherited rights map, since it is used after a deserialization. Overrides the super method and calls it at the end.

Overrides:
finalizeFromDeserialization in class ResourceImpl

setEorL_TargetInheritedAclEntries

protected void setEorL_TargetInheritedAclEntries(java.util.ArrayList<AclEntry> _l_acl)
Sets all the inherited AclEntries for this target. The AclEntry may be a clone. To use by the parent class in the AcsAddon gBase package. Calls setM_TargetInheritedACLRights() to set the maps (source @ host order, StringRight[]). Fires 'InheritedTargetAclEntries' events.

Parameters:
_l_acl - list of inherited AclEntries. May be empty, but never null.

setM_TargetInheritedACLRights

protected void setM_TargetInheritedACLRights(java.util.List<AclEntry> _l_acl)
Sets the internal maps of the inherited AclEntry rights and the primary rights. The map value is a non-null StringRight array of inherited rights, and it may be empty. Called by setEorL_TargetInheritedAclEntries() and resetInheritedAclEntryRights(). Does not fire any property change event. Calls the BaseUtilityMySQLImpl method having the same name.

Parameters:
_l_acl - current list of inherited AclEntries. May be empty, but never null.
See Also:
BaseUtilityMySQLImpl.setM_TargetInheritedACLRights(ARoad0.AcsAddon.Accbee.MySQL.gBaseInterface.ResourceMySQL, java.util.List, java.util.Map, java.util.Map, boolean)

addDatabaseGroupsACL

public static void addDatabaseGroupsACL(Resource _res)
                                 throws CreateError
Currently unused. Sets the new AclEntries for a database component, to put it in the relevant database groups among '|ToFirstLevelItemsOf-xxx|', '|ToTablesOf-xxx|', '|ToViewsOf-xxx|', '|ToStoredFunctionsOf-xxx|', '|ToStoredProceduresOf-xxx|', where 'xxx' is the database name. Noop if the argument is not the direct or indirect child of a database. Calls Resource.addAclEntry(). Called by the constructor in ResourceMySQLImpl, DirectoryMySQLImpl and ActorMysqLImpl.

Parameters:
_res - to update with two AclEntries on the database groups
Throws:
CreateError - from addAclEntry() or if the resource is not a child of the MySQL root node