|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.BasicImpl
ARoad0.gBase.EligiblePartyImpl
ARoad0.gBase.GroupIDMemberImpl
ARoad0.gBase.UserIDImpl
ARoad0.AcsAddon.Accbee.MySQL.gBase.ProxyMySQLImpl
public class ProxyMySQLImpl
This class is responsible for modeling a MySQL proxy user having a proxied account as a non-generic alias reference. The generic soft aliasing feature is very partially used. This class copies most of the UserIDMySQLImpl features, but there are important differences:
- a proxy user is never member of an account-for-hosts group.
- for a new proxy user 'xxxx', there is no empty non-conditional ACL on 'MySQL Server' for the accounts-for-hosts group 'xxxx§@%'.
- the ACS policy allows no ACL to a proxy account, since it is simply the alias of another account.
The proxied account is never a proxy account. The host of the proxied account is independant to the host of its proxy account. This class works with UserIDMySQLImpl that implements the proxy account. This AcsAddon does not use the ACS management of the soft aliasing between ProxyMySQLImpl and UserIDMySQLImpl. This is why CompoundRightsFactoryImpl does not use its method selectDirectReferencesInViewForAlias() for this proxy link. The ALIAS link is implemented directly by the AcsAddon, but however, the class UserIDMySQLImpl uses the Basic property 'SoftAlias' to keep the names of the proxy accounts, for a given proxied account. 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 of an account cannot be null.
- The name of an account cannot contain the characters '%', '_', '§' or '@'.
- User names can be up to 16 characters long, but no more.
- The host of an account has to be a simple host.
- The proxied account cannot be a proxy account.
- The host name is not the name of an open ACS.
- The name xxx is not the name of an account in the open ACS.
This class has no subclass in this package. It is a javabean with the following bound properties: 'CurrentGroupID'. The listeners are proper to this instance, outside gBase, transient (not serialized in this instance backup). They are called in any order. They receive the new value, without copy. All the exceptions from the listeners are catched, and a dialog box is displayed to inform the user.
Field Summary | |
---|---|
static ProxyMySQLImpl |
EMPTY_INSTANCE
A reusable empty instance for initialization, to avoid the use of 'new' for temporary values. |
protected GroupIDMySQLImpl |
host_
|
protected UserIDMySQLImpl |
proxiedAccount_
|
static java.io.ObjectStreamField[] |
serialPersistentFields
variable for the JDK 2 serialization |
private static long |
serialVersionUID__
|
Fields inherited from class ARoad0.gBase.UserIDImpl |
---|
l_currentActors_, l_ownResources_, order_, primGroup_ |
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 | |
---|---|
ProxyMySQLImpl()
The basic constructor |
|
ProxyMySQLImpl(ImmutableName _name,
ACS _acs,
java.lang.String _epType,
java.lang.Boolean _isAdmin,
GroupIDMySQLImpl _host,
UserIDMySQLImpl _proxiedAccount)
Constructor used in the beamer, from the 'New' button, to create a proxy account. |
|
ProxyMySQLImpl(ImmutableName _name,
ACS _acs,
java.lang.String _epType,
boolean _isAdmin,
GroupIDMySQLImpl _host,
UserIDMySQLImpl _proxiedAccount,
boolean _toRegisterInManager)
Unused for the creation of a ProxyMySQL. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Adds a listener to the bean. |
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 ProxyMySQLImpl |
copyOwnVariables(ProxyMySQLImpl _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 removes this instance in its groups directly. |
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. |
GroupIDMySQLImpl |
getEorFirstHost()
|
UserIDMySQL |
getProxiedAccount()
Gets the proxied account under which this proxy account gets MySQL rights. |
long |
getSerialVersionUID()
For the java serialization. |
void |
removePropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Removes a listener to the bean. |
protected static void |
setValueOf(ProxyMySQLImpl _user,
GroupIDMySQLImpl _host,
UserIDMySQLImpl _proxiedAccount)
Sets, for the constructors, a new account as member of the matched pattern-name groups and member of its mandatory host. |
Methods inherited from class ARoad0.gBase.UserIDImpl |
---|
addCurrentActor, addGroupToGM, addOwnResource, clone, copyOwnVariables, equals, finalize, finalizeFromDeserialization, getEorL_UserIDCurrentActors, getEorL_UserIDOwnResources, getEorPrimGroup, getOrder, getPropertyChangeListeners, hashCode, ownsResource, removeCurrentActor, removeGroupToGM, removeOwnResource, removePrimGroup, setEorPrimGroup, setOrder, toString |
Methods inherited from class ARoad0.gBase.GroupIDMemberImpl |
---|
copy, copyOwnVariables, copyWithoutAcl, getEorL_GroupID, isAdmin |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ARoad0.gBaseInterface.UserID |
---|
finalizeForUser, setEorPrimGroup, setOrder |
Methods inherited from interface ARoad0.gBaseInterface.ImmutableUserID |
---|
getEorL_UserIDCurrentActors, getEorL_UserIDOwnResources, getEorPrimGroup, getOrder, ownsResource |
Methods inherited from interface ARoad0.gBaseInterface.GroupIDMember |
---|
addGroupToGM, removeGroupToGM |
Methods inherited from interface ARoad0.gBaseInterface.EligibleParty |
---|
setEPType |
Methods inherited from interface ARoad0.gBaseInterface.Basic |
---|
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, 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, removePropertyChangeListener |
Methods inherited from interface ARoad0.gBaseInterface.ImmutableTarget |
---|
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias, getType |
Field Detail |
---|
private static final long serialVersionUID__
protected GroupIDMySQLImpl host_
protected UserIDMySQLImpl proxiedAccount_
public static final ProxyMySQLImpl EMPTY_INSTANCE
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
public ProxyMySQLImpl()
public ProxyMySQLImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, java.lang.Boolean _isAdmin, GroupIDMySQLImpl _host, UserIDMySQLImpl _proxiedAccount) throws CreateError
A host in MySQL is simulated by a GroupID having a 'host' type, with the special case of the group 'localhost' that has the type 'host byAcsCreator' to forbid its deleting by the Access Road user. The host to use, if it is not 'localhost', has to be an open ACS having an account with the new userID name as name, and the user 'anonymous' is the single exception to this rule.
This constructor ensures that the new account is member of the pattern-name accounts-for-hosts groups that match to it, if it is not the user 'anonymous'. For a new account 'user', an empty non-conditional ACL on 'MySQL Server' is set without rights for the accounts-for-hosts group 'user§@%', if it does not exist. Calls setValueOf(). Calls the super constructor.
_name
- ImmutableName of the userID as a kind of eligible party_acs
- ACS owning the userID_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_host
- mandatory host for an account. Never null._proxiedAccount
- proxied account of this instance. Never null.
CreateError
- if ACS.newEorEligibleParty() throws it - the instance
must then be deleted !public ProxyMySQLImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, boolean _isAdmin, GroupIDMySQLImpl _host, UserIDMySQLImpl _proxiedAccount, boolean _toRegisterInManager) throws CreateError
_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_host
- mandatory host for an account. Never null._proxiedAccount
- proxied account of this instance. Never null._toRegisterInManager
- false if this method must not register
the instance in its ACS.
CreateError
- if ACS.newEorEligibleParty() throws it -
the instance must then be deleted !Method Detail |
---|
public UserIDMySQL getProxiedAccount()
getProxiedAccount
in interface ProxyMySQL
public long getSerialVersionUID()
BasicImpl
getSerialVersionUID
in interface ImmutableBasic
getSerialVersionUID
in class UserIDImpl
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: 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().
getAddonInnerPropertiesToListen
in interface ACSObjectAddon
AcsAddon.getAddonParentPropertiesToListen()
public void finalizeForBase() throws UpDateError
finalizeForBase
in interface FinalizedObject
finalizeForBase
in class UserIDImpl
UpDateError
- if the instance cannot be removed from its first host grouppublic void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BaseBeanManager
addPropertyChangeListener
in interface BoundBean
addPropertyChangeListener
in class UserIDImpl
_propertyName
- name of the property_l
- PropertyChangeListener to add. Caution: the listener must NOT
have specific hashCode() and equals() methods, to work with HashSet
in the removing operations.public void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BaseBeanManager
removePropertyChangeListener
in interface BoundBean
removePropertyChangeListener
in class UserIDImpl
_propertyName
- name of the property_l
- PropertyChangeListener to removepublic GroupIDMySQLImpl getEorFirstHost()
getEorFirstHost
in interface UserIDMySQL
public java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager) throws CreateError
copy
in interface Copyable
copy
in class UserIDImpl
_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.public java.lang.Object copyWithoutInternalAcl(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager) throws CreateError
copyWithoutInternalAcl
in interface EligibleParty
copyWithoutInternalAcl
in class UserIDImpl
_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 ProxyMySQLImpl copyOwnVariables(ProxyMySQLImpl _result, boolean _withoutInternalAcl) throws CreateError
_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
protected static void setValueOf(ProxyMySQLImpl _user, GroupIDMySQLImpl _host, UserIDMySQLImpl _proxiedAccount) throws CreateError
This constructor ensures that the new account is member of the pattern-name accounts-for-hosts groups that match to it, if it is not the user 'anonymous'. For a new account 'user', an empty non-conditional ACL on 'MySQL Server' is set without rights for the accounts-for-hosts group 'user§@%', if it does not exist. Called by the constructor. Calls GroupIDMySQLImpl.isMemberOfMySQLPatternNameGroup() and addEorMemberToPatternNameGroup().
_user
- new instance of this class_host
- host group is mandatory. Never null._proxiedAccount
- proxied account of the proxy _user. Never null.
CreateError
- if the constraints are not fulfilled with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |