|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.CAliasImpl
public class CAliasImpl
This class is an embedded class responsible for modeling an ACSObject as reference to an alias, and/or as alias of a reference. The alias is the source of an ARoad0.CNot.AccessControlLink.IS_ALIAS relation to its reference as target. The hard alias setting is done through a call to the master of the CAliasImpl instance. The hard reference of an alias is get through the methods of this class. The soft reference of an alias is get through a call to getReferenceOfSoftAlias() on the reference ACS. This is the correct way gWork.compoundRightsFactoryImpl uses in the methods selectDirectHiddenReferenceForAlias() and selectDirectReferencesInViewForAlias(), both for the hard and the soft aliasing. The CAliasImpl master may be an alias or a reference. It may be a BasicImpl or a VirtualFolderImpl. There is no constraints on the reference class for a given alias class. Both for hard and soft relations, the alias relation is not multi-level: a reference cannot be the alias of another object. There are two types of alias relation this class may handle:
(1) the internal hard alias produces a direct reference-to-alias relation in the same ACS, and the two objects know this one-to-one relation,
(2) the soft alias produces an indirect reference-to-alias relation where the alias is internal or external, where the reference knows all its soft aliases, and the alias simply knows the ACS of its unique soft reference.
The soft alias results in a specific processing in each AcsAddon ACS, since the reference is returned by the method ACS.getReferenceOfSoftAlias() for a given external ACSObject as argument. This ACS method registers the soft alias relation in the CAliasImpl instances of the reference and the alias.
It is the responsibility of the ACS associations or the AcsAddon code to set an internal alias for one new ACSObject, as an alias or as an alias reference. On the other hand, the soft Alias relation may be only set by an AcsAddon.
Generally speaking, in the standard way of use, the alias transfers directly its rights as target to its reference, including, for an internal alias, its Account/Groups context. If the elements of the AG context are not yet in the path, this may define new links, from the reference to each account or group of the context. This is the propagation of the indirect AG context. The hard alias relation is alone to handle this tranfert in Access Road. There is no such a propagation in an AclEntry or a Privilege relation, even if an AclEntry transfers the direct AG context. This case may occur when:
(1) a GroupIDMember is a hard alias in a view, and the hard reference receives the AG rights of its alias.
(2) an Actor is a hard alias running as actor under a given AG context, and the hard reference receives the AG rights of its alias.
These cases are simple when the hard alias is in the view, since this implies the reference is also in the view, and the paths from the alias are displayed so that the user may see them directly. Otherwise, the cases occur into an access path when the hard alias is an intermediate node, and if the node before the hard alias do not transmit its proper AG context.
An exemple of indirect AG context propagation is for a 3-nodes path having the form 'ep/privilege/actor started from xid/alias/virtual folder', where the actor runs under the account U and the group G. The generic rule is that the rights of 'ep' on the virtual folder depend on the actor AG context, if any, since the privileges do not propagate the Account/Groups context of 'ep'. While U and G are not intermediate nodes in this path, if the actor is an intermediate node, the path is extended by the links 'run under/U' and 'run under/G'. If the actor does not run under U, there is no AG context to propagate through the alias link. It is important to note that, while there is an alias relation, the 'ep' rights on the virtual folder are always, defined by the privileges. Simply, the AG context of the actor provides the rights to the virtual folder.
This exemple shows how it is possible to extend the properties of a given class of the generic model, since VirtualFolder becomes there able to run under a GroupIDMember. Such an extension of the model may be provided to any ACSObject class, each time the instance is the reference of an alias. This feature is independant to the VirtualFolder ACS property for managing the rights propagation to the members.
A second exemple of indirect AG context propagation is in the MySQL AcsAddon. A MySQL view is a VirtualFolder having an Actor alias. The view provides access to its members through the account or the group of the VirtualFolder AG context. This may be the AG context of the VirtualFolder alias - if this alias is such a self-AG-context Actor (MySQL DEFINER mode) - or it may be the direct AG context from the nodes before the haard alias in the path (MySQL INVOKER mode).
One non-standard way of use for this embedded class, in an AcsAddon, is to set some of its properties without complying with the previous recommandations. For exemple, the MySQL AcsAddon needs to model the PROXY relation between several ProxyMySQL and one UserIDMySQL. The hard aliasing is not adapted, but this AcsAddon uses the methods of the soft aliasing to set the PROXY link. However, the MySQL ACS does not manage the soft aliasing, so there is no overload in the access paths searches. Detecting a PROXY target through the method ACS.getReferenceOfSoftAlias() would be more heavy when there are several open ACS. This is why the MySQL AcsAddon chooses to complete the access paths searching, in NodeRightsMySQLImpl, by a direct reading of a ProxyMySQL property returning the current PROXY target. Such a non-standard way allows to display the soft aliasing properties in the beamer, because the MySQL ACS manages the hard aliasing for another need (that is the view delegate).
All variables are private to secure the white box inheritances from this class. It is a javabean with the following bound properties:
- 'HardAliasReference', 'HardAlias', 'hasSoftAlias', 'SoftAlias', 'AcsOfSoftReferences'.
The listeners are proper to this instance. Excepting for EPRViewInBaseImpl, they are outside gBase, 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 is public to be overriden in the AcsAddons, and in this case, the subclass is only called by some classes in the same package. See the Copyright.
ImmutableBasic.getEorReferenceAsInternalHardAlias()
,
ImmutableACS.getReferenceOfSoftAlias(ARoad0.gBaseInterface.ACSObject)
,
CompoundRightsFactoryImpl.selectDirectHiddenReferenceForAlias(ARoad0.Gui2.GraphicView, ARoad0.gBaseInterface.EPRViewInBase, ARoad0.gBaseInterface.ACSObject)
,
Serialized FormField Summary | |
---|---|
protected java.beans.PropertyChangeSupport |
changeSupport_
manages all the property change listeners of this class and its subclasses |
(package private) static CAliasImpl |
EMPTY_INSTANCE
A reusable empty instance for initialization, to avoid the use of 'new' for temporary values. |
protected ACSObject |
hardReferenceOrAlias_
|
protected ImmutableName |
hardReferenceOrAliasName_
|
protected static int |
INCREMENT_CAPACITY
|
protected static int |
INITIAL_CAPACITY
Protected variables |
protected static int |
INITIAL_CAPACITY_2
|
protected boolean |
isHardReference_
|
protected ImmutableName[] |
l_AcsOfSoftReferences_
|
protected ImmutableName[] |
l_SoftAlias_
|
protected ACSObject |
master_
|
static java.io.ObjectStreamField[] |
serialPersistentFields
variable for the JDK 2 serialization |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
protected |
CAliasImpl()
The basic constructor. |
protected |
CAliasImpl(ACSObject _master)
Used by the master constructor. |
Method Summary | |
---|---|
protected void |
addAcsOfSoftReferences(ImmutableName _acs)
Adds the ACS name of an external or internal soft reference to the master as soft alias. |
protected void |
addEorSoftAlias(ImmutableName _alias)
Adds an external or internal soft alias to the master as soft reference. |
protected void |
addPropertyChangeListener(java.beans.PropertyChangeListener _l)
Adds a listener to the bean, for all the bound properties. |
protected void |
addPropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Adds a listener to the bean. |
protected CAliasImpl |
cloneC(ACSObject _master)
Clone for embeddd class without registering the new object in the ACSs. |
protected CAliasImpl |
copy(ACSObject _masterCopy)
This method provides a copy of the instance with another name, without children copying because the copy order will not be always correct. |
boolean |
equals(java.lang.Object _obj)
|
protected void |
finalize()
This method removes the CAlias from the ACS lists, but there is no guarantee that the JVM calls this method before the end of the application. |
protected void |
finalizeForBase()
Finalizes the CAlias and the hard alias, for a master hard reference. |
protected void |
finalizeFromDeserialization()
This method finalizes the instance, since it is used after a deserialization. |
protected void |
firePropertyChange(java.lang.String _propertyName,
java.lang.Object _oldValue,
java.lang.Object _newValue)
Fires an event to every registered listener, in any order. |
protected ACSObject |
getEorAliasAsInternalHardReference()
Get the unique ACSObject, if any, of this ACS for which this object is an internal hard reference. |
protected ACSObject |
getEorReferenceAsInternalHardAlias()
Get the unique ACSObject, if any, of this ACS for which this object is an internal hard alias. |
protected boolean |
getHasSoftAlias()
|
protected ImmutableName[] |
getL_AcsOfSoftReferences()
As a soft alias, sets a sorted array of names of the ACS of the soft references. |
protected ImmutableName[] |
getL_SoftAlias()
As a soft reference, gets a sorted array of names of the soft alias. |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String _propertyName)
Returns the change listeners for a property. |
long |
getSerialVersionUID()
|
int |
hashCode()
|
protected void |
removeAcsOfSoftReferences(ImmutableName _acs)
Removes an external or internal alias from the master as soft reference. |
protected void |
removeEorSoftAlias(ImmutableName _alias)
Removes an external or internal alias from the master as soft reference. |
protected void |
removePropertyChangeListener(java.beans.PropertyChangeListener _l)
Removes a listener to the bean, for all the bound properties. |
protected void |
removePropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Removes a listener to the bean. |
protected void |
setEorAliasAsInternalHardReference(ACSObject _ali)
Sets the unique ACSObject, if any, of this ACS for which this object is an internal hard reference. |
protected void |
setEorReferenceAsInternalHardAlias(ACSObject _ref)
Sets the unique ACSObject, if any, of this ACS for which this object is an internal hard alias. |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int INITIAL_CAPACITY
protected static final int INITIAL_CAPACITY_2
protected static final int INCREMENT_CAPACITY
private static final long serialVersionUID
protected ACSObject master_
protected ImmutableName[] l_SoftAlias_
protected ImmutableName[] l_AcsOfSoftReferences_
protected transient ACSObject hardReferenceOrAlias_
protected ImmutableName hardReferenceOrAliasName_
protected boolean isHardReference_
static final CAliasImpl EMPTY_INSTANCE
protected transient java.beans.PropertyChangeSupport changeSupport_
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
protected CAliasImpl()
protected CAliasImpl(ACSObject _master) throws CreateError
_master
- is the master of this embedded class
CreateError
- the master is nullMethod Detail |
---|
protected CAliasImpl copy(ACSObject _masterCopy) throws CreateError
_masterCopy
- is the master of the new copy
CreateError
- of the constructor with the same parameters.public int hashCode()
hashCode
in class java.lang.Object
protected final ImmutableName[] getL_SoftAlias()
protected final ImmutableName[] getL_AcsOfSoftReferences()
protected final boolean getHasSoftAlias()
protected ACSObject getEorReferenceAsInternalHardAlias()
protected ACSObject getEorAliasAsInternalHardReference()
protected void setEorReferenceAsInternalHardAlias(ACSObject _ref) throws UpDateError
_ref
- the reference. May be null.
UpDateError
- _basic does not belong to the same ACS or the master
is already an alias referenceprotected void setEorAliasAsInternalHardReference(ACSObject _ali) throws UpDateError
_ali
- the alias. May be null.
UpDateError
- _basic does not belong to the same ACS or
the master is already an aliasprotected void addEorSoftAlias(ImmutableName _alias) throws UpDateError
_alias
- ACSObject. No action if null, or already known.
UpDateError
- _alias belongs to the same ACS or the type is
immutableprotected void removeEorSoftAlias(ImmutableName _alias) throws UpDateError
_alias
- alias of the master. No action if null.
UpDateError
- if _alias is not known.protected void addAcsOfSoftReferences(ImmutableName _acs) throws UpDateError
_acs
- ACS name. No action if null, or already known.
UpDateError
protected void removeAcsOfSoftReferences(ImmutableName _acs) throws UpDateError
_acs
- ACS name. No action if null.
UpDateError
- if _alias is not known.protected void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
_l
- PropertyChangeListener to addprotected void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
_propertyName
- name of the property_l
- PropertyChangeListener to addprotected void removePropertyChangeListener(java.beans.PropertyChangeListener _l)
_l
- PropertyChangeListener to removeprotected void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
_propertyName
- name of the property_l
- PropertyChangeListener to removepublic java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
_propertyName
- name of the listened property.
protected void finalizeForBase() throws UpDateError
UpDateError
- if the CAlias is unknown of the main ACS (if
it is a clone, typically)protected void finalizeFromDeserialization()
protected CAliasImpl cloneC(ACSObject _master)
_master
- the clone master
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object _obj)
equals
in class java.lang.Object
_obj
- Object
public long getSerialVersionUID()
protected void firePropertyChange(java.lang.String _propertyName, java.lang.Object _oldValue, java.lang.Object _newValue)
_propertyName
- name of the changing property_oldValue
- of the property_newValue
- of the property. No operation if equal to _oldValue
and not null.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |