|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.BasicImpl
public class BasicImpl
This class is responsible for modeling the member of a folder (VirtualFolder or ViewInBase) in an ACS, and it ensures the handling of Privileges. It is the super class of EligibleParty and Resource. To let the PrivilegeSource capacity to EligibleParty, this class does not implement PrivilegeSource. Nonetheless, it handles fully privilege rights so its subclasses have not to do it. The PrivilegeForTypes are managed directly by this class. The PrivilegeForLinks are also managed directly, or with cascading in the subclass Resource.
This class implements the common alias methods for its subclasses which are ImmutableSource or ImmutableTarget. There are two types of alias relation this class may handle:
- the internal hard alias produces a direct alias-to-reference relation in the same ACS, and the two objects know this relation,
- the soft alias produces an indirect reference-to-alias relation where the alias is external, and it does not register this relation. 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.
This class is a javabean with the following bound properties: 'Comment', 'ImpliedOpenViews', 'VirtualFolders', 'ResourceType' or 'EPType', 'M_ConstrainedChildACS', 'HardAliasReference', 'HardAlias', 'SoftAlias', 'AcsOfSoftReferences' and 'hasSoftAlias'.
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.
This class is a composite class which uses the following embedded classes as private attributes: - CFolderMemberImpl for handling VirtualFolders and ViewInBases
- optional CPrivilegeUserImpl for handling PrivilegeForTypes and PrivilegeForLinks
- optional CAliasImpl for handling the hard and soft aliasing relations
This class has several subclasses in this package. All variables are private to secure the white box inheritances from this class, excepting for final variables and actorActivated_, for which the value is associated to the class and has to be set by the Actor constructors.
This class has several subclasses in this package and in the AcsAddon packages. Most of the variables are protected. See the Copyright.
CFolderMemberImpl
,
CPrivilegeUserImpl
,
CAliasImpl
,
Serialized FormField Summary | |
---|---|
protected ImmutableACS |
aCS_
|
protected ImmutableName |
aCS_Name_
|
protected CAliasImpl |
aliasHandler_
Optional alias handler of this instance. |
protected java.beans.PropertyChangeSupport |
changeSupport_
Manages all the property change listeners of this class and its subclasses. |
protected java.lang.String |
comment_
|
static BasicImpl |
EMPTY_INSTANCE
A reusable empty instance for initialization, to avoid the use of 'new' for temporary values. |
protected CFolderMemberImpl |
folderMember_
folders handler of this instance, both for view links and optionally, for virtual folder links. |
protected static int |
INCREMENT_CAPACITY
|
protected static int |
INITIAL_CAPACITY
|
protected static int |
INITIAL_CAPACITY_2
|
protected ImmutableName |
iS_Name_
|
protected java.util.HashMap<java.lang.String,ImmutableName[]> |
m_ConstrainedChildACS_
A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>. |
protected ImmutableName |
name_
|
protected static int |
PRIME
|
protected CPrivilegeUserImpl |
privHandler_
This optional privileges handler is used only by the subclasses, EligiblePartyImpl and ResourceImpl. |
static java.io.ObjectStreamField[] |
serialPersistentFields
variable for the JDK 2 serialization |
private static long |
serialVersionUID
|
protected java.lang.String |
type_
This is the Resource type or the EligibleParty type, to set by one of the relevant constructors. |
Constructor Summary | |
---|---|
|
BasicImpl()
Default constructor. |
protected |
BasicImpl(ImmutableName _name,
ACS _acs)
Used for the creation of a Basic by the subclass constructors. |
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 |
addConstrainedChildACS(java.lang.String _key,
ImmutableName[] _l_acs)
A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>. |
protected void |
addEorSoftAlias(ImmutableName _alias)
Adds an internal or external soft alias. |
protected void |
addInVFolderList(VirtualFolder _folder)
Registers the folder as containing this instance. |
protected void |
addInViewList(ViewInBase _view)
Registers the view as containing this BaseObject. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener _l)
Adds a listener to the bean, for all the bound properties. |
void |
addPropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Adds a listener to the bean. |
java.lang.Object |
clone()
Returns a copy without registering the new object in the ACSs, and without links to the privileges of this instance. |
int |
compareTo(java.lang.Object _o)
The comparison is based on the name compareTo() method of each leaf, except when there is a node. |
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 BasicImpl |
copyOwnVariables(BasicImpl _result)
UNUSED This method provides a copy of the instance variables. |
boolean |
equals(java.lang.Object _obj)
Does not compare the comment. |
protected void |
finalize()
This method removes the Basic from the ACS lists, but there is no guarantee that the JVM calls this method before the end of the application. |
void |
finalizeForBase()
This method cuts the linked privileges links, if any, and removes the instance in the virtual folders, if any. |
void |
finalizeForUser()
This method controls the immutability of the object, removes the associates, then calls finalizeForBase(). |
protected void |
finalizeFromDeserialization()
NO USE. |
void |
firePropertyChange(java.lang.String _propertyName,
java.lang.Object _oldValue,
java.lang.Object _newValue)
Fires an event to every registered listener, in any order. |
ImmutableName |
getAcsName()
|
java.lang.String |
getComment()
|
ImmutableACS |
getEorACS()
|
ACSObject |
getEorAliasAsInternalHardReference()
Get the unique ACSObject, if any, of this ACS for which this object is an internal hard reference. |
ACSObject |
getEorReferenceAsInternalHardAlias()
Get the unique ACSObject, if any, of this ACS as reference for which this object is an internal hard alias. |
ImmutableName |
getFullName()
The full name is unique for the Access Road program. |
boolean |
getHasSoftAlias()
This property is not displayed in the GUI. |
java.util.List<ViewInBase> |
getImpliedViews()
Get the open views containing this BaseObject. |
ImmutableName |
getIS_Name()
The Basic owns to an access control system (ACS) which owns to an information system (IS). |
ImmutableName[] |
getL_AcsOfSoftReferences()
Gets a sorted array of names of the ACS of the soft references. |
ImmutableName[] |
getL_SoftAlias()
Gets a sorted array of names of the internal or external soft alias. |
java.util.Map<java.lang.String,ImmutableName[]> |
getM_ConstrainedChildACS()
A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>. |
ImmutableName |
getName()
The name is unique for the Access Road program. |
java.lang.String |
getNickName()
This short name is NOT unique for the Access Road program nor the ACS if it is an ACS object. |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String _propertyName)
Returns the change listeners for a property. |
long |
getSerialVersionUID()
For the java serialization. |
java.lang.String |
getType()
The type is defined at the creation of the object, then it may be updated by the user. |
java.util.List<VirtualFolder> |
getVirtualFolders()
Gets the virtual folders containing the master. |
int |
hashCode()
|
protected void |
removeAcsOfSoftReferences(ImmutableName _acs)
Removes an external or internal alias from the master as soft reference. |
protected void |
removeConstrainedChildACS(java.lang.String _key,
ImmutableName[] _l_acs)
A constrained (opened or closed) child ACS has one or several of the following relations to this object: <ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>. |
protected void |
removeEorSoftAlias(ImmutableName _alias)
Removes an external or internal alias. |
protected boolean |
removeInVFolderList(VirtualFolder _folder)
Unregisters the folder when it does not contain this instance. |
protected boolean |
removeInViewList(ViewInBase _view)
Unregisters the view when it does not contain this BaseObject. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener _l)
Removes a listener to the bean, for all the bound properties. |
void |
removePropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Removes a listener to the bean. |
void |
setComment(java.lang.String _s)
Set any comment related to this Basic. |
protected void |
setEorAliasAsInternalHardReference(ACSObject _ali)
Set the unique ACSObject, if any, of this ACS for which this object is an internal hard reference. |
protected void |
setEorReferenceAsInternalHardAlias(ACSObject _ref)
Set the unique ACSObject, if any, of this ACS for which this object is an internal hard alias. |
protected void |
setType(java.lang.String _type)
If the argument is allowed by the ACS, sets the type of this instance. |
java.lang.String |
toString()
Gets the name last component of the instance. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
protected ImmutableName name_
protected java.lang.String comment_
protected ImmutableACS aCS_
protected ImmutableName iS_Name_
protected ImmutableName aCS_Name_
protected static final int PRIME
protected static final int INITIAL_CAPACITY
protected static final int INITIAL_CAPACITY_2
protected static final int INCREMENT_CAPACITY
protected java.lang.String type_
protected java.util.HashMap<java.lang.String,ImmutableName[]> m_ConstrainedChildACS_
protected CFolderMemberImpl folderMember_
protected CPrivilegeUserImpl privHandler_
protected CAliasImpl aliasHandler_
protected transient java.beans.PropertyChangeSupport changeSupport_
public static final BasicImpl EMPTY_INSTANCE
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
public BasicImpl()
protected BasicImpl(ImmutableName _name, ACS _acs) throws CreateError
- The name of the new instance is null.
- The name of the new instance contains a character that is not a letter.
- The found IS name is null.
- This is the name of a node or an area in the Information System, or the name of a virtual folder in the same ACS. Caution: this constructor does not register the new instance in the ACS; it is done by the subclasses.
_name
- of the eligible party to create, before the adding of the component
'<G>' if it is a GroupID or '<U>' if it is an UserID. Never null._acs
- is the main ACS of the Basic to create. Never null.
CreateError
- if the instance name is null,
if it contains a character that is not a letter, or contains '::' or '>>',
if the IS name is unknown in the ACS name,
if it is the name of a node or area in the information system, or the name of a virtual folder.Method Detail |
---|
public java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager) throws CreateError
copy
in interface Copyable
_name
- is a copy name. Usually creates as an extension of _parent name._acs
- is a main ACS of the copy to create. May not be the ACS of this instance._parent
- is not used._toRegisterInManager
- is not used.
CreateError
- of the constructor with the same parameterspublic ImmutableName getIS_Name()
getIS_Name
in interface ImmutableBasic
public ImmutableACS getEorACS()
getEorACS
in interface ACSObject
public ImmutableName getAcsName()
getAcsName
in interface ACSObject
public void setComment(java.lang.String _s)
setComment
in interface Basic
_s
- is a comment which is associated to the Basic.public java.lang.String getComment()
getComment
in interface ImmutableBasic
public ImmutableName getName()
getName
in interface BaseObject
public ImmutableName getFullName()
getFullName
in interface BaseObject
public java.lang.String getNickName()
getNickName
in interface BaseObject
public java.lang.String getType()
- to define the type updating policy from the ACS,
- for defining the authorized rights for each kind of rights (ACL, AGO...),
- to manage the capacity to delete the instance,
- and by the PrivilegeForType instances to apply their rights.
It is the resource type if the object is a Resource, the EP type if it is an EP. So, this method from Immutable Source and ImmutableTarget (not from ImmutableBasic) is for the Basic subclasses.
public final ACSObject getEorReferenceAsInternalHardAlias()
getEorReferenceAsInternalHardAlias
in interface ImmutableBasic
public final ACSObject getEorAliasAsInternalHardReference()
getEorAliasAsInternalHardReference
in interface ImmutableBasic
public final ImmutableName[] getL_SoftAlias()
getL_SoftAlias
in interface ImmutableBasic
public final ImmutableName[] getL_AcsOfSoftReferences()
getL_AcsOfSoftReferences
in interface ImmutableBasic
public final boolean getHasSoftAlias()
getHasSoftAlias
in interface ImmutableBasic
public java.util.List<ViewInBase> getImpliedViews()
getImpliedViews
in interface ImmutableBasic
public java.util.Map<java.lang.String,ImmutableName[]> getM_ConstrainedChildACS()
<ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.
Each relation is associated to a key with the same name.
public void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BaseBeanManager
addPropertyChangeListener
in interface BoundBean
_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 addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BaseBeanManager
addPropertyChangeListener
in interface BoundBean
_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.public void removePropertyChangeListener(java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BaseBeanManager
removePropertyChangeListener
in interface BoundBean
_l
- PropertyChangeListener to removepublic void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BaseBeanManager
removePropertyChangeListener
in interface BoundBean
_propertyName
- String is the name of the property_l
- PropertyChangeListener to removepublic java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
getPropertyChangeListeners
in interface ImmutableBasic
_propertyName
- name of the listened property.
public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object _obj)
equals
in interface BaseObject
equals
in class java.lang.Object
_obj
-
public int hashCode()
hashCode
in interface BaseObject
hashCode
in class java.lang.Object
public long getSerialVersionUID()
getSerialVersionUID
in interface ImmutableBasic
public int compareTo(java.lang.Object _o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
_o
- to compare must be an ImmutableLeaf
java.lang.ClassCastException
- - if the specified object's type
prevents it from being compared to this current Objectpublic void finalizeForUser() throws UpDateError
finalizeForUser
in interface Basic
finalizeForUser
in interface FinalizedObjectForUser
UpDateError
- if the object type contains 'byAcsCreator', starts with
or ends with 'immutable', or from finalizeFromBase() or
AssociateUtilityImpl.removeAssociatesAfterDeletion()public void finalizeForBase() throws UpDateError
finalizeForBase
in interface FinalizedObject
UpDateError
- if the CPrivilegeUserImpl or CFolderMemberImpl throws it.public java.lang.String toString()
toString
in class java.lang.Object
protected void setEorReferenceAsInternalHardAlias(ACSObject _ref) throws UpDateError
_ref
- the reference. May be null.
UpDateError
- _ref does not belong to the same ACS or the type is
immutableprotected 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
- the type is immutableprotected void removeEorSoftAlias(ImmutableName _alias) throws UpDateError
_alias
- is a registered alias. 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
- if the type is immutableprotected void removeAcsOfSoftReferences(ImmutableName _acs) throws UpDateError
_acs
- ACS name. No action if null.
UpDateError
- if _acs is not known.protected void addInViewList(ViewInBase _view)
_view
- to addprotected boolean removeInViewList(ViewInBase _view)
_view
- to remove
protected void addConstrainedChildACS(java.lang.String _key, ImmutableName[] _l_acs)
<ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.
Each relation is associated to a key with the same name, given by ACSFactoryUtilityImpl.getKeysForConstrainedChildACSMap(). Fires a 'M_ConstrainedChildACS' event. Called by the child ACS setAcsRelationsInIS() method.
_key
- must be among the allowed keys. Otherwise, throws an InternalError._l_acs
- array of constrained and opened child ACSs to add.
Noop if null or empty.protected void removeConstrainedChildACS(java.lang.String _key, ImmutableName[] _l_acs) throws UpDateError
<ForChildAcsOpeningAndClosing>, <ForChildAcsOpeningNoClosing> or <ForChildAcsIntegrity>.
Each relation is associated to a key with the same name. Fires a 'M_ConstrainedChildACS' event. Calls ACSFactoryUtilityImpl.getKeysForConstrainedChildACSMap(). Called by the child ACS.
_key
- must be among the allowed keys._l_acs
- constrained and opened child ACSs to remove. To set to null
for deleting _key in the map. May be empty but without null element.
UpDateError
- if:- the key is null or unknown,
- one value in _l_acs is null,
- a value is not registered.
protected void addInVFolderList(VirtualFolder _folder) throws CreateError
_folder
- to add
CreateError
- if the ACS does not manage the virtual folders.public java.util.List<VirtualFolder> getVirtualFolders()
getVirtualFolders
in interface ImmutableBasic
protected boolean removeInVFolderList(VirtualFolder _folder) throws CreateError
CreateError
- if the ACS does not manage the virtual folders.protected void setType(java.lang.String _type) throws UpDateError
An '<immutable>' type forbids most of the updatings of the instance. Indeed, it is possible to switch for example from 'actor' to '<immutable> actor', but not to 'immutable group'. The rule is that the 'immutable ' key word, if it is used, must be at the start or at the end of the type.
From the default value 'undefined', any updating may be done. The user cannot change the type if it starts with '<byAcsCreator>', but the program can do it. For doing it, '12345678901234567890' is a program-reserved value. Even if it is not allowed by the ACS, '12345678901234567890' is the only new value it is not possible to change from a type starting with '<byAcsCreator>'. If the current type does not start with '<byAcsCreator>' but contains it, the type is editable while the instance cannot be finalized by the user. From '12345678901234567890', any new value may be set from the allowed ones, and this starting value is the only one which allows to set a value containing '<byAcsCreator>'.
Since the typed privileges use depends on the type, this method registers the typed privileges having the same type (modulo the key word '<immutable>'). However, this is not true for the for_seed typed privileges, nor for the specific ones, because a specific privilege cannot be created if the source or the target is not there. A switching from/to an '<immutable>' type to the other format never changes the associated PrivilegeForTypes.
Every change in this method should be done in VirtualFolderImpl.setType(). Fires a property change on 'ResourceType' or 'EPType'. This method is indirectly called from the GUI. Called by finalizeForBase(), ResourceImpl.setResourceType() and EligiblePartyImpl.setEPType(), at the request of their subclass constructor, or for the GUI. Calls ACSImpl.getM_TypesAndGUIPolicy() and getM_TypeOrientedPolicy(), BaseUtilityImpl.getObjectTypeWithoutImmutable().
_type
- as for instance "Cayro_file" or "tablespace".
May be null, or equals to the current type.
UpDateError
- if the new value and the old one are not compatible, or
if the type handling for privileges throws it.protected BasicImpl copyOwnVariables(BasicImpl _result) throws CreateError
_result
- to update with this instance variables copies
CreateError
- from CFolderMemberImpl and CPrivilegeUserImplpublic void firePropertyChange(java.lang.String _propertyName, java.lang.Object _oldValue, java.lang.Object _newValue)
_propertyName
- 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
protected void finalizeFromDeserialization()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |