ARoad0.gBase
Class CPrivilegeUserImpl

java.lang.Object
  extended by ARoad0.gBase.CPrivilegeUserImpl
All Implemented Interfaces:
java.io.Serializable

public class CPrivilegeUserImpl
extends java.lang.Object
implements java.io.Serializable

This class is an embedded one, responsible for modeling a privilege user. It is used as a private attribute of a composite class instance, called the master, which delegates the processing of its privileges to this class. This class responsability covers both the source and the target privileges. The target inherited privileges may be managed by an AcsAddon, with the support of some methods in this class. The master class may be an EligibleParty, a Resource or a VirtualFolder, and it transfers directly all the actions on privileges to this class.

The master may be both a PrivilegeSource and a PrivilegeTarget. If the master is only an EligibleParty, it is only a PrivilegeSource and all the target operations are desactivated. If it is only a PrivilegeTarget (VirtualFolder or Resource), all the source operations are desactivated. EligiblePartyImpl and ResourceImpl are both subclasses of BasicImpl, and this explains why the CPrivilegeUserImpl instance is defined in BasicImpl without use. It is handled in its 2 direct subclasses. It is not possible to create a CPrivilegeUserImpl instance from a BasicImpl instance, because the master must be a PrivilegeSource or a PrivilegeTarget.

This class implements the PrivilegeSource and PrivilegeTarget interfaces for the master. This implementation is not declared to avoid to be a public class. The PrivilegeForTypes are managed directly by this class. The PrivilegeForLinks are managed directly or with a target cascading. There is no source cascading. For the target cascading, the inherited rights are managed independantly to the direct rights of the target. The master parent updates dynamically the inherited privileges applied to its children, which are the master of the CPrivilegeUser instances. The methods setEorL_TargetInheritedLinkedPrivileges(), getEorL_TargetInheritedLinkedPrivileges() and resetInheritedPrivilegeRights() are reserved to the master parent. This privilege inheritance depends mainly on each AcsAddon policy, since it is not used in this generic gBase package. The inherited PrivilegeForLinks have not the master as registered target, and they have only one target. The LINKED_IF_ALL_SOURCES privileges are forbidden in the privilege inheritance.

It is a javabean with the following bound properties: 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'InheritedTargetPrivileges'. The listeners are proper to the master instance. Excepting for EPRViewInBaseImpl and this class, 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. The exceptions from the listeners are not catched. 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.

See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changeSupport_
          manages all the property change listeners and also for its subclasses
(package private) static CPrivilegeUserImpl EMPTY_INSTANCE
          A reusable empty instance for initialization, to avoid the use of 'new' for temporary values.
protected static int INCREMENT_CAPACITY
           
protected static int INITIAL_CAPACITY
           
protected static int INITIAL_CAPACITY_2
           
protected  boolean isSource_
          True if the master is a PrivilegeSource.
protected  boolean isTarget_
          True if the master is a PrivilegeTarget.
protected  java.util.ArrayList<PrivilegeForLinks> l_inheritedT_LinkedPrivileges_
          List of the current inherited linked privileges for the master as target.
protected  java.util.ArrayList l_S_LinkedPrivileges_
          list of linked privileges of the master as source. isSource_ has to be true.
protected  java.util.ArrayList l_S_TypedPrivileges_
          list of typed privileges of the master as source. isSource_ has to be true.
protected  java.util.ArrayList<PrivilegeForLinks> l_T_LinkedPrivileges_
          list of linked privileges for the master as target. isTarget_ has to be true.
protected  java.util.ArrayList<PrivilegeForType> l_T_TypedPrivileges_
          list of typed privileges for the master as target. isTarget_ has to be true.
protected  java.util.Map<java.lang.String,StringRight[]> m_inheritedT_LinkedPRIRights_
          TreeMap of inherited linked privilege rights for the master as target.
protected  PrivilegeUser master_
          The master is the instance for which this class operates as an embedded one.
protected static int PRIME
           
static java.io.ObjectStreamField[] serialPersistentFields
          variable for the JDK 2 serialization
private static long serialVersionUID
           
 
Constructor Summary
protected CPrivilegeUserImpl()
          Default constructor.
protected CPrivilegeUserImpl(PrivilegeUser _master)
          Called by the methods addEorPrivilegeForType/LinksToSource/Target in the PrivilegeSources and the PrivilegeTargets.
 
Method Summary
protected  void addEorPrivilegeToSource(Privilege _priv)
          Sets a privilege as applicable to this access source.
protected  boolean addEorPrivilegeToTarget(Privilege _priv)
          Sets a privilege as applicable to this access target.
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  CPrivilegeUserImpl cloneC(PrivilegeUser _master)
          Clone for embedded class, without registering the new object in the ACSs, and without links to the privileges of this instance.
protected  CPrivilegeUserImpl copy(PrivilegeUser _masterCopy)
          This method provides a copy of the instance with another master.
 boolean equals(java.lang.Object _obj)
          Works even if the instance is user-finalized.
protected  void finalize()
          This method removes the CPrivilegeUser from the ACS lists, but there is no guaranee that the JVM calls this method before the end of the application.
protected  void finalizeForBase()
          This method cuts the links to the linked privileges, and informs the typed privileges.
protected  void finalizeFromDeserialization()
          This method finalizes all the privileges, since it is used after a deserialization of the master.
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  java.util.List<PrivilegeForLinks> getEorImmutableL_TargetInheritedLinkedPrivileges()
          Gets all the immutable list of the inherited linked privileges of the target.
protected  java.util.List getEorL_SourcePrivilegeForLinks()
          Gets all the PrivilegeForLinks linked to this source.
protected  java.util.List getEorL_SourcePrivilegeForTypes()
          Gest all the PrivilegeForTypes linked to this source.
protected  java.util.List getEorL_SourcePrivileges()
          Gets all the privileges linked to this source.
protected  java.util.List<PrivilegeForLinks> getEorL_TargetInheritedLinkedPrivileges()
          Gets all the inherited linked privileges of this target.
protected  java.util.List<PrivilegeForLinks> getEorL_TargetPrivilegeForLinks()
          Gets all the privilegeForLinks linked to this target, not the privilegeForTypes.
protected  java.util.List<PrivilegeForType> getEorL_TargetPrivilegeForTypes()
          Gets all the privilegeForTypes linked to this target, not the privilegeForLinks.
protected  java.util.List<Privilege> getEorL_TargetPrivileges()
          Gets all the privileges linked to this target.
protected  boolean getIsSource()
          The master may be both a PrivilegeSource and a PrivilegeTarget.
protected  boolean getIsTarget()
          The master may be both a PrivilegeSource and a PrivilegeTarget.
protected  java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedLinkedPRIRights()
          Gets the internal map of the inherited linked privilege rights, where the key is the name of the EligibleParty having the rights on the master, extended with, as last component, the parent order of the master parent which has given the rights.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
          Returns the change listeners for a property.
 long getSerialVersionUID()
           
 int hashCode()
           
protected  void removeEorPrivilegeToSource(Privilege _priv)
          Unregisters the privilege, and the master in the linked privilege when it is no more used by this privilege source.
protected  boolean removeEorPrivilegeToTarget(Privilege _priv)
          Unregisters the privilege, and this instance in the linked privilege when it is no more used by this privilege target.
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 resetInheritedPrivilegeRights(PrivilegeForLinks _lpri)
          Resets the inherited Privilege rights after an user edition.
protected  void setEorL_TargetInheritedLinkedPrivileges(java.util.ArrayList<PrivilegeForLinks> _l_priv)
          Sets all the inherited linked privileges for this target where the LINKED_IF_ALL_SOURCE type is forbidden, and any privilege having more than one target.
private  void setM_TargetInheritedLinkedPRIRights(java.util.List<PrivilegeForLinks> _l_priv)
          Sets the internal map of the inherited linked privilege rights, where the key is the name of the EligibleParty having the rights, extended with, as last component, the parent order of the master parent which has given the rights.
 java.lang.String toString()
          Gets the name last component of each privilege.
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
See Also:
Constant Field Values

INITIAL_CAPACITY_2

protected static final int INITIAL_CAPACITY_2
See Also:
Constant Field Values

INCREMENT_CAPACITY

protected static final int INCREMENT_CAPACITY
See Also:
Constant Field Values

PRIME

protected static final int PRIME
See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

master_

protected PrivilegeUser master_
The master is the instance for which this class operates as an embedded one. It may be a PrivilegeSource, a PrivilegeTarget, or both. To use cascading, it has to be a Resource.


l_T_TypedPrivileges_

protected java.util.ArrayList<PrivilegeForType> l_T_TypedPrivileges_
list of typed privileges for the master as target. isTarget_ has to be true.


l_T_LinkedPrivileges_

protected java.util.ArrayList<PrivilegeForLinks> l_T_LinkedPrivileges_
list of linked privileges for the master as target. isTarget_ has to be true.


m_inheritedT_LinkedPRIRights_

protected java.util.Map<java.lang.String,StringRight[]> m_inheritedT_LinkedPRIRights_
TreeMap of inherited linked privilege rights for the master as target. isTarget_ has to be true. The key is the name of the EligibleParty having the rights, with, as last component, the order of the parent which has given the rights. For instance, the direct parent has the string '1' and its direct parent has the string '2' as last name component. A subclass should use the constructor TreeMap(Comparator comparator) to set an ordering other than the natural ordering of the keys.


l_inheritedT_LinkedPrivileges_

protected java.util.ArrayList<PrivilegeForLinks> l_inheritedT_LinkedPrivileges_
List of the current inherited linked privileges for the master as target. isTarget_ has to be true. This is a data source of m_inheritedT_LinkedPRIRights_.


l_S_TypedPrivileges_

protected java.util.ArrayList l_S_TypedPrivileges_
list of typed privileges of the master as source. isSource_ has to be true.


l_S_LinkedPrivileges_

protected java.util.ArrayList l_S_LinkedPrivileges_
list of linked privileges of the master as source. isSource_ has to be true.


isSource_

protected boolean isSource_
True if the master is a PrivilegeSource.


isTarget_

protected boolean isTarget_
True if the master is a PrivilegeTarget.


changeSupport_

protected transient java.beans.PropertyChangeSupport changeSupport_
manages all the property change listeners and also for its subclasses


EMPTY_INSTANCE

static final CPrivilegeUserImpl 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
variable for the JDK 2 serialization

Constructor Detail

CPrivilegeUserImpl

protected CPrivilegeUserImpl()
Default constructor. No registration in the master.


CPrivilegeUserImpl

protected CPrivilegeUserImpl(PrivilegeUser _master)
                      throws CreateError
Called by the methods addEorPrivilegeForType/LinksToSource/Target in the PrivilegeSources and the PrivilegeTargets. Does not set the linked privilege cascading on the targets.

Parameters:
_master - owns this instance. If not a PrivilegeSource and nor a PrivilegeTarget, fires an InternalError.
Throws:
CreateError - if the argument is null. Does not control the ACS privilege management.
Method Detail

copy

protected CPrivilegeUserImpl copy(PrivilegeUser _masterCopy)
                           throws CreateError
This method provides a copy of the instance with another master. Each internal variable that is an external object reference have a shallow copy (no deep copy). When _result does not belong to aCS_, does not copy a privilege link if there is no privilege in the result ACS with the same key (the rights may be different).

Parameters:
_masterCopy - is the master of the new copy
Returns:
a new instance of CPrivilegeUserImpl
Throws:
CreateError - of the constructor with the same parameters.

getIsSource

protected final boolean getIsSource()
The master may be both a PrivilegeSource and a PrivilegeTarget.

Returns:
true if the master_ is a privilege source, and all the relevant methods are activated in this instance

getIsTarget

protected final boolean getIsTarget()
The master may be both a PrivilegeSource and a PrivilegeTarget.

Returns:
true if the master_ is a privilege target and all the relevant methods are activated in this instance

addEorPrivilegeToTarget

protected boolean addEorPrivilegeToTarget(Privilege _priv)
                                   throws BaseError
Sets a privilege as applicable to this access target. Uses ACS.getM_TypeOrientedPolicy().'Resource OR VirtualFolder. SecondTypesOfPrivilegeFor.' to control if the privilege type is authorized by the ACS. No operation if the privilege is already known. For PrivilegeForTypes, the TYPED and TYPED_CLASSED privilege are allowed as argument, while a TYPED_FOR_SEED or a TYPED_CLASSED_SPECIFIC privilege fires an InternalError. Caution: for a PrivilegeForType, the master constructor calls this method while the privilege is not still registered in the ACS. Fires 'OneTargetTypedPrivilege' or 'OneTargetLinkedPrivilege' events, with names that are similar but different to the Privileges event names. Calls PrivilegeForTypeImpl.fireOneTypedPrivilegeTargetEvent() when the argument is a PrivilegeForType.

Parameters:
_priv - to register in the target
Returns:
always false if it is not a Directory or not a PrivilegeForLinks, and if they are, true if children.getParentReadyForRightCascading() has changed, even if a child may not apply it for changing its rights.
Throws:
BaseError - if the master is not a privilege target, or, if _priv is a typed privilege:

- the privilege second type is not authorized for this target.


removeEorPrivilegeToTarget

protected boolean removeEorPrivilegeToTarget(Privilege _priv)
                                      throws BaseError
Unregisters the privilege, and this instance in the linked privilege when it is no more used by this privilege target. Called by the master and by finalizeForBase(). Fires 'OneTargetTypedPrivilege' or 'OneTargetLinkedPrivilege' events, with names that are similar but different to the Privileges event names.

Returns:
always false if it is not a Directory or not a PrivilegeForLinks, and if they are, true if child.getParentReadyForRightCascading() has changed (even if the child does not apply it for changing its rights).
Throws:
BaseError - if the privilege is unknown.

getEorL_TargetPrivileges

protected java.util.List<Privilege> getEorL_TargetPrivileges()
Gets all the privileges linked to this target. There are two types of privilege links (activated or not by the ACS): - PrivilegeForLinks: linked privilege established for a couple (ACSObject, privilege) - PrivilegeForType: typed privilege, where the ACSObject and the privilege has a common type (and a common class if it is a bindedClasses privilege) Returns an immutable empty list if getIsTarget() is false.

Returns:
List of Privileges. May be Collections.EMPTY_LIST, but never null.

getEorL_TargetPrivilegeForLinks

protected java.util.List<PrivilegeForLinks> getEorL_TargetPrivilegeForLinks()
Gets all the privilegeForLinks linked to this target, not the privilegeForTypes. Return both direct and cascading privileges, if the cascading is activated. Returns am empty list if getIsTarget() is false.

Returns:
List of PrivilegeForLinks. May be empty, but never null.

getEorL_TargetPrivilegeForTypes

protected java.util.List<PrivilegeForType> getEorL_TargetPrivilegeForTypes()
Gets all the privilegeForTypes linked to this target, not the privilegeForLinks. May include the privileges from the parents, if cascading is activated. Return an immutable empty list if getIsTarget() is false.

Returns:
List of PrivilegeForTypes. May be Collections.EMPTY_LIST, but never null.

addEorPrivilegeToSource

protected void addEorPrivilegeToSource(Privilege _priv)
                                throws BaseError
Sets a privilege as applicable to this access source. Uses ACS.getM_TypeOrientedPolicy().'EligibleParty.SecondTypesOfPrivilegeFor.' to control if the privilege type is authorized by the ACS. No operation if the privilege is already known. For PrivilegeForTypes, the TYPED and TYPED_CLASSED privilege are allowed as argument, while a TYPED_FOR_SEED or a TYPED_CLASSED_SPECIFIC privilege fires an InternalError. Caution: for PrivilegeForTypes, the constructor calls this method, and the privilege is not still registered in the ACS. Fires 'OneSourceTypedPrivilege' and 'OneSourceLinkedPrivilege' events.

Parameters:
_priv - to register in the source
Throws:
BaseError - if the master is not a privilege source, or, if _priv is a typed privilege:

- the privilege second type is not authorized for this source.


removeEorPrivilegeToSource

protected void removeEorPrivilegeToSource(Privilege _priv)
                                   throws BaseError
Unregisters the privilege, and the master in the linked privilege when it is no more used by this privilege source. Called by finalizeForBase(). Fires 'OneSourceTypedPrivilege' and 'OneSourceLinkedPrivilege' events.

Throws:
BaseError - if the privilege is unknown.

getEorL_SourcePrivileges

protected java.util.List getEorL_SourcePrivileges()
Gets all the privileges linked to this source. There is two types of privilege links (allowed or not by the ACS): - PrivilegeForLinks: linked privilege established for a couple (ACSObject, privilege) - PrivilegeForType: typed privilege, where the ACSObject and the privilege has a common type (and a common class if it is a bindedClasses privilege) Returns an immutable empty list if getIsSource() is false.

Returns:
List of Privileges. May be Collections.EMPTY_LIST, but never null.

getEorL_SourcePrivilegeForTypes

protected java.util.List getEorL_SourcePrivilegeForTypes()
Gest all the PrivilegeForTypes linked to this source. Returns an empty list if getIsSource() is false.

Returns:
List of PrivilegeForType. May be Collections.EMPTY_LIST, but never null.

getEorL_SourcePrivilegeForLinks

protected java.util.List getEorL_SourcePrivilegeForLinks()
Gets all the PrivilegeForLinks linked to this source. Note: for LINKED_IF_ALL linked privileges, the presence of the privilege does not mean that the master has the privilege rights. Returns an immutable empty list if getIsSource() is false.

Returns:
List of PrivilegeForLinks. May be Collections.EMPTY_LIST, but never null.

getEorImmutableL_TargetInheritedLinkedPrivileges

protected java.util.List<PrivilegeForLinks> getEorImmutableL_TargetInheritedLinkedPrivileges()
Gets all the immutable list of the inherited linked privileges of the target. The LINKED_IF_ALL_SOURCE type is forbidden, and any privilege having more than one target. To use by the consumers in the gWork packages, which deny any access if the returned value is null when the privilege inheritance is managed. It is recommanded to avoid getEorL_TargetInheritedLinkedPrivileges() for these consumers. Null is the default and immutable returned value in the generic gBase class, and this has to be changed in an AcsAddon implementing the inheritance. The privilege may be a clone, and the target may not be the master. Caution: a clone is not registered in its ACS, nor in its sources and targets. However, it is possible in the beamer to navigate from a cloned privilege to its targets or sources.

Returns:
immutable list of Linked Privileges. May be empty but never null.

getEorL_TargetInheritedLinkedPrivileges

protected java.util.List<PrivilegeForLinks> getEorL_TargetInheritedLinkedPrivileges()
Gets all the inherited linked privileges of this target. The LINKED_IF_ALL_SOURCE type is forbidden, and any privilege having more than one target. To use by the parent class in the gBase package, to prepare the updating of the list with a call to setEorL_TargetInheritedLinkedPrivileges(). No use in this generic gBase package, so for the AcsAddon packages.

Returns:
mutable list of Linked Privileges. May be a new empty list or an old empty list, but never null.

setEorL_TargetInheritedLinkedPrivileges

protected void setEorL_TargetInheritedLinkedPrivileges(java.util.ArrayList<PrivilegeForLinks> _l_priv)
Sets all the inherited linked privileges for this target where the LINKED_IF_ALL_SOURCE type is forbidden, and any privilege having more than one target. Called only by the master parents. Do not register the master in the inherited linked privileges. Calls setM_TargetInheritedLinkedPRIRights() to set the map (source name, StringRight[]). No use in this generic gBase package, so for the AcsAddon packages. Fires 'InheritedTargetPrivileges' events.

Parameters:
_l_priv - list of one-target Linked Privileges. May be empty, but never null.
Throws:
java.lang.InternalError - if a privilege has the LINKED_IF_ALL_SOURCE type, or if it has not exactly one target.

resetInheritedPrivilegeRights

protected void resetInheritedPrivilegeRights(PrivilegeForLinks _lpri)
Resets the inherited Privilege rights after an user edition. Called by the master parent when there is a change in the effective rights of an inherited Privilege. This is only when there is a change in the sources. Contrary to AclEntry, the rights are immutable and there is no conditional group. Reads l_inheritedT_LinkedPrivileges_ and updates m_inheritedT_LinkedPRIRights_ only for the relevant keys, that is one per source. Note: the creation of the inherited Privilege in a child is not handled by the generic gBase package, while the rights updating of the inherited Privilege is handled.

Parameters:
_lpri - inherited Privilege with updated rights. Never null.

setM_TargetInheritedLinkedPRIRights

private void setM_TargetInheritedLinkedPRIRights(java.util.List<PrivilegeForLinks> _l_priv)
Sets the internal map of the inherited linked privilege rights, where the key is the name of the EligibleParty having the rights, extended with, as last component, the parent order of the master parent which has given the rights. For instance, the direct parent has the string '1', and its direct parent has the string '2' as parent order in the last name component, and so on. On the privilege, calls the method getL_rights(), getEorLinkedSources() and getEorLinkedTargets(). The privilege may be a clone. Caution: a clone is not registered in its ACS, nor in its sources and targets. Called by setEorL_TargetInheritedLinkedPrivileges() only, and do not fire any event. No use in this generic gBase package, so for the AcsAddon packages.

Parameters:
_l_priv - argument of setEorL_TargetInheritedLinkedPrivileges(). May be empty, but never null.

getM_TargetInheritedLinkedPRIRights

protected java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedLinkedPRIRights()
Gets the internal map of the inherited linked privilege rights, where the key is the name of the EligibleParty having the rights on the master, extended with, as last component, the parent order of the master parent which has given the rights. For instance, the direct parent has the string '1', and its direct parent has the string '2' as parent order in the last name component, and so on. The map value is a non-null StringRight array of inherited rights, and it may be empty.

Returns:
unmodifiable map of inherited rights from the linked privileges. May be empty but never null.

addPropertyChangeListener

protected void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
Adds a listener to the bean, for all the bound properties. Used by the master only.

Parameters:
_l - PropertyChangeListener to add. Caution: the listener must NOT have specific hashCode() and equals() methods, to work with HashSet in the removing operations.

addPropertyChangeListener

protected void addPropertyChangeListener(java.lang.String _propertyName,
                                         java.beans.PropertyChangeListener _l)
Adds a listener to the bean. Used by the master for the properties: 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'InheritedTargetPrivileges'.

Parameters:
_propertyName - String is the 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.

removePropertyChangeListener

protected void removePropertyChangeListener(java.beans.PropertyChangeListener _l)
Removes a listener to the bean, for all the bound properties. Used by the master.

Parameters:
_l - PropertyChangeListener to remove

removePropertyChangeListener

protected void removePropertyChangeListener(java.lang.String _propertyName,
                                            java.beans.PropertyChangeListener _l)
Removes a listener to the bean. Used by the master for the properties: 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'InheritedTargetPrivileges'.

Parameters:
_propertyName - String is the name of the property
_l - PropertyChangeListener to remove

getPropertyChangeListeners

public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
Returns the change listeners for a property. Used by the AcsAddons.

Parameters:
_propertyName - name of the listened property.
Returns:
the change listeners. May be null.

cloneC

protected CPrivilegeUserImpl cloneC(PrivilegeUser _master)
Clone for embedded class, without registering the new object in the ACSs, and without links to the privileges of this instance. The privilege list is cloned without deep copy. The external object references are not cloned (see "Eor" in get method). The links between the EOR and the new instance are not set, but the lists of OER are cloned (privileges) so it is possible to get these active objects. Used by the master clone() method.

Parameters:
_master - must be a clone of this instance master
Returns:
instance with _master as master.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode derived from the master nick name, the first typed and the first linked privileges

equals

public boolean equals(java.lang.Object _obj)
Works even if the instance is user-finalized.

Overrides:
equals in class java.lang.Object
Parameters:
_obj -
Returns:
true if _obj is an instance of CPrivilegeUserImpl (or a derived class) equals to this instance (with the same class)

getSerialVersionUID

public long getSerialVersionUID()
Returns:
long

toString

public java.lang.String toString()
Gets the name last component of each privilege. Never null.

Overrides:
toString in class java.lang.Object
Returns:
String

finalizeForBase

protected void finalizeForBase()
                        throws UpDateError
This method cuts the links to the linked privileges, and informs the typed privileges. If the master is a PrivilegeTarget, the linked privileges are deleted if they are LINKED_one-to-one privileges. Otherwise, the linked privileges are kept without the links to the finalizing master. This method is called by finalize(), but finalize() may be not called. An unused object has to be deleted to inform the others objects, and this method HAS TO BE CALLED before deleting the CPrivilegeUser. This method does not raise PropertyChangeEvents since the BeanInfo for this class specifies that its ACS informs the listeners when this instance is finalized. To test if an instance has been finalized, let's use (master_ == null).

Throws:
UpDateError - if the main ACS do not known the CPrivilegeUser (if it is a clone without setName(), typically), if a privilege is not correct.

finalizeFromDeserialization

protected void finalizeFromDeserialization()
This method finalizes all the privileges, since it is used after a deserialization of the master. There, the attributes have been deserialized but are not 'true' objects of the base. The instance is NOT removed as a listener, since there is no listener. The internal maps are set to null, but not the private bound properties sets. Does not call finalizeForBase(). Called for EPRViewInBaseImpl only.


firePropertyChange

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. For the bound properties 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege', 'OneTargetTypedPrivilege', 'OneTargetLinkedPrivilege', 'InheritedTargetPrivileges'. Called by all the updating methods.

Parameters:
_propertyName - name of the changing property
_oldValue - of the property
_newValue - of the property. No operation if equal to _oldValue and not null.

finalize

protected void finalize()
                 throws java.lang.Throwable
This method removes the CPrivilegeUser from the ACS lists, but there is no guaranee that the JVM calls this method before the end of the application.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable