|
||||||||||
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.ActorImpl
public class ActorImpl
This class is responsible for modeling an acting entity which may have access to controlled resources. It may also play some special roles, as a bridge, between an another actor and some resources. Exemples of such actors are servers, printers, LDAP objects or executables. This class also models the operating system process which has a current account and group, and which belongs to several groups. By default, the current account and group are the account and group of the actor as resource. The current account and group, and the secondary groups, cannot be updated if the resource type does not allow it. But the resource type does not control the bridge target. The actor alias must be another-acs actor. It is a javabean with the following bound properties: 'SecondaryGroups', 'l_bridgeSources', 'CurrentGroupID', 'CurrentUserID', 'ACSBridgeTarget', 'EPType', 'IsRightProxy', 'AclConnectedResources', 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege'. 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 subclasses in this package. All variables are private to secure the white box inheritances from this class, excepting for epType_, for which the values are associated to the class and have to be set by the subclass constructors.
This class has several subclasses in this package and in the AcsAddon packages. Most of the variables are protected.
Field Summary | |
---|---|
protected ImmutableActor |
bridgeTarget_
|
protected ImmutableGroupID |
currentGroupID_
|
protected ImmutableUserID |
currentUserID_
with this initial value, currentUserID_ is returned as null in the get method. |
static ActorImpl |
EMPTY_INSTANCE
A reusable empty instance for initialization, to avoid the use of 'new' for temporary values. |
protected boolean |
isRightProxy_
|
protected ImmutableActor[] |
l_bridgeSources_
|
protected ImmutableGroupID[] |
l_SecondaryGroup_
|
protected java.util.SortedMap<ImmutableName,ImmutableResource> |
m_AclEntriesResources_
Map |
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 | |
---|---|
ActorImpl()
Default constructor. |
|
ActorImpl(ImmutableName _name,
ACS _acs,
Directory _parent,
UserID _owner,
java.lang.String _resourceType,
ImmutableActor _bridgeTarget)
Registers the new instance in the eligible parties map in the main ACS. |
|
ActorImpl(ImmutableName _name,
ACS _acs,
Directory _parent,
UserID _owner,
java.lang.String _resourceType,
ImmutableActor _bridgeTarget,
boolean _toRegisterInManager)
Used for the creation of an actor. |
Method Summary | |
---|---|
protected void |
addAclEntryToEP(AclEntry _acl)
Adds an aclEntry to this instance as an EligibleParty, not as a Resource. |
protected void |
addBridgeSource(Actor _act)
Adds an actor as source to this instance which is then a bridge target for this source. |
protected void |
addEorPrivilegeForLinksToSource(PrivilegeForLinks _priv)
Sets a privilege as applicable to this access source. |
void |
addEorPrivilegeForTypeToSource(PrivilegeForType _priv)
Sets a privilege as applicable to this access source, and this is called only by the program. |
void |
addPropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Adds a listener to the bean. |
java.lang.Object |
clone()
Returns a deep copy without registering of 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, following Copyable. |
protected ActorImpl |
copyOwnVariables(ActorImpl _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 copy() but without copying internal aclEntries. |
boolean |
equals(java.lang.Object _obj)
Tests all the internal Actor properties, and all the superclasses properties. |
void |
finalizeForBase()
This method removes the actor in the eligible party ACS list, and in the resources connected through an aclEntry. |
protected void |
finalizeFromDeserialization()
This method finalizes all the attributes, since it is used after a deserialization. |
protected boolean |
getAuthorizeCurrentGroupID()
Reads the key 'Actor.NoCurrentGroup' in the type-oriented ACS policy, and returns false only if this instance cannot have a current group. |
ImmutableActor |
getEorACSBridgeTarget()
Get the another-ACS actor for which this resource is a bridge source. |
ImmutableGroupID |
getEorCurrentGroupID()
Get the group for which this actor is member as right user. |
ImmutableUserID |
getEorCurrentUserID()
If this property has not been set, it is null. |
java.util.List<ImmutableResource> |
getEorL_AclConnectedResources()
Gets the resources connected to this eligible party. |
ImmutableActor[] |
getEorL_bridgeSources()
A bridge is an unidirectionnal connexion between two ACS through the mean of two actors, one in each ACS. |
ImmutableGroupID[] |
getEorL_SecondaryGroup()
A secondary GroupID adds new access to the actor as rights user. |
java.util.List |
getEorL_SourcePrivilegeForLinks()
Gets all the privilegeForLinks linked to this source. |
java.util.List |
getEorL_SourcePrivilegeForTypes()
Gets all the PrivilegeForTypes linked to this source. |
java.util.List |
getEorL_SourcePrivileges()
Gets all the privileges linked to this source. |
java.lang.String |
getEPType()
As an EligibleParty, but it is simply the Basic type. |
boolean |
getIsACSBridgeSource()
|
boolean |
getIsRightProxy()
The default value is true. |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String _propertyName)
Returns the change listeners for a property. |
long |
getSerialVersionUID()
For the java serialization. |
int |
hashCode()
|
boolean |
isMemberToSecondaryGroup(ImmutableGroupID _grp)
|
protected void |
removeAclEntryToEP(AclEntry _acl)
Removes the related resource of an aclEntry, as a kind of an EligibleParty, not as a resource, if the argument is the single AclEntry for the resource. |
protected void |
removeBridgeSource(Actor _act)
Remove an actor as bridge source for this instance. |
protected void |
removeEorCurrentGroupID()
Remove the current groupID of the resource. |
protected void |
removeEorCurrentUserID()
Remove the current userID of the resource. |
void |
removeEorPrivilegeToSource(Privilege _priv)
Unregisters the privilege, and this instance in the linked privilege when it is no more used by this privilege source. |
void |
removePropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Removes a listener to the bean. |
protected void |
removeSecondaryGroup(ImmutableGroupID _grp)
A secondary group is used by an Actor as rights user, to get complementary accesses to targets. |
void |
setEorACSBridgeTarget(Actor _target)
Sets the another-ACS actor for which this instance is a bridge source. |
protected void |
setEorACSBridgeTarget(Actor _target,
BaseObject _caller)
Sets the another-ACS actor for which this resource is a bridge source. |
protected void |
setEorCurrentGroupID(ImmutableGroupID _g)
Set the group for which this actor is member as right user. |
void |
setEorCurrentGroupIDForUser(ImmutableGroupID _g)
Set the group for which this actor is member as right user. |
protected void |
setEorCurrentUserID(ImmutableUserID _u)
The current userID is not null when, typically, the actor is an executable launched under an userID. |
void |
setEorCurrentUserIDForUser(ImmutableUserID _u)
The current userID is not null when, typically, the actor is an executable launched under an userID. |
protected void |
setEorL_bridgeSources(ImmutableActor[] _L)
A bridge is an unidirectionnal connexion between two ACS through the mean of two actors, one in each ACS. |
protected void |
setEorL_SecondaryGroup(ImmutableGroupID[] _L)
A secondary group is used by an Actor as rights user, to get complementary accesses to targets only when a current userID is set. |
void |
setEorL_SecondaryGroupForUser(ImmutableGroupID[] _L)
A secondary group is used by an Actor as rights user, to get complementary accesses to targets only when a current userID is set. |
void |
setEPType(java.lang.String _st)
If _st is allowed by the ACS, set the type of this EligibleParty which is also a resource. |
void |
setIsRightProxy(boolean _b)
Noop if the resource type contains 'byAcsCreator' or 'immutable'. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ARoad0.gBaseInterface.Resource |
---|
addAclEntry, removeAclEntry, resetInheritedAclEntryRights, resetInheritedPrivilegeRights, selectInheritedPrivilege, setEorGroupID, setEorUserID, setL_groupRights, setL_ownerRights, setL_rootRights, setResourceType |
Methods inherited from interface ARoad0.gBaseInterface.PrivilegeTarget |
---|
addEorPrivilegeForTypeToTarget, removeEorPrivilegeToTarget |
Methods inherited from interface ARoad0.gBaseInterface.Basic |
---|
finalizeForUser, setComment |
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.ImmutableLeaf |
---|
compareTo, getEorParent |
Methods inherited from interface ARoad0.gBaseInterface.ImmutableEligibleParty |
---|
getM_ConstrainedChildACS |
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.ImmutableSource |
---|
getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getHasSoftAlias, getL_AcsOfSoftReferences, getL_SoftAlias, getType |
Methods inherited from interface ARoad0.gBaseInterface.ACSObject |
---|
getAcsName, getEorACS |
Methods inherited from interface ARoad0.gBaseInterface.BaseObject |
---|
getFullName, getName, getNickName |
Methods inherited from interface ARoad0.gBaseInterface.BaseBeanManager |
---|
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
---|
private static final long serialVersionUID__
protected transient ImmutableActor[] l_bridgeSources_
protected ImmutableGroupID currentGroupID_
protected transient ImmutableActor bridgeTarget_
protected ImmutableUserID currentUserID_
protected ImmutableGroupID[] l_SecondaryGroup_
protected java.util.SortedMap<ImmutableName,ImmutableResource> m_AclEntriesResources_
protected boolean isRightProxy_
public static final ActorImpl EMPTY_INSTANCE
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
public ActorImpl()
public ActorImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType, ImmutableActor _bridgeTarget) throws CreateError
_name
- of the actor as a resource._acs
- main ACS of the actor._parent
- of the actor._owner
- owns the resource; may be null._resourceType
- is also the EP type, and may be null if the ACS allows it._bridgeTarget
- another-ACS Actor for which this instance is a bridge source;
may be null.
CreateError:
- this(_name, _acs, _parent, _actor_name, _bridgeRef, false)
CreateError
public ActorImpl(ImmutableName _name, ACS _acs, Directory _parent, UserID _owner, java.lang.String _resourceType, ImmutableActor _bridgeTarget, boolean _toRegisterInManager) throws CreateError
_name
- of the actor as a resource._acs
- main ACS of the actor._parent
- of the actor._owner
- owns the resource and is the current UserID; may be null._resourceType
- is also the EP type, and may be null if the ACS allows it._bridgeTarget
- another-ACS Actor for which this instance is a bridge source;
may be null._toRegisterInManager
- false if this method must not register
the instance in its ACS.
CreateError:
- see super(_name, _acs, _parent) exception,
if _name is already known in ACSCatalog as an EligibleParty, or if the
bridge target belongs to another ACS, if an owner is mandatory.
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 created 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 EligibleParty
copyWithoutInternalAcl
in interface Resource
copyWithoutInternalAcl
in class ResourceImpl
_name
- copy name. Usually created 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 void setEorCurrentUserIDForUser(ImmutableUserID _u) throws UpDateError
setEorCurrentUserIDForUser
in interface Actor
_u
- current userID of the actor. May be null.
UpDateError
- if the resource type starts with 'byAcsCreator' or 'immutable',
or from setEorCurrentUserID().protected void setEorCurrentUserID(ImmutableUserID _u) throws UpDateError
_u
- current userID of the actor. May be null.
UpDateError
- if the ACS type policy
forbids a current account for this type of actor.public ImmutableUserID getEorCurrentUserID()
getEorCurrentUserID
in interface ImmutableActor
public void setEorCurrentGroupIDForUser(ImmutableGroupID _g) throws UpDateError
setEorCurrentGroupIDForUser
in interface Actor
_g
- the current groupID of the actor. May be null.
UpDateError
- if the resource type starts with 'byAcsCreator' or 'immutable',
or from setEorCurrentGroupID()protected void setEorCurrentGroupID(ImmutableGroupID _g) throws UpDateError
_g
- the current groupID of the actor. May be null.
UpDateError
- if the current groupID is immutable, or the ACS type policy
forbids a current account for this type of actor.public ImmutableGroupID getEorCurrentGroupID()
getEorCurrentGroupID
in interface ImmutableActor
public void setEorL_SecondaryGroupForUser(ImmutableGroupID[] _L) throws UpDateError
setEorL_SecondaryGroupForUser
in interface Actor
_L
- array of the secondary groupID attached to this actor. May be null.
UpDateError
- if the secondary groupIDs are immutable.protected void setEorL_SecondaryGroup(ImmutableGroupID[] _L) throws UpDateError
_L
- array of the secondary groupID attached to this actor. May be null.
UpDateError
- if the secondary groupIDs are immutable.public ImmutableGroupID[] getEorL_SecondaryGroup()
getEorL_SecondaryGroup
in interface ImmutableActor
public boolean isMemberToSecondaryGroup(ImmutableGroupID _grp)
isMemberToSecondaryGroup
in interface ImmutableActor
public final java.util.List<ImmutableResource> getEorL_AclConnectedResources()
getEorL_AclConnectedResources
in interface ImmutableEligibleParty
public void setEPType(java.lang.String _st) throws UpDateError
setEPType
in interface EligibleParty
_st
- type of the resource.
UpDateError
- if the type is null, equal to <byAcsCreator>,
or not known by the ACS, or not associated to the previous type.public java.lang.String getEPType()
getEPType
in interface ImmutableEligibleParty
public final ImmutableActor[] getEorL_bridgeSources()
getEorL_bridgeSources
in interface ImmutableActor
public boolean getIsACSBridgeSource()
getIsACSBridgeSource
in interface ImmutableActor
public final ImmutableActor getEorACSBridgeTarget()
getEorACSBridgeTarget
in interface ImmutableActor
public final boolean getIsRightProxy()
getIsRightProxy
in interface ImmutableActor
public void setIsRightProxy(boolean _b) throws UpDateError
setIsRightProxy
in interface Actor
_b
- true if this Actor may be a proxy in the access paths, that is,
as rights user, it gets some rights to the other
rights users which have an 'execute' right on it
UpDateError
- if the right proxy flag is immutable.public void addEorPrivilegeForTypeToSource(PrivilegeForType _priv) throws BaseError
addEorPrivilegeForTypeToSource
in interface PrivilegeSource
_priv
- is a Privilege to register in the source
BaseError
- if the ACS does not manage the privileges,
or if this instance is not a privilege source.protected void addEorPrivilegeForLinksToSource(PrivilegeForLinks _priv) throws BaseError
_priv
- is a Privilege to register in the source
BaseError
- if the ACS does not manage the privileges,
if the type sets the instance as immutable,
this instance is not a privilege source, or: for all linked privileges:
- if the number of sources will be superior to 4, or
- the source is null, empty, or its name is null, or
- the source name is already known by this instance. for LINKED_FOR_ONE_TO_ONE privileges, if:
- there is already a source, or
- the parameter is not a GroupID
and, for all PrivilegeForLinks excepted for LINKED_FOR_ONE_TO_ONE privileges: - the source belongs to another acs than the privilege acs
public void removeEorPrivilegeToSource(Privilege _priv) throws BaseError
removeEorPrivilegeToSource
in interface PrivilegeSource
_priv
- to unregister
BaseError
- if the privilege and this source do not known each other,
if the type sets the instance as immutable.
User-displayable message.public java.util.List getEorL_SourcePrivileges()
getEorL_SourcePrivileges
in interface ImmutablePrivilegeSource
public java.util.List getEorL_SourcePrivilegeForTypes()
getEorL_SourcePrivilegeForTypes
in interface ImmutablePrivilegeSource
public java.util.List getEorL_SourcePrivilegeForLinks()
getEorL_SourcePrivilegeForLinks
in interface ImmutablePrivilegeSource
public void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BaseBeanManager
addPropertyChangeListener
in interface BoundBean
addPropertyChangeListener
in class ResourceImpl
_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.lang.String _propertyName, java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BaseBeanManager
removePropertyChangeListener
in interface BoundBean
removePropertyChangeListener
in class ResourceImpl
_propertyName
- String is the 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 finalizeForBase() throws UpDateError
finalizeForBase
in interface FinalizedObject
finalizeForBase
in class ResourceImpl
UpDateError
- if the eligible party is unknown by the main ACS
(if it is a clone, typically), if the ACS of an aclEntry is closed or unknown,
or if the bridge relation, if any, cannot be broken, or if the type of
an associated object fires an exception.public long getSerialVersionUID()
BasicImpl
getSerialVersionUID
in interface ImmutableBasic
getSerialVersionUID
in class ResourceImpl
public java.lang.Object clone()
clone
in class ResourceImpl
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object _obj)
equals
in interface BaseObject
equals
in class ResourceImpl
_obj
-
public int hashCode()
hashCode
in interface BaseObject
hashCode
in class ResourceImpl
public void setEorACSBridgeTarget(Actor _target) throws CreateError
setEorACSBridgeTarget
in interface Actor
_target
- the bridge target. May be null.
CreateError
- if the target belongs to the same ACS, or if the
target changing is not validated by the connected objects.protected void setEorACSBridgeTarget(Actor _target, BaseObject _caller) throws CreateError
_target
- is the bridge target. May be null._caller
- is the object which calls this method. Used to avoid
a loop with ACSImpl.removeOwnActorBridgeTargetFromSource(). Null
when called from setEorACSBridgeTarget(ImmutableActor).
CreateError
- if the target belongs to the same ACS, or if the
target changing is not validated by the connected objects.protected void addBridgeSource(Actor _act)
_act
- is a bridge source for this actor as target.protected void removeBridgeSource(Actor _act)
_act
- is a bridge source for this actor as target.protected void setEorL_bridgeSources(ImmutableActor[] _L)
_L
- ImmutableActor[] external actors for which this actor is a bridge target.
May be empty or null.protected void finalizeFromDeserialization()
finalizeFromDeserialization
in class ResourceImpl
protected ActorImpl copyOwnVariables(ActorImpl _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
CreateError
protected final void addAclEntryToEP(AclEntry _acl)
_acl
- to this EP.
The resource connected to _acl must have a name following the pattern
IS_name / ACS_name / resource_name, to allow the unicity
of the name. The ACS of the aclEntry may be different to the ACS
of the eligible party.protected final void removeAclEntryToEP(AclEntry _acl)
_acl
- to removeprotected void removeEorCurrentUserID()
protected void removeEorCurrentGroupID()
protected void removeSecondaryGroup(ImmutableGroupID _grp)
_grp
- secondary groupID attached to this actor. May be null.protected boolean getAuthorizeCurrentGroupID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |