ARoad0.AcsAddon.Accbee.MySQL.gBase
Class RoleMySQLImpl

java.lang.Object
  extended by ARoad0.gBase.BasicImpl
      extended by ARoad0.gBase.EligiblePartyImpl
          extended by ARoad0.gBase.GroupIDMemberImpl
              extended by ARoad0.gBase.GroupIDImpl
                  extended by ARoad0.AcsAddon.Accbee.MySQL.gBase.GroupIDMySQLImpl
                      extended by ARoad0.AcsAddon.Accbee.MySQL.gBase.RoleMySQLImpl
All Implemented Interfaces:
GroupIDMySQL, RoleMySQL, ACSObject, ACSObjectAddon, BaseBeanManager, BaseObject, Basic, BoundBean, Copyable, EligibleParty, FinalizedObject, FinalizedObjectForUser, GroupID, GroupIDMember, ImmutableBasic, ImmutableEligibleParty, ImmutableGroupID, ImmutableGroupIDMember, ImmutablePrivilegeSource, ImmutableSource, ImmutableTarget, PrivilegeSource, PrivilegeUser, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class RoleMySQLImpl
extends GroupIDMySQLImpl
implements RoleMySQL

Currently unused. This class is responsible for modeling a MySQL Role.

See Also:
Serialized Form

Field Summary
static RoleMySQLImpl EMPTY_INSTANCE
          A reusable empty instance for initialization, to avoid the use of 'new' for temporary values.
static java.io.ObjectStreamField[] serialPersistentFields
          empty variable for the JDK 2 serialization
private static long serialVersionUID__
           
 
Fields inherited from class ARoad0.gBase.GroupIDImpl
l_currentActors_, l_Members_, l_ownResources_, l_secGroupActors_, order_
 
Fields inherited from class ARoad0.gBase.GroupIDMemberImpl
isAdmin_, l_Groups_
 
Fields inherited from class ARoad0.gBase.EligiblePartyImpl
m_AclEntriesResources_
 
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
RoleMySQLImpl()
          The basic constructor
RoleMySQLImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, java.lang.Boolean _isAdmin)
          Constructor used in the beamer by the editor for the ACS EP list, from 'New'.
RoleMySQLImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, boolean _isAdmin, boolean _toRegisterInManager)
          Used for the creation of a RoleIDMySQL instance.
 
Method Summary
 void addEorMember(GroupIDMember _gm)
          Adds a GroupIDMember as a member of this GroupID.
 void addGroupToGM(GroupID _grp)
          Adds a group for which this GroupIDMember is a member, and sorts the groups in an ordered array that follows the third sorting order for the MySQL AclEntries, from the least-specific source to the more-specific ones.
 java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager)
          This method provides a copy of the instance with another name.
protected  RoleMySQLImpl copyOwnVariables(RoleMySQLImpl _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 EligibleParty internal aclEntries.
 void finalizeForBase()
          This method, if this instance is a host group, finalizes the accounts that are members having this group as first host.
 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.
 long getSerialVersionUID()
          For the java serialization.
 boolean isConditionalACLtoResetAfterMembershipChangeInThisGroup(ImmutableAclEntry _acl, ImmutableGroupIDMember _member)
          Detects if it is a conditional AclEntry from this group ACS, for which a change in the groupidmember membership relation to this group is able to change the membership chain from the AclEntry source to at least one condition group of the AclEntry.
 void removeEorMember(GroupIDMember _gm)
          Removes a groupID member, and updates the member through the removeGroupToGM() method, if the group is not immutable.
 void removeEorMemberWithoutControl(GroupIDMember _gm)
          Removes the groupID member of a host, without any control like in the basic same method.
 
Methods inherited from class ARoad0.AcsAddon.Accbee.MySQL.gBase.GroupIDMySQLImpl
addEorMemberToPatternNameGroup, copyOwnVariables, getNameFromHostComponent, isMemberOfMySQLPatternNameGroup, isSimpleHost
 
Methods inherited from class ARoad0.gBase.GroupIDImpl
addCurrentActor, addOwnActorAsSecondaryGroup, addOwnResource, clone, containsAsIndirectMember, containsAsIndirectMemberWithoutAliasing, containsAsMember, containsAsMemberWithoutAliasing, copyOwnVariables, equals, finalize, finalizeFromDeserialization, getEorL_GroupIDCurrentActors, getEorL_GroupIDCurrentActorsAsSecondaryGroup, getEorL_GroupIDOwnResources, getEorL_Members, getFirstIntermediateForIndirectMember, getL_ConditionalACLsOfOneConditionGroupIndirectMember, getL_IntermediateGroupsOfAclConditionalGroups, getOrder, getPropertyChangeListeners, hashCode, ownsResource, removeCurrentActor, removeOwnActorAsSecondaryGroup, removeOwnResource, setEorL_Members, setOrder, toString
 
Methods inherited from class ARoad0.gBase.GroupIDMemberImpl
addPropertyChangeListener, copy, copyOwnVariables, copyWithoutAcl, getEorL_GroupID, isAdmin, removeGroupToGM, removePropertyChangeListener
 
Methods inherited from class ARoad0.gBase.EligiblePartyImpl
addAclEntryToEP, addEorPrivilegeForLinksToSource, addEorPrivilegeForTypeToSource, addPropertyChangeListener, copyOwnVariables, deleteAclEntries, getEorL_AclConnectedResources, getEorL_SourcePrivilegeForLinks, getEorL_SourcePrivilegeForTypes, getEorL_SourcePrivileges, getEPType, removeAclEntryToEP, removeEorPrivilegeToSource, removePropertyChangeListener, setEPType
 
Methods inherited from class ARoad0.gBase.BasicImpl
addAcsOfSoftReferences, addConstrainedChildACS, addEorSoftAlias, addInVFolderList, addInViewList, addPropertyChangeListener, compareTo, copyOwnVariables, 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.AcsAddon.Accbee.MySQL.gBaseInterface.GroupIDMySQL
isSimpleHost
 
Methods inherited from interface ARoad0.gBaseInterface.GroupID
setEorL_Members, setOrder
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableGroupID
containsAsIndirectMember, containsAsIndirectMemberWithoutAliasing, containsAsMember, containsAsMemberWithoutAliasing, getEorL_GroupIDCurrentActors, getEorL_GroupIDCurrentActorsAsSecondaryGroup, getEorL_GroupIDOwnResources, getEorL_Members, getFirstIntermediateForIndirectMember, getOrder, ownsResource
 
Methods inherited from interface ARoad0.gBaseInterface.GroupIDMember
removeGroupToGM
 
Methods inherited from interface ARoad0.gBaseInterface.EligibleParty
setEPType
 
Methods inherited from interface ARoad0.gBaseInterface.Basic
finalizeForUser, setComment
 
Methods inherited from interface ARoad0.gBaseInterface.PrivilegeSource
addEorPrivilegeForTypeToSource, removeEorPrivilegeToSource
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableGroupIDMember
getEorL_GroupID, isAdmin
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableEligibleParty
getEorL_AclConnectedResources, getEPType, getM_ConstrainedChildACS
 
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.BoundBean
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
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.ACSObject
getAcsName, getEorACS
 
Methods inherited from interface ARoad0.gBaseInterface.BaseObject
equals, getFullName, getName, getNickName, hashCode
 
Methods inherited from interface ARoad0.gBaseInterface.BaseBeanManager
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableTarget
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias, getType
 

Field Detail

serialVersionUID__

private static final long serialVersionUID__
See Also:
Constant Field Values

EMPTY_INSTANCE

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


serialPersistentFields

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

Constructor Detail

RoleMySQLImpl

public RoleMySQLImpl()
The basic constructor


RoleMySQLImpl

public RoleMySQLImpl(ImmutableName _name,
                     ACS _acs,
                     java.lang.String _epType,
                     java.lang.Boolean _isAdmin)
              throws CreateError
Constructor used in the beamer by the editor for the ACS EP list, from 'New'. Calls the other constructor.

Parameters:
_name - ImmutableName of the groupID
_acs - ACS of the groupID
_epType - is the eligible party type, and may be null if the ACS allows it.
_isAdmin - true only if the instance has an administrative role in the ACS, for the technical administration or the users.
Throws:
CreateError - if _name ends with '_tree>', or if ACSImpl.newEorEligibleParty() throws it - the instance must then be deleted !

RoleMySQLImpl

public RoleMySQLImpl(ImmutableName _name,
                     ACS _acs,
                     java.lang.String _epType,
                     boolean _isAdmin,
                     boolean _toRegisterInManager)
              throws CreateError
Used for the creation of a RoleIDMySQL instance.

Parameters:
_name - ImmutableName of the eligible party to create
_acs - Main ACS of the eligible party to create
_epType - is the eligible party type, and may be null if the ACS allows it.
_isAdmin - true only if the instance has an administrative role in the ACS, for the technical administration or the users.
_toRegisterInManager - false if this method must not register the instance in its ACS.
Throws:
CreateError - if ACSImpl.newEorEligibleParty() throws it, or if the pattern-name policy is not fulfilled - the instance must then 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 GroupIDMySQLImpl
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. These events are listened 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: 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 (option).

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

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

addEorMember

public void addEorMember(GroupIDMember _gm)
                  throws CreateError
Adds a GroupIDMember as a member of this GroupID. A host in MySQL is simulated by a group with a specific type. There is exactly one simple host per account, because the sorting order of the AclEntries deliver at most one matched ACL per level of parent. This means that two simple hosts per account would allow two possible matched ACLs without any constraint on the sorting of theses ACLs. An account may be member of a host only if the account exists in the ACS the host represents, and 'anonymous' is the single exception. Nonetheless, it is possible to have two 'jerry' account in two hosts. If they are used by the same person or program, only one MySQL account has to be created to simulate the case. If the 'jerry' accounts are for different persons or programs, this method allows to put, as member of one host, a MySQL account like 'jerry<2>' or 'jerry'. Checks the non-conditional ACLs from _gm to a database, and resets it if _gm is an UserID, with DirectoryMySQL.resetInheritedAclEntryRightsOfChildren(), since the super method resets only the conditional ACLs. UserIDMySQLImpl.setValueOf() calls this method at the creation of an UserIDMySQL. Overrides and calls the super method.

Specified by:
addEorMember in interface GroupID
Overrides:
addEorMember in class GroupIDMySQLImpl
Parameters:
_gm - new member of the GroupID. No action if null, empty.
Throws:
CreateError - if _gm is a GroupID which has this instance has direct or indirect member, if _gm is already a member, or if the _gm type is not authorized by the ACS, or if the type does not allow the operation, if this group is immutable, or if it is mutable and not the new member.

removeEorMember

public void removeEorMember(GroupIDMember _gm)
                     throws CreateError
Removes a groupID member, and updates the member through the removeGroupToGM() method, if the group is not immutable. Noop if the argument is an account having this group as first group. No removing for '|AllAccounts|' or a standard group. Checks up the non-conditional ACLs from _gm to a database, and resets it if _gm is an UserID, with DirectoryMySQL.resetInheritedAclEntryRightsOfChildren(), since the super method resets only the conditional ACLs. Called by the GUI. Never called by the finalizeForBase() method of the members, which use removeEorMemberWithoutControl(). Overrides the super method and calls it at the end.

Specified by:
removeEorMember in interface GroupID
Overrides:
removeEorMember in class GroupIDMySQLImpl
Parameters:
_gm - member of the GroupID. No action if unknown, null, empty.
Throws:
CreateError - if the argument is an account having this group as first group, or if the type does not allow the operation, of if this group is standard group, a pattern-name group, the AllAccounts or the AllSimpleGroups group

addGroupToGM

public void addGroupToGM(GroupID _grp)
Adds a group for which this GroupIDMember is a member, and sorts the groups in an ordered array that follows the third sorting order for the MySQL AclEntries, from the least-specific source to the more-specific ones. There are first, for the users, the source types 'pattern-name_accounts group', and then, but this order is unuseful, 'host byAcsCreator', 'host', 'pattern-name_hosts group', 'all-hosts group byAcsCreator'. The removing by GroupIDMemberImpl.removeGroupToGM() maintains the sorting. Calls BaseUtilityMySQLImpl.isAfterInTheGroupIDMemberOrder(). Overrides the GroupIDMemberImpl method and does not call it. Fires changes on 'AssociatedGroups' like the overridden method. Used only by GroupIDImpl.

Specified by:
addGroupToGM in interface GroupIDMember
Overrides:
addGroupToGM in class GroupIDMySQLImpl
Parameters:
_grp - is the groupID to add. No action if it is null, or with null name.

removeEorMemberWithoutControl

public void removeEorMemberWithoutControl(GroupIDMember _gm)
                                   throws CreateError
Removes the groupID member of a host, without any control like in the basic same method. Called by UserIDMySQLImpl.finalizeForBase(). Simply calls the super method.

Overrides:
removeEorMemberWithoutControl in class GroupIDMySQLImpl
Parameters:
_gm - member of the GroupID. No action if unknown, null, empty.
Throws:
CreateError - if the type does not allow the operation

finalizeForBase

public void finalizeForBase()
                     throws UpDateError
This method, if this instance is a host group, finalizes the accounts that are members having this group as first host. This method removes this instance in its groups directly. The superclass cannot be used, since it is done through a call to RoleMySQLImpl.removeEorMember(), which may fire an exception. A pattern-name group does not finalize its members when it is finalized. Overrides the super method and calls it at the end. An unused object has to be deleted to inform the other objects, and this method HAS TO BE USED before deleting the GroupID. Note: when this method is called by the EligiblePartyImpl constructor, the proper variables of this class are not still initialized.

Specified by:
finalizeForBase in interface FinalizedObject
Overrides:
finalizeForBase in class GroupIDMySQLImpl
Throws:
UpDateError - if RoleMySQLImpl.removeEorMemberWithoutControl() throws it

isConditionalACLtoResetAfterMembershipChangeInThisGroup

public boolean isConditionalACLtoResetAfterMembershipChangeInThisGroup(ImmutableAclEntry _acl,
                                                                       ImmutableGroupIDMember _member)
Detects if it is a conditional AclEntry from this group ACS, for which a change in the groupidmember membership relation to this group is able to change the membership chain from the AclEntry source to at least one condition group of the AclEntry. Overriddes the super method to return true for a host that is the source of a non-conditional ACL. In that case, the mixed ACLs implying this ACL have to be updated. Overrides the super method and calls it for the generic cases. Called by add/removeEorMember().

Overrides:
isConditionalACLtoResetAfterMembershipChangeInThisGroup in class GroupIDImpl
Parameters:
_acl - from the _member ACS. Never null.
_member - new or previous direct member of this group. Never null.
Returns:
true if _acl has to be reset through AclEntryImpl.resetRightsAsInheritedAclEntry(). Return false in all other cases, including an ACS which does not manage the conditional ACL, or a non-conditional _acl, or no identity or membership relation from the _acl source to _member, or no membership relation from this group to any _acl condition group.

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. The copy order is 3 times the source order. Does not copy the GroupID members, nor the own resources, the current actors, the own actors. To copy all these links, you have to copy first the GroupID, then to copy the GroupIDMembers, the Resources and the Actors to copy the links. Call copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copy in interface Copyable
Overrides:
copy in class GroupIDMySQLImpl
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 RoleMySQLImpl
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 EligibleParty internal aclEntries. The copy order is 3 times the source order. Does not copy the GroupID members, nor the own resources, the current actors, the own actors. To copy all these links, you have to copy first the GroupID, then to copy the GroupIDMembers, the Resources and the Actors to copy the links. Calls copyOwnVariables(). Called by ACSImpl.copy(). This method is overridden by the subclasses.

Specified by:
copyWithoutInternalAcl in interface EligibleParty
Overrides:
copyWithoutInternalAcl in class GroupIDMySQLImpl
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 RoleMySQLImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs.

copyOwnVariables

protected RoleMySQLImpl copyOwnVariables(RoleMySQLImpl _result,
                                         boolean _withoutInternalAcl)
                                  throws CreateError
This method provides a copy of the instance variables. Copies the own actors and the result as groupIDMember (done by GroupIDMemberImpl.copyOwnVariables()). Does not copy the groupIDMembers (done by the copy() caller). Does not copy the own resources, nor the current actors, but the resource and actor copies do the job. The copy order is 3 times the source order. Called by copy() and by the copyOwnVariables() methods of the subclasses.

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:
updated _result
Throws:
CreateError