|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.BasicImpl
ARoad0.gBase.ResourceImpl
ARoad0.AcsAddon.Accbee.MySQL.gBase.ResourceMySQLImpl
public class ResourceMySQLImpl
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.
ResourceMySQLImpl
,
Serialized FormField 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 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.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 |
---|
private static final long serialVersionUID__
public static final ResourceMySQLImpl EMPTY_INSTANCE
Constructor Detail |
---|
public ResourceMySQLImpl()
public ResourceMySQLImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType) throws CreateError
_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 "CreateError
- if ACSImpl.newEorResource() throws it;
the instance has then to be deleted !public ResourceMySQLImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType, boolean _toRegisterInManager) throws CreateError
_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.
CreateError
- if ACSImpl.newEorResource() throws it.
The instance has then to be deleted !Method Detail |
---|
public long getSerialVersionUID()
BasicImpl
getSerialVersionUID
in interface ImmutableBasic
getSerialVersionUID
in class ResourceImpl
public java.util.Map<java.lang.String,java.lang.String> getAddonInnerPropertiesToListen()
- '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().
getAddonInnerPropertiesToListen
in interface ACSObjectAddon
AcsAddon.getAddonParentPropertiesToListen()
public AclEntry addAclEntry(ImmutableACS _aclAcs, ImmutableEligibleParty _ep, StringRight[] _l_right, java.lang.Boolean _positiveRight, ImmutableGroupID _conditionGroup) throws CreateError
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().
addAclEntry
in interface Resource
addAclEntry
in class ResourceImpl
_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.
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 accountDirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)
public void removeAclEntry(ImmutableACS _aclAcs, ImmutableEligibleParty _ep, boolean _positiveRight, ImmutableGroupID _conditionGroup) throws UpDateError
removeAclEntry
in interface Resource
removeAclEntry
in class ResourceImpl
_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.
UpDateError
- if _ep is null, unknown, if _aclAcs is closed or unknown,
or if the type does not allow this operation.DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)
public void addInheritedAclEntry(AclEntry _acl)
addInheritedAclEntry
in interface ResourceMySQL
_acl
- inherited AclEntry to put in the list at the right orderDirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)
public void removeInheritedAclEntry(AclEntry _acl) throws UpDateError
removeInheritedAclEntry
in interface ResourceMySQL
_acl
- inherited AclEntry
UpDateError
- if _acl is null or unknownDirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)
public AclEntry selectInheritedAclEntry(AclEntry _acl, java.lang.String _type)
selectInheritedAclEntry
in interface ImmutableResource
selectInheritedAclEntry
in class ResourceImpl
_acl
- the initial AclEntry which may be given to the child_type
- type of a child, as Resource
public static AclEntry selectInheritedAclEntry(ImmutableResource _res, AclEntry _acl, java.lang.String _type)
_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
public void resetInheritedAclEntryRights(AclEntry _acl)
resetInheritedAclEntryRights
in interface ResourceMySQL
resetInheritedAclEntryRights
in interface Resource
resetInheritedAclEntryRights
in class ResourceImpl
_acl
- inherited AclEntry with updated rights. Never null.public java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedACLRights()
getM_TargetInheritedACLRights
in interface ResourceMySQL
getM_TargetInheritedACLRights
in interface ImmutableResource
getM_TargetInheritedACLRights
in class ResourceImpl
DirectoryMySQLImpl.getM_TargetInheritedACLRights()
public void removeAclEntryWithoutFiring(ImmutableACS _aclAcs, ImmutableEligibleParty _ep, boolean _positiveRight, ImmutableGroupID _conditionGroup) throws UpDateError
removeAclEntryWithoutFiring
in interface ResourceMySQL
_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.
UpDateError
- if _ep is null, unknown, if _aclAcs is closed or unknown,
or if the type does not allow this operation.DirectoryMySQLImpl.addAclEntry(ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableEligibleParty, ARoad0.gBaseInterface.StringRight[], java.lang.Boolean, ARoad0.gBaseInterface.ImmutableGroupID)
public java.lang.Object clone()
clone
in class ResourceImpl
java.lang.CloneNotSupportedException
public void finalizeForBase() throws UpDateError
finalizeForBase
in interface FinalizedObject
finalizeForBase
in class ResourceImpl
UpDateError
- if the main ACS do not known the resource (if
it is a clone without setName(), typically)public java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager) throws CreateError
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.
copy
in interface Copyable
copy
in class ResourceImpl
_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.
CreateError
- of the constructor with the same parameters,
or if _parent ACS is not _acs, or addAclEntry() exceptions.public java.lang.Object copyWithoutInternalAcl(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager) throws CreateError
copyWithoutInternalAcl
in interface Resource
copyWithoutInternalAcl
in class ResourceImpl
_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.
CreateError
- of the constructor with the same parameters,
or if _parent ACS is not _acs, or addAclEntry() exceptions.protected ResourceMySQLImpl copyOwnVariables(ResourceMySQLImpl _result, boolean _withoutInternalAcl) throws CreateError
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
_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
CreateError
- of addAclEntry()protected ResourceMySQLImpl copyOwnAcl(ResourceMySQLImpl _result, boolean _withoutInternalAcl, boolean _withoutExternalAcl) throws CreateError
_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
CreateError
- of addAclEntry()protected void finalizeFromDeserialization()
finalizeFromDeserialization
in class ResourceImpl
protected void setEorL_TargetInheritedAclEntries(java.util.ArrayList<AclEntry> _l_acl)
_l_acl
- list of inherited AclEntries.
May be empty, but never null.protected void setM_TargetInheritedACLRights(java.util.List<AclEntry> _l_acl)
_l_acl
- current list of inherited AclEntries.
May be empty, but never null.BaseUtilityMySQLImpl.setM_TargetInheritedACLRights(ARoad0.AcsAddon.Accbee.MySQL.gBaseInterface.ResourceMySQL, java.util.List, java.util.Map, java.util.Map, boolean)
public static void addDatabaseGroupsACL(Resource _res) throws CreateError
_res
- to update with two AclEntries on the database groups
CreateError
- from addAclEntry() or if the resource is not a child
of the MySQL root node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |