|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.BasicImpl
ARoad0.gBase.ResourceImpl
ARoad0.gBase.DirectoryImpl
public class DirectoryImpl
This class is responsible for modeling a directory which contains children, as resources and other directories. It manages fully the AG inherited rights of its children. It manages only partially the ACL and PRI inherited rights of its children, and this may be completed by the AcsAddons. There are three flows of data to manage the inherited AclEntries:
- one at the ACL creation/deletion, and this is not done in the generic gBase,
- one at their inner rights editing, and this is the responsability of this class,
- and the last flow, only for the conditional ACL, at the editing of the membership relation between the source and a condition group, and this is the responsability of this class.
In this later case, this is the calling sequence to reset the conditional AclEntry:
- GroupIDImpl.addEorMember(),
- if GroupIDImpl.isConditionalACLtoResetAfterMembershipChangeInThisGroup(),
- AclEntry.resetRightsAsInheritedAclEntry().
There are two flows of data to manage the inherited Privileges:
- one at the privilege creation/deletion, and this is not done in the generic gBase,
- one at their sources editing, and this is the responsability of this class.
A CNodeImpl embedded instance is used to handle the children. All variables are protected. It is a javabean with the following bound properties: 'Children', 'EnforceChildGID'. The listeners are proper to this instance, 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 has several subclasses in this package and in the AcsAddon packages. Most of the variables are protected.
Directory
,
Resource
,
Serialized FormField Summary | |
---|---|
static DirectoryImpl |
EMPTY_INSTANCE
A reusable empty instance for initialization, to avoid the use of 'new' for temporary values. |
protected boolean |
EnforceChildGID_
|
protected CNodeImpl |
nodeHandler_
children handler of this instance |
static java.io.ObjectStreamField[] |
serialPersistentFields
variable for the JDK 2 serialization |
private static long |
serialVersionUID__
|
Fields inherited from class ARoad0.gBase.ResourceImpl |
---|
actorActivated_, groupID_, l_aclEntry_, l_groupRights_, l_inheritedT_AclEntries_, l_OpenAcsControllerNames_, l_ownerRights_, l_parentTreeAGRightsAllowToGoAcross_, l_rootRights_, m_inheritedT_ACLRights_, parent_, userID_ |
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 | |
---|---|
DirectoryImpl()
The basic constructor |
|
DirectoryImpl(ImmutableName _name,
ACS _acs,
Directory _parent,
UserID _owner,
java.lang.String _resourceType)
This constructor sets this instance as the ACS own resources root if _parent is null. |
|
DirectoryImpl(ImmutableName _name,
ACS _acs,
Directory _parent,
UserID _owner,
java.lang.String _resourceType,
boolean _toRegisterInManager)
This constructor sets this instance as own resources root if the ACS has not one yet. |
Method Summary | |
---|---|
protected void |
addEorChild(ImmutableLeaf _child)
Adds a child to this Node. |
void |
addPropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Adds a listener to the bean. |
java.lang.Object |
clone()
Clone without register the new object in the ACSs. |
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, without children copying because the copy order will not be always correct. |
protected DirectoryImpl |
copyOwnVariables(DirectoryImpl _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 Copyable.copy(), but without copying the internal aclEntries. |
boolean |
equals(java.lang.Object _obj)
Does not compare the comment. |
void |
finalizeForBase()
Finalizes the directory and ALL ITS CHILDREN. |
protected void |
finalizeFromDeserialization()
This method finalizes all the children, since it is used after a deserialization. |
boolean |
getEnforceChildGID()
|
ImmutableResource[] |
getEorL_Children()
Gets a sorted array of external object references on the children of this node, which may be leaves (resources) or nodes. |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String _propertyName)
Returns the change listeners for a property. |
long |
getSerialVersionUID()
For the java serialization. |
int |
hashCode()
Overrides the super method. |
protected void |
removeEorChild(ImmutableLeaf _child)
Removes a child from this Node. |
void |
removePropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Removes a listener to the bean. |
void |
resetInheritedAclEntryRights(AclEntry _acl)
Resets the inherited AclEntry rights after an user edition. |
void |
resetInheritedAclEntryRightsOfChildren(AclEntry _acl)
At each rights changing into a direct ACL, if the ACL inheritance is applicable, reset the inherited AclEntry rights in the children. |
void |
resetInheritedPrivilegeRights(PrivilegeForLinks _lpri)
Resets the inherited Privilege rights after an user edition. |
void |
resetInheritedPrivilegeRightsOfChildren(PrivilegeForLinks _lpri)
Resets the inherited Privilege rights in the children, if the Privilege inheritance is applicable. |
void |
setEnforceChildGID(boolean _a)
Noop if 'resource 1: new child/node inherits the current G, if activated, and G is not the account primary group' is not in the ACS rules. |
void |
setEorL_Children(ImmutableLeaf[] _l_Child)
Deprecated. add/removeEorChild methods replaces it |
void |
setL_groupRights(StringRight[] _s)
Overrides the super method to call getL_inheritedOwnerRights(), BaseUtilityImpl.withAcrossToDirectoryAGRights(), fireL_inheritedGroupRights() and setAGOAccessFromTheParentGroup() on the children. |
void |
setL_ownerRights(StringRight[] _s)
Overrides the super method to change the inherited owner rights on the children. |
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 |
Methods inherited from interface ARoad0.gBaseInterface.Resource |
---|
addAclEntry, removeAclEntry, selectInheritedPrivilege, setEorGroupID, setEorUserID, setL_rootRights, setResourceType |
Methods inherited from interface ARoad0.gBaseInterface.Basic |
---|
finalizeForUser, setComment |
Methods inherited from interface ARoad0.gBaseInterface.PrivilegeTarget |
---|
addEorPrivilegeForTypeToTarget, removeEorPrivilegeToTarget |
Methods inherited from interface ARoad0.gBaseInterface.ImmutableBasic |
---|
getComment, getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getImpliedViews, getIS_Name, getL_AcsOfSoftReferences, getL_SoftAlias, getVirtualFolders |
Methods inherited from interface ARoad0.gBaseInterface.ImmutablePrivilegeTarget |
---|
getEorImmutableL_TargetInheritedLinkedPrivileges, getEorL_TargetPrivilegeForLinks, getEorL_TargetPrivilegeForTypes, getEorL_TargetPrivileges, getM_TargetInheritedLinkedPRIRights, getType |
Methods inherited from interface ARoad0.gBaseInterface.ImmutableTarget |
---|
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias |
Methods inherited from interface ARoad0.gBaseInterface.BaseBeanManager |
---|
addPropertyChangeListener, removePropertyChangeListener |
Methods inherited from interface ARoad0.gBaseInterface.ImmutableLeaf |
---|
compareTo, getEorParent |
Methods inherited from interface ARoad0.gBaseInterface.ACSObject |
---|
getAcsName, getEorACS |
Methods inherited from interface ARoad0.gBaseInterface.BaseObject |
---|
getFullName, getName, getNickName |
Field Detail |
---|
private static final long serialVersionUID__
protected CNodeImpl nodeHandler_
protected boolean EnforceChildGID_
public static final DirectoryImpl EMPTY_INSTANCE
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
public DirectoryImpl()
public DirectoryImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType) throws CreateError
_name
- of the directory_acs
- is the main ACS of the directory_parent
- of the directory; may be null._resourceType
- is the type, and may be null if the ACS allows it._owner
- owns the resource; may be null.
CreateError
- if ACSImpl.newEorResource() throws it -
the instance must then be deleted !public DirectoryImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType, boolean _toRegisterInManager) throws CreateError
_name
- ImmutableName of the directory._acs
- main ACS of the directory._parent
- Node which owns the directory._owner
- owns the resource; may be null._resourceType
- is the type, and may be null if the ACS allows it._toRegisterInManager
- false if this method must not register
the instance in the ACS.
CreateError:
- see super(_name, _acs, _parent, _resourceType,
_toRegisterInManager) exception
CreateError
Method Detail |
---|
public java.lang.Object copy(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager) throws CreateError
copy
in interface Copyable
copy
in class ResourceImpl
_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
- DirectoryImpl which belongs to _acs and will have the copy.
May be null._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 Resource
copyWithoutInternalAcl
in class ResourceImpl
_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 final void setEorL_Children(ImmutableLeaf[] _l_Child) throws BaseError
_l_Child
- array of leaves which are in this directory. May be
equal to ResourceImpl.EMPTY_INSTANCE, or null.
BaseError
- if a leaf is not owned by the main ACS of
this directory (or InternalError for several rare conditions)public ImmutableResource[] getEorL_Children()
getEorL_Children
in interface ImmutableDirectory
public void setEnforceChildGID(boolean _a)
setEnforceChildGID
in interface Directory
_a
- true if the groupID is changed for the newly-created children
to this-directory groupID, and the newly-created sub-directories have
this property set to true.public boolean getEnforceChildGID()
getEnforceChildGID
in interface ImmutableDirectory
public void resetInheritedAclEntryRightsOfChildren(AclEntry _acl)
- one at the ACL creation/deletion, and this is not done in the generic gBase package,
- one at their inner rights editing,
- and the last flow, only for the condition ACL, at the editing of the membership relation between the source and a condition group.
This method is called for handling the second and the third cases, to update the children of the Directory the AclEntry which is the target of the AclEntry. Not described in the BeanInfo since the user does not call it. Overridden in the AcsAddons. Called by AclEntryImpl.resetRightsAsInheritedAclEntry().
resetInheritedAclEntryRightsOfChildren
in interface Directory
_acl
- own AclEntry with updated rightspublic void resetInheritedAclEntryRights(AclEntry _acl)
resetInheritedAclEntryRights
in interface Resource
resetInheritedAclEntryRights
in class ResourceImpl
_acl
- inherited AclEntry with updated rightspublic void resetInheritedPrivilegeRights(PrivilegeForLinks _lpri)
resetInheritedPrivilegeRights
in interface Resource
resetInheritedPrivilegeRights
in class ResourceImpl
_lpri
- inherited Privilege with updated rights. Never null.public void resetInheritedPrivilegeRightsOfChildren(PrivilegeForLinks _lpri)
- one at the privilege creation/deletion, and this is not done in the generic gBase package,
- one at their sources editing,
This method is called for handling the second case, to update the children of the Directory which is the target of the Privilege. Not described in the BeanInfo since the user does not call it. Overridden by the AcsAddons. Called by PrivilegeForLinksImpl.resetRightsAsInheritedPrivilege().
resetInheritedPrivilegeRightsOfChildren
in interface Directory
_lpri
- inherited Privilege with updated rightsprotected DirectoryImpl copyOwnVariables(DirectoryImpl _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
if
- super throws it
CreateError
protected void addEorChild(ImmutableLeaf _child)
_child
- is a Resource (not a simple leaf) to put in this Node.
No action if null, or already known.
java.lang.InternalError
- if the leaves list is null, or if _child
is not a VirtualFolder. If firePropertyChange() throws an exception,
displays an user message.protected void removeEorChild(ImmutableLeaf _child) throws UpDateError
_child
- is a virtual folder which is in this CNode. No action if
null.
UpDateError
- if _child is not known.public void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BaseBeanManager
addPropertyChangeListener
in interface BoundBean
addPropertyChangeListener
in class ResourceImpl
_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 ResourceImpl
_propertyName
- name of the property_l
- PropertyChangeListener to removepublic java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String _propertyName)
getPropertyChangeListeners
in interface ImmutableBasic
getPropertyChangeListeners
in class ResourceImpl
_propertyName
- name of the listened property.
public void setL_ownerRights(StringRight[] _s) throws UpDateError
setL_ownerRights
in interface Resource
setL_ownerRights
in class ResourceImpl
_s
- array of acsrights and/or metarights. May be null.
UpDateError
- if the owner rights are immutable.public void setL_groupRights(StringRight[] _s) throws UpDateError
setL_groupRights
in interface Resource
setL_groupRights
in class ResourceImpl
_s
- array of acsrights and/or metarights. May be null.
UpDateError
- if the group rights are immutable.public void finalizeForBase() throws UpDateError
finalizeForBase
in interface FinalizedObject
finalizeForBase
in class ResourceImpl
UpDateError
- if the directory is unknown of the main ACS (if
it is a clone without setName(), typically)public java.lang.Object clone()
clone
in class ResourceImpl
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object _obj)
ResourceImpl
equals
in interface BaseObject
equals
in class ResourceImpl
_obj
- Object
public final int hashCode()
hashCode
in interface BaseObject
hashCode
in class ResourceImpl
public long getSerialVersionUID()
BasicImpl
getSerialVersionUID
in interface ImmutableBasic
getSerialVersionUID
in class ResourceImpl
public java.lang.String toString()
ResourceImpl
toString
in class ResourceImpl
protected void finalizeFromDeserialization()
finalizeFromDeserialization
in class ResourceImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |