|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.CPrivilegeUserImpl
public class CPrivilegeUserImpl
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.
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 |
---|
protected static final int INITIAL_CAPACITY
protected static final int INITIAL_CAPACITY_2
protected static final int INCREMENT_CAPACITY
protected static final int PRIME
private static final long serialVersionUID
protected PrivilegeUser master_
protected java.util.ArrayList<PrivilegeForType> l_T_TypedPrivileges_
protected java.util.ArrayList<PrivilegeForLinks> l_T_LinkedPrivileges_
protected java.util.Map<java.lang.String,StringRight[]> m_inheritedT_LinkedPRIRights_
protected java.util.ArrayList<PrivilegeForLinks> l_inheritedT_LinkedPrivileges_
protected java.util.ArrayList l_S_TypedPrivileges_
protected java.util.ArrayList l_S_LinkedPrivileges_
protected boolean isSource_
protected boolean isTarget_
protected transient java.beans.PropertyChangeSupport changeSupport_
static final CPrivilegeUserImpl EMPTY_INSTANCE
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
protected CPrivilegeUserImpl()
protected CPrivilegeUserImpl(PrivilegeUser _master) throws CreateError
_master
- owns this instance. If not a PrivilegeSource and nor
a PrivilegeTarget, fires an InternalError.
CreateError
- if the argument is null.
Does not control the ACS privilege management.Method Detail |
---|
protected CPrivilegeUserImpl copy(PrivilegeUser _masterCopy) throws CreateError
_masterCopy
- is the master of the new copy
CreateError
- of the constructor with the same parameters.protected final boolean getIsSource()
protected final boolean getIsTarget()
protected boolean addEorPrivilegeToTarget(Privilege _priv) throws BaseError
_priv
- to register in the target
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.
protected boolean removeEorPrivilegeToTarget(Privilege _priv) throws BaseError
BaseError
- if the privilege is unknown.protected java.util.List<Privilege> getEorL_TargetPrivileges()
protected java.util.List<PrivilegeForLinks> getEorL_TargetPrivilegeForLinks()
protected java.util.List<PrivilegeForType> getEorL_TargetPrivilegeForTypes()
protected void addEorPrivilegeToSource(Privilege _priv) throws BaseError
_priv
- to register in the source
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.
protected void removeEorPrivilegeToSource(Privilege _priv) throws BaseError
BaseError
- if the privilege is unknown.protected java.util.List getEorL_SourcePrivileges()
protected java.util.List getEorL_SourcePrivilegeForTypes()
protected java.util.List getEorL_SourcePrivilegeForLinks()
protected java.util.List<PrivilegeForLinks> getEorImmutableL_TargetInheritedLinkedPrivileges()
protected java.util.List<PrivilegeForLinks> getEorL_TargetInheritedLinkedPrivileges()
protected void setEorL_TargetInheritedLinkedPrivileges(java.util.ArrayList<PrivilegeForLinks> _l_priv)
_l_priv
- list of one-target Linked Privileges. May be empty, but never null.
java.lang.InternalError
- if a privilege has the LINKED_IF_ALL_SOURCE type, or
if it has not exactly one target.protected void resetInheritedPrivilegeRights(PrivilegeForLinks _lpri)
_lpri
- inherited Privilege with updated rights. Never null.private void setM_TargetInheritedLinkedPRIRights(java.util.List<PrivilegeForLinks> _l_priv)
_l_priv
- argument of setEorL_TargetInheritedLinkedPrivileges().
May be empty, but never null.protected java.util.Map<java.lang.String,StringRight[]> getM_TargetInheritedLinkedPRIRights()
protected void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
_l
- PropertyChangeListener to add. Caution: the listener must NOT
have specific hashCode() and equals() methods, to work with HashSet
in the removing operations.protected void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
_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.protected void removePropertyChangeListener(java.beans.PropertyChangeListener _l)
_l
- PropertyChangeListener to removeprotected void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
_propertyName
- String is the name of the property_l
- PropertyChangeListener to removepublic java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
_propertyName
- name of the listened property.
protected CPrivilegeUserImpl cloneC(PrivilegeUser _master)
_master
- must be a clone of this instance master
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object _obj)
equals
in class java.lang.Object
_obj
-
public long getSerialVersionUID()
public java.lang.String toString()
toString
in class java.lang.Object
protected void finalizeForBase() throws UpDateError
UpDateError
- if the main ACS do not known the CPrivilegeUser (if
it is a clone without setName(), typically), if a privilege is not correct.protected void finalizeFromDeserialization()
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 |