ARoad0.AcsAddon.Accbee.MySQL.gBase
Class ActorMySQLImpl

java.lang.Object
  extended by ARoad0.gBase.BasicImpl
      extended by ARoad0.gBase.ResourceImpl
          extended by ARoad0.gBase.ActorImpl
              extended by ARoad0.AcsAddon.Accbee.MySQL.gBase.ActorMySQLImpl
All Implemented Interfaces:
ActorMySQL, ResourceMySQL, ACSObject, ACSObjectAddon, Actor, BaseBeanManager, BaseObject, Basic, BoundBean, Copyable, EligibleParty, FinalizedObject, FinalizedObjectForUser, ImmutableActor, ImmutableBasic, ImmutableEligibleParty, ImmutableLeaf, ImmutablePrivilegeSource, ImmutablePrivilegeTarget, ImmutableResource, ImmutableSource, ImmutableTarget, Leaf, PrivilegeSource, PrivilegeTarget, PrivilegeUser, Resource, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class ActorMySQLImpl
extends ActorImpl
implements ActorMySQL

This class is responsible for modeling a MySQL Actor to implement varied constraints on the instance, the property isRightProxy_ and the inherited AclEntries. The editing of the default true value on the property isRightProxy_ is forbidden. This class handles the Resource types 'trigger', 'view_delegate', 'stored_function', 'stored_procedure', 'user socket'. Note: the constructor forbids to have a Host that is not the host group of the Definer account. This is why there is an error message 'The Host is not the host group of the Definer'. Nonetheless, this is not the behavior of the MySQL Server, where it is possible to have a disabled Definer.

This class manages a map of primary rights, as inherited AclEntry rights, and a map of global rights that says what users have a global access on the resource database. The final access rights does not depends directly on the primary rights map, but no global rights for a couple user/host means no access at all to the target.

The class VirtualFolderMySQLImpl is responsible to create an Actor having the type 'view delegate' under the database node in the resources tree, for the database the virtual folder is associate to. The ACS types policy, with 'Resource.NoNonConditionalACL' and 'Resource.NoConditionalACL', sets that there is an empty 'AclEntry' property for the 'view_delegate' and the 'trigger' actors as Respources, while the 'stored_function' and 'stored_procedure' actors allows direct ACL to simulate the MySQL privileges table 'procs_priv'.

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:

- The Host is mandatory when there is a Definer.

- The Host ACS is not the ACS of this actor.

- The Host have to be a simple host group.

- The Host is not the host group of the Definer.

- A non-null Definer User must have a non-null Definer Host.

- A trigger must have a non-null Definer user and a non-null Definer host.

- An host group can have an AclEntry only for a database.

- The AclEntry of a MySQL Actor must have a condition group.

- A MySQL conditional AclEntry cannot use a standard group.

This class has no subclass in this package. 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.

See Also:
Serialized Form

Field Summary
static ActorMySQLImpl 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.ActorImpl
bridgeTarget_, currentGroupID_, currentUserID_, isRightProxy_, l_bridgeSources_, l_SecondaryGroup_, m_AclEntriesResources_, serialPersistentFields
 
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_, 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
ActorMySQLImpl()
          The basic constructor
ActorMySQLImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType, GroupIDMySQL _host)
          Used for the creation of an instance through the GUI.
 
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.
 void addInheritedAclEntry(AclEntry _acl)
          Adds the inherited AclEntry in the good sorting.
 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)
          This method provides a copy of the instance with another name, following Copyable.
protected  ActorMySQLImpl copyOwnVariables(ActorMySQLImpl _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)
          This method provides a copy of the instance as copy() but without copying the internal AclEntries.
 void finalizeForBase()
          This method sets to null the primary inherited rights map.
protected  void finalizeFromDeserialization()
          NO USE.
 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 an user edition.
 AclEntry selectInheritedAclEntry(AclEntry _acl, java.lang.String _type)
          Returns the AclEntry to use as inherited AclEntry in a child.
protected  void setEorL_TargetInheritedAclEntries(java.util.ArrayList<AclEntry> _l_acl)
          Sets all the inherited AclEntries for this target.
 void setIsRightProxy(boolean _b)
          No operation, and fires an exception 'An Actor in the AcsAddon MySQL cannot change the 'right-proxy' value'.
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.ActorImpl
addAclEntryToEP, addBridgeSource, addEorPrivilegeForLinksToSource, addEorPrivilegeForTypeToSource, addPropertyChangeListener, copyOwnVariables, equals, getAuthorizeCurrentGroupID, getEorACSBridgeTarget, getEorCurrentGroupID, getEorCurrentUserID, getEorL_AclConnectedResources, getEorL_bridgeSources, getEorL_SecondaryGroup, getEorL_SourcePrivilegeForLinks, getEorL_SourcePrivilegeForTypes, getEorL_SourcePrivileges, getEPType, getIsACSBridgeSource, getIsRightProxy, getPropertyChangeListeners, hashCode, isMemberToSecondaryGroup, removeAclEntryToEP, removeBridgeSource, removeEorCurrentGroupID, removeEorCurrentUserID, removeEorPrivilegeToSource, removePropertyChangeListener, removeSecondaryGroup, setEorACSBridgeTarget, setEorACSBridgeTarget, setEorCurrentGroupID, setEorCurrentGroupIDForUser, setEorCurrentUserID, setEorCurrentUserIDForUser, setEorL_bridgeSources, setEorL_SecondaryGroup, setEorL_SecondaryGroupForUser, setEPType
 
Methods inherited from class ARoad0.gBase.ResourceImpl
addAcsController, addEorPrivilegeForLinksToTarget, addEorPrivilegeForTypeToTarget, compareTo, containsAclEntryToEP, copyOwnAcl, copyOwnVariables, 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, getResourceType, hasTheAccountAndGroupOfParent, removeACL, removeAcsController, removeEorGroupID, removeEorPrivilegeToTarget, removeEorUserID, 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.Actor
setEorACSBridgeTarget, setEorCurrentGroupIDForUser, setEorCurrentUserIDForUser, setEorL_SecondaryGroupForUser
 
Methods inherited from interface ARoad0.gBaseInterface.EligibleParty
setEPType
 
Methods inherited from interface ARoad0.gBaseInterface.PrivilegeSource
addEorPrivilegeForTypeToSource, removeEorPrivilegeToSource
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableActor
getEorACSBridgeTarget, getEorCurrentGroupID, getEorCurrentUserID, getEorL_bridgeSources, getEorL_SecondaryGroup, getIsACSBridgeSource, getIsRightProxy, isMemberToSecondaryGroup
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableEligibleParty
getEorL_AclConnectedResources, getEPType, getM_ConstrainedChildACS
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutablePrivilegeSource
getEorL_SourcePrivilegeForLinks, getEorL_SourcePrivilegeForTypes, getEorL_SourcePrivileges
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableSource
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias, getType
 
Methods inherited from interface ARoad0.gBaseInterface.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 ActorMySQLImpl 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

ActorMySQLImpl

public ActorMySQLImpl()
The basic constructor


ActorMySQLImpl

public ActorMySQLImpl(ImmutableName _name,
                      ACS _acs,
                      Directory _parent,
                      UserID _owner,
                      java.lang.String _resourceType,
                      GroupIDMySQL _host)
               throws CreateError
Used for the creation of an instance through the GUI. An association script in AcsFactoryMySQL.create() uses a constructor from the superclass to create a 'connection' actor with a bridge target, but without the argument _host nor inheritance of the parent ACL. This constructor is for the view delegates, the stored procedures, the stored functions and the triggers. The Actor bridge target is set then to null. The user error messages are:

- The Host is mandatory when there is a Definer.

- The Host ACS is not the ACS of this actor.

- The Host have to be a simple host group.

- The Host is not the host group of the Definer.

- A non-null Definer User must have a non-null Definer Host.

- A trigger must have a non-null Definer user and a non-null Definer host.

Parameters:
_name - of the actor as a resource.
_acs - main ACS of the actor.
_parent - of the actor.
_owner - owns the resource and is its current UserID; may be null.
_resourceType - is also the EP type, and may be null if the ACS allows it.
_host - the current GroupID. Has to be the simple host of _owner. May be null. Never null if _owner is not null.
Throws:
CreateError - from the super constructor, or _host null with _owner not null.
Method Detail

setIsRightProxy

public void setIsRightProxy(boolean _b)
                     throws UpDateError
No operation, and fires an exception 'An Actor in the AcsAddon MySQL cannot change the 'right-proxy' value'.

Specified by:
setIsRightProxy in interface Actor
Overrides:
setIsRightProxy in class ActorImpl
Parameters:
_b - true if this Actor may be a proxy in the access paths, that is, as rights user, it gets some rights to the other rights users which have an 'execute' right on it
Throws:
UpDateError - in all cases

getSerialVersionUID

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

Specified by:
getSerialVersionUID in interface ImmutableBasic
Overrides:
getSerialVersionUID in class ActorImpl
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. 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 'view_delegate' and the 'trigger' actors, while the 'stored_function' and 'stored_procedure' actors allows direct ACL to simulate the MySQL privileges table 'procs_priv'. 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 ActorMySQL. Calls the super.addAclEntry() method to do it, and BaseUtilityMySQLImpl.addInSortedAclList().

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 - from the super method or not

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 in the good sorting. Called by DirectoryMySQLImpl.addAclEntry() and the same method, and by the constructor. An inherited AclEntry may have a Resource which is not this instance. Copied from ResourceMySQLImpl. Calls getEorL_TargetInheritedAclEntries(), BaseUtilityMySQLImpl.addInSortedInheritedAclList() and ResourceImpl.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 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. Copied in DirectoryMySQLImpl. Calls getEorL_TargetInheritedAclEntries() and ResourceImpl.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:
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

resetInheritedAclEntryRights

public void resetInheritedAclEntryRights(AclEntry _acl)
Resets the inherited AclEntry rights and the primary rights after an user edition. Called by the parent when there is a change in the effective rights of an inherited AclEntry. Derived from setM_TargetInheritedACLRights(). Called by Directory.resetInheritedAclEntryRightsOfChildren(). Overrides the super method to update the two inherited ACL maps, and does not call it. 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 current users, 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 ActorImpl
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. Note: when this method is called by the ResourceImpl constructor, the proper variables of this class are not still initialized.

Specified by:
finalizeForBase in interface FinalizedObject
Overrides:
finalizeForBase in class ActorImpl
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
This method provides a copy of the instance with another name, following Copyable. Each internal variable that is an external object reference have a shallow copy (no deep copy). Each aclEntry is copied, but not the list of ViewInBase that contains this instance. The bridge target is copied if this instance is a bridge source. Caution: do 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 Strings in this instance user or group names. Calls copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copy in interface Copyable
Overrides:
copy in class ActorImpl
Parameters:
_name - copy name. Usually created 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 ActorMySQLImpl
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
This method provides a copy of the instance as copy() but without copying the internal AclEntries. Each internal variable that is an external object reference have a shallow copy (no deep copy). Each aclEntry is copied, but not the list of ViewInBase that contains this instance. The bridge target is copied if this instance is a bridge source. 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 Strings in this instance user or group names. Caution: does not copy the bridge sources, if they exists. Calls copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copyWithoutInternalAcl in interface EligibleParty
Specified by:
copyWithoutInternalAcl in interface Resource
Overrides:
copyWithoutInternalAcl in class ActorImpl
Parameters:
_name - copy name. Usually created 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 ActorMySQLImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs, or addAclEntry() exceptions.

copyOwnVariables

protected ActorMySQLImpl copyOwnVariables(ActorMySQLImpl _result,
                                          boolean _withoutInternalAcl)
                                   throws CreateError
This method provides a copy of the instance variables. Copies the AclEntries. Caution: copies the current user and group, and the secondary groups, if it is the same ACS, or else in every UserID and GroupID copy which is found. In this second case, the user or group name must be made of the acs name ended by the user or group string name. Caution: does not copy the bridge sources, if they exist, nor the actor alias. Uses the super overridden method with one argument. Called by copy() and by the copyOwnVariables() methods of the subclasses.

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

finalizeFromDeserialization

protected void finalizeFromDeserialization()
NO USE. 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 ActorImpl

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 gBase package. No use in this generic gBase package, so it is reserved to the AcsAddon packages. Calls setM_TargetInheritedACLRights() to set the map (source name + order, StringRight[]). Fires 'InheritedTargetAclEntries' events. The detailed sequence of calls for adding is described at the method DirectoryMySQLImpl.addAclEntry().

Parameters:
_l_acl - list of AclEntries. May be empty, but never null.
See Also:
DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)

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() only, and do not fire any event while the caller method fires 'InheritedTargetAclEntries' events. Calls the BaseUtilityMySQL static method having the same name. The detailed sequence of calls for adding is described at the method DirectoryMySQLImpl.addAclEntry().

Parameters:
_l_acl - current list of inherited AclEntries. May be empty, but never null.
See Also:
DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)