ARoad0.gBase
Class ActorImpl

java.lang.Object
  extended by ARoad0.gBase.BasicImpl
      extended by ARoad0.gBase.ResourceImpl
          extended by ARoad0.gBase.ActorImpl
All Implemented Interfaces:
ACSObject, Actor, BaseBeanManager, BaseObject, Basic, BoundBean, Copyable, EligibleParty, FinalizedObject, FinalizedObjectForUser, ImmutableActor, ImmutableBasic, ImmutableEligibleParty, ImmutableLeaf, ImmutablePrivilegeSource, ImmutablePrivilegeTarget, ImmutableResource, ImmutableSource, ImmutableTarget, Leaf, PrivilegeSource, PrivilegeTarget, PrivilegeUser, Resource, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
ActorMySQLImpl, ActorUbuntuImpl

public class ActorImpl
extends ResourceImpl
implements Actor, java.io.Serializable

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.

See Also:
Serialized Form

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 ARoad0.gBase.ResourceImpl
addAclEntry, addAcsController, addEorPrivilegeForLinksToTarget, addEorPrivilegeForTypeToTarget, compareTo, containsAclEntryToEP, copyOwnAcl, copyOwnVariables, fireL_inheritedGroupRights, fireL_inheritedOwnerRights, getActorActivated, getAGOAccessFromTheParentAccount, getAGOAccessFromTheParentGroup, getEorGroupID, getEorImmutableL_TargetInheritedAclEntries, getEorImmutableL_TargetInheritedLinkedPrivileges, getEorL_EPthroughAclEntry, getEorL_TargetInheritedAclEntries, getEorL_TargetInheritedLinkedPrivileges, getEorL_TargetPrivilegeForLinks, getEorL_TargetPrivilegeForTypes, getEorL_TargetPrivileges, getEorParent, getEorUserID, getL_aclEntry, getL_AcsControllers, getL_groupRights, getL_inheritedGroupRights, getL_inheritedOwnerRights, getL_ownerRights, getL_rootRights, getM_TargetInheritedACLRights, getM_TargetInheritedLinkedPRIRights, getResourceType, hasTheAccountAndGroupOfParent, removeACL, removeAclEntry, removeAcsController, removeEorGroupID, removeEorPrivilegeToTarget, removeEorUserID, resetInheritedAclEntryRights, resetInheritedPrivilegeRights, selectInheritedAclEntry, selectInheritedPrivilege, setAGOAccessFromTheParentAccount, setAGOAccessFromTheParentGroup, setEorGroupID, setEorParent, setEorUserID, setL_groupRights, setL_ownerRights, setL_rootRights, setResourceType, toString
 
Methods inherited from class ARoad0.gBase.BasicImpl
addAcsOfSoftReferences, addConstrainedChildACS, addEorSoftAlias, addInVFolderList, addInViewList, addPropertyChangeListener, copyOwnVariables, finalize, finalizeForUser, firePropertyChange, getAcsName, getComment, getEorACS, getEorAliasAsInternalHardReference, getEorReferenceAsInternalHardAlias, getFullName, getHasSoftAlias, getImpliedViews, getIS_Name, getL_AcsOfSoftReferences, getL_SoftAlias, getM_ConstrainedChildACS, getName, getNickName, getType, getVirtualFolders, removeAcsOfSoftReferences, removeConstrainedChildACS, removeEorSoftAlias, removeInVFolderList, removeInViewList, removePropertyChangeListener, setComment, setEorAliasAsInternalHardReference, setEorReferenceAsInternalHardAlias, setType
 
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.ImmutableResource
containsAclEntryToEP, getActorActivated, getAGOAccessFromTheParentAccount, getAGOAccessFromTheParentGroup, getEorGroupID, getEorImmutableL_TargetInheritedAclEntries, getEorL_EPthroughAclEntry, getEorUserID, getL_aclEntry, getL_AcsControllers, getL_groupRights, getL_inheritedGroupRights, getL_inheritedOwnerRights, getL_ownerRights, getL_rootRights, getM_ConstrainedChildACS, getM_TargetInheritedACLRights, getResourceType, hasTheAccountAndGroupOfParent, selectInheritedAclEntry
 
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

serialVersionUID__

private static final long serialVersionUID__
See Also:
Constant Field Values

l_bridgeSources_

protected transient ImmutableActor[] l_bridgeSources_

currentGroupID_

protected ImmutableGroupID currentGroupID_

bridgeTarget_

protected transient ImmutableActor bridgeTarget_

currentUserID_

protected ImmutableUserID currentUserID_
with this initial value, currentUserID_ is returned as null in the get method. currentUserID_ is set to null only in finalizeForBase(), which detects a second call through the test of this variable.


l_SecondaryGroup_

protected ImmutableGroupID[] l_SecondaryGroup_

m_AclEntriesResources_

protected java.util.SortedMap<ImmutableName,ImmutableResource> m_AclEntriesResources_
Map


isRightProxy_

protected boolean isRightProxy_

EMPTY_INSTANCE

public static final ActorImpl 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

ActorImpl

public ActorImpl()
Default constructor.


ActorImpl

public ActorImpl(ImmutableName _name,
                 ACS _acs,
                 Directory _parent,
                 UserID _owner,
                 java.lang.String _resourceType,
                 ImmutableActor _bridgeTarget)
          throws CreateError
Registers the new instance in the eligible parties map in the main ACS. Used for the creation of an instance through the GUI: used by the beamer editors for the ACS resources list and for the ACS EP list, from 'New'. The actor name _and_ the resource name are structured. _bridgeRef must belong to another ACS than this instance ACS. Note: this is added to the main ACS as a resource, in super().

Parameters:
_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.
Throws:
CreateError: - this(_name, _acs, _parent, _actor_name, _bridgeRef, false)
CreateError

ActorImpl

public ActorImpl(ImmutableName _name,
                 ACS _acs,
                 Directory _parent,
                 UserID _owner,
                 java.lang.String _resourceType,
                 ImmutableActor _bridgeTarget,
                 boolean _toRegisterInManager)
          throws CreateError
Used for the creation of an actor. May register the new instance in the EligibleParties map in the main ACS. Sets the owner as the current UserID. The ACS type-oriented policy is used for the key 'Actor.NoNullCurrentAccount' to verify that this type of actor can have no owner. Sets the current group if the parent UserID has a primary group. Note: this is added to the main ACS as a resource, in the super class constructor. The actor name _and_ the resource name are structured. _bridgeTarget must belong to another ACS than this instance ACS. Used by copy().

Parameters:
_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.
Throws:
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

copy

public java.lang.Object copy(ImmutableName _name,
                             ACS _acs,
                             Directory _parent,
                             java.lang.Boolean _toRegisterInManager)
                      throws CreateError
This method provides a copy of the instance with another name, following Copyable. Each internal variable that is an external object reference have a shallow copy (no deep copy). Each aclEntry is copied, but not the list of ViewInBase that contains this instance. The bridge target is copied if this instance is a bridge source. Caution: do not copy the user and the group if _result does not belong to aCS_ and if there are no user or group in the _result ACS which have similar names - that is that are ended by the same Strings in this instance user or group names. Calls copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copy in interface Copyable
Overrides:
copy in class ResourceImpl
Parameters:
_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.
Returns:
a new instance of ActorImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs, or addAclEntry() exceptions.

copyWithoutInternalAcl

public java.lang.Object copyWithoutInternalAcl(ImmutableName _name,
                                               ACS _acs,
                                               Directory _parent,
                                               java.lang.Boolean _toRegisterInManager)
                                        throws CreateError
This method provides a copy of the instance as copy() but without copying internal aclEntries. Each internal variable that is an external object reference have a shallow copy (no deep copy). Each aclEntry is copied, but not the list of ViewInBase that contains this instance. The bridge target is copied if this instance is a bridge source. Caution: does not copy the user and the group if _result does not belong to aCS_ and if there are no user or group in the _result ACS which have similar names - that is that are ended by the same Strings in this instance user or group names. Caution: does not copy the bridge sources, if they exists. Calls copyOwnVariables(). This method is overridden by the subclasses.

Specified by:
copyWithoutInternalAcl in interface EligibleParty
Specified by:
copyWithoutInternalAcl in interface Resource
Overrides:
copyWithoutInternalAcl in class ResourceImpl
Parameters:
_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.
Returns:
a new instance of ActorImpl
Throws:
CreateError - of the constructor with the same parameters, or if _parent ACS is not _acs, or addAclEntry() exceptions.

setEorCurrentUserIDForUser

public void setEorCurrentUserIDForUser(ImmutableUserID _u)
                                throws UpDateError
The current userID is not null when, typically, the actor is an executable launched under an userID. Called by the GUI. Calls setEorCurrentUserID().

Specified by:
setEorCurrentUserIDForUser in interface Actor
Parameters:
_u - current userID of the actor. May be null.
Throws:
UpDateError - if the resource type starts with 'byAcsCreator' or 'immutable', or from setEorCurrentUserID().

setEorCurrentUserID

protected void setEorCurrentUserID(ImmutableUserID _u)
                            throws UpDateError
The current userID is not null when, typically, the actor is an executable launched under an userID. This class does not override setEorUserID() since Resource.userID is an access target property, and Actor.currentUserID is a rights user property. Noop if the resource type starts with 'byAcsCreator' or 'immutable', typically when it is launched by the system at its starting. The ACS type-oriented policy is used for the key 'Actor.NoCurrentAccount' to verify that this type of actor can have a current account. Called by the constructor. If it is applicable, calls setEorCurrentGroupID() to set the _u primary group as the current group, and setEorL_SecondaryGroup() to add as secondary groups all the groups having the argument as member. Calls UserID.add/removeCurrentActor() and getAuthorizeCurrentGroupID() that uses the Resource type, setEorCurrentGroupID(), setEorL_SecondaryGroup(). Fires an 'CurrentUserID' event.

Parameters:
_u - current userID of the actor. May be null.
Throws:
UpDateError - if the ACS type policy forbids a current account for this type of actor.

getEorCurrentUserID

public ImmutableUserID getEorCurrentUserID()
If this property has not been set, it is null. When an executable is launched from a userID, its current userID often becames this userID.

Specified by:
getEorCurrentUserID in interface ImmutableActor
Returns:
the current userID. May be null.

setEorCurrentGroupIDForUser

public void setEorCurrentGroupIDForUser(ImmutableGroupID _g)
                                 throws UpDateError
Set the group for which this actor is member as right user. The current groupID is not null when, typically, the actor is a program which is launched under an another groupID. This class does not overread setEorGroupID() since the Resource groupID may be different, for instance when the ACL rights authorizes the launching. Resource.groupID is an access target property, and Actor.currentGroupID is a rights user property. Calls GroupID.add/removeCurrentActor(this). Reads the ACS 'Actor.NoCurrentGroup' values to check if the argument may be a current group. The ACS type-oriented policy is used for the key 'Actor.NoCurrentGroup' to verify that this type of actor can have a current group. Overridden by the AcsAddon Ubuntu Actor and Executable classes. Called by the GUI. Calls setEorCurrentGroupID().

Specified by:
setEorCurrentGroupIDForUser in interface Actor
Parameters:
_g - the current groupID of the actor. May be null.
Throws:
UpDateError - if the resource type starts with 'byAcsCreator' or 'immutable', or from setEorCurrentGroupID()

setEorCurrentGroupID

protected void setEorCurrentGroupID(ImmutableGroupID _g)
                             throws UpDateError
Set the group for which this actor is member as right user. The current groupID is not null when, typically, the actor is a program which is launched under an another groupID. This class does not overread setEorGroupID() since the Resource groupID may be different, for instance when the ACL rights authorizes the launching. Resource.groupID is an access target property, and Actor.currentGroupID is a rights user property. Calls GroupID.add/removeCurrentActor(this). Reads the ACS 'Actor.NoCurrentGroup' values to check if the argument may be a current group. The ACS type-oriented policy is used for the key 'Actor.NoCurrentGroup' to verify that this type of actor can have a current group. Called by setEorCurrentUserID() and setEorCurrentGroupIDForUser(). Fires an 'CurrentGroupID' event.

Parameters:
_g - the current groupID of the actor. May be null.
Throws:
UpDateError - if the current groupID is immutable, or the ACS type policy forbids a current account for this type of actor.

getEorCurrentGroupID

public ImmutableGroupID getEorCurrentGroupID()
Get the group for which this actor is member as right user.

Specified by:
getEorCurrentGroupID in interface ImmutableActor
Returns:
ImmutableGroupID used currently by the actor, that may be changed by itself, and it is different to the actor groupID attached to any resource. For instance, when an executable is launched from a groupID, its current groupID often becames the launcher groupID. May be null.

setEorL_SecondaryGroupForUser

public void setEorL_SecondaryGroupForUser(ImmutableGroupID[] _L)
                                   throws UpDateError
A secondary group is used by an Actor as rights user, to get complementary accesses to targets only when a current userID is set. Noop if the resource type starts with 'byAcsCreator' or 'immutable'. Calls setEorL_SecondaryGroup().

Specified by:
setEorL_SecondaryGroupForUser in interface Actor
Parameters:
_L - array of the secondary groupID attached to this actor. May be null.
Throws:
UpDateError - if the secondary groupIDs are immutable.

setEorL_SecondaryGroup

protected void setEorL_SecondaryGroup(ImmutableGroupID[] _L)
                               throws UpDateError
A secondary group is used by an Actor as rights user, to get complementary accesses to targets only when a current userID is set. When the actor is accessed as any target, the current userID of the rights user is activated with its secondary groups, and the secondary groups returned by this method are not activated. Unregisters the previous groupIDs and set the new ones. Removes in the argument, the current group or GroupIDImpl.EMPTY_INSTANCE. Reads the ACS 'GroupID.NoSecondaryGroup' values to check if each argument may be a secondary group. Called by setEorL_SecondaryGroupForUser() and setEorCurrentUserID(). Calls GroupID.add/removeOwnActor(). Fire an event 'SecondaryGroups'.

Parameters:
_L - array of the secondary groupID attached to this actor. May be null.
Throws:
UpDateError - if the secondary groupIDs are immutable.

getEorL_SecondaryGroup

public ImmutableGroupID[] getEorL_SecondaryGroup()
A secondary GroupID adds new access to the actor as rights user. A secondary GroupID is independant to the GroupID of the actor as resource, but this primary group may be also a seocndary group.

Specified by:
getEorL_SecondaryGroup in interface ImmutableActor
Returns:
secondary GroupIDs under which this actor runs a rights user. May be empty, but not null.

isMemberToSecondaryGroup

public boolean isMemberToSecondaryGroup(ImmutableGroupID _grp)
Specified by:
isMemberToSecondaryGroup in interface ImmutableActor
Returns:
true if _grp is a secondary groupID which have this actor as membership.

getEorL_AclConnectedResources

public final java.util.List<ImmutableResource> getEorL_AclConnectedResources()
Gets the resources connected to this eligible party. The resources may belong to differents ACS, as the aclEntries. One resource may have differents AclEntries (of different ACS) which connect it to this eligible party. Then, the returned list contains only one reference to this resource.

Specified by:
getEorL_AclConnectedResources in interface ImmutableEligibleParty
Returns:
the unmodifiable list of references on resources. May be Collections.EMPTY_LIST, but not null.

setEPType

public void setEPType(java.lang.String _st)
               throws UpDateError
If _st is allowed by the ACS, set the type of this EligibleParty which is also a resource. This method is used to switch from an immutable type which forbids the updates of a protected property, and to return to this protecting type. Then, it is possible to switch for example from 'actor' to 'immutable actor', but not to 'immutable group'. From the default value 'undefined', any first update may be done. Calls super.setResourceType(). Fires the events 'ResourceType' and 'EPType'.

Specified by:
setEPType in interface EligibleParty
Parameters:
_st - type of the resource.
Throws:
UpDateError - if the type is null, equal to <byAcsCreator>, or not known by the ACS, or not associated to the previous type.

getEPType

public java.lang.String getEPType()
As an EligibleParty, but it is simply the Basic type.

Specified by:
getEPType in interface ImmutableEligibleParty
Returns:
type of the eligible party. May be null.

getEorL_bridgeSources

public final ImmutableActor[] getEorL_bridgeSources()
A bridge is an unidirectionnal connexion between two ACS through the mean of two actors, one in each ACS.

Specified by:
getEorL_bridgeSources in interface ImmutableActor
Returns:
ImmutableActor[] external actors for which this actor is a bridge target. May be empty, but not null.

getIsACSBridgeSource

public boolean getIsACSBridgeSource()
Specified by:
getIsACSBridgeSource in interface ImmutableActor
Returns:
true if this actor is a bridge source, created through a specific constructor, and updated when the external actor is closed or deleted.

getEorACSBridgeTarget

public final ImmutableActor getEorACSBridgeTarget()
Get the another-ACS actor for which this resource is a bridge source.

Specified by:
getEorACSBridgeTarget in interface ImmutableActor
Returns:
a reference on the actor. Is null if this instance is not a bridge, if the target ACS is not opened.

getIsRightProxy

public final boolean getIsRightProxy()
The default value is true.

Specified by:
getIsRightProxy in interface ImmutableActor
Returns:
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

setIsRightProxy

public void setIsRightProxy(boolean _b)
                     throws UpDateError
Noop if the resource type contains 'byAcsCreator' or 'immutable'. Calls ACSImpl.removeNoRightProxyActor(). Overridden by the AcsAddon Ubuntu, that calls it. Fires an event 'isRightProxy'.

Specified by:
setIsRightProxy in interface Actor
Parameters:
_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
Throws:
UpDateError - if the right proxy flag is immutable.

addEorPrivilegeForTypeToSource

public void addEorPrivilegeForTypeToSource(PrivilegeForType _priv)
                                    throws BaseError
Sets a privilege as applicable to this access source, and this is called only by the program. The gBase classes are the only caller of this method at any creation/deletion of a typed privilege or an access source. Fires 'OneSourceTypedPrivilege' events.

Specified by:
addEorPrivilegeForTypeToSource in interface PrivilegeSource
Parameters:
_priv - is a Privilege to register in the source
Throws:
BaseError - if the ACS does not manage the privileges, or if this instance is not a privilege source.

addEorPrivilegeForLinksToSource

protected void addEorPrivilegeForLinksToSource(PrivilegeForLinks _priv)
                                        throws BaseError
Sets a privilege as applicable to this access source. Called by PrivilegeForLinksImpl.addEorPrivilegeSourceLink(). If the source is also a source container, the privilege is used by the children of the target if the target is a GroupIDMember (as any right), or, if it is a DirectoryEP, it may be used by the children if its ACS policy specifies it. Fires 'OneSourceLinkedPrivilege' events.

Parameters:
_priv - is a Privilege to register in the source
Throws:
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


removeEorPrivilegeToSource

public void removeEorPrivilegeToSource(Privilege _priv)
                                throws BaseError
Unregisters the privilege, and this instance in the linked privilege when it is no more used by this privilege source. Fires 'OneSourcePrivilege' event.

Specified by:
removeEorPrivilegeToSource in interface PrivilegeSource
Parameters:
_priv - to unregister
Throws:
BaseError - if the privilege and this source do not known each other, if the type sets the instance as immutable. User-displayable message.

getEorL_SourcePrivileges

public 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, for which the ACSObject and the privilege has a common type (and a common class if it is a bindedClasses privilege)

Specified by:
getEorL_SourcePrivileges in interface ImmutablePrivilegeSource
Returns:
List of Privileges. May be empty, but never null.

getEorL_SourcePrivilegeForTypes

public java.util.List getEorL_SourcePrivilegeForTypes()
Gets all the PrivilegeForTypes linked to this source.

Specified by:
getEorL_SourcePrivilegeForTypes in interface ImmutablePrivilegeSource
Returns:
List of PrivilegeForType. May be empty, but never null.

getEorL_SourcePrivilegeForLinks

public 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.

Specified by:
getEorL_SourcePrivilegeForLinks in interface ImmutablePrivilegeSource
Returns:
List of PrivilegeForLinks. May be empty, but never null.

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String _propertyName,
                                      java.beans.PropertyChangeListener _l)
Adds a listener to the bean. Used by Gui1.CommonPropertyEditor for the properties: 'SecondaryGroups', 'l_bridgeSources', 'CurrentGroupID', 'CurrentUserID', 'ACSBridgeTarget', 'EPType', 'IsRightProxy', 'ActorAlias', 'AclConnectedResources', 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege'. Overrides the super method and calls it.

Specified by:
addPropertyChangeListener in interface BaseBeanManager
Specified by:
addPropertyChangeListener in interface BoundBean
Overrides:
addPropertyChangeListener in class ResourceImpl
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

public void removePropertyChangeListener(java.lang.String _propertyName,
                                         java.beans.PropertyChangeListener _l)
Removes a listener to the bean. Used by Gui1.CommonPropertyEditor for the properties: 'SecondaryGroups', 'l_bridgeSources', 'CurrentGroupID', 'CurrentUserID', 'ACSBridgeTarget', 'EPType', 'IsRightProxy', 'ActorAlias', 'AclConnectedResources', 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege'. Note: using this method does not remove a listener which has been registered through addPropertyChangeListener(PropertyChangeListener _l). Overrides the super method and calls it.

Specified by:
removePropertyChangeListener in interface BaseBeanManager
Specified by:
removePropertyChangeListener in interface BoundBean
Overrides:
removePropertyChangeListener in class ResourceImpl
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.

Specified by:
getPropertyChangeListeners in interface ImmutableBasic
Overrides:
getPropertyChangeListeners in class ResourceImpl
Parameters:
_propertyName - name of the listened property.
Returns:
the change listeners. May be null or empty.

finalizeForBase

public void finalizeForBase()
                     throws UpDateError
This method removes the actor in the eligible party ACS list, and in the resources connected through an aclEntry. An unused object has to be deleted to inform the others objects, and this method HAS TO BE USED before deleting the actor. Note: when this method is called by the ResourceImpl constructor, the proper variables of this class are not still initialized.

Specified by:
finalizeForBase in interface FinalizedObject
Overrides:
finalizeForBase in class ResourceImpl
Throws:
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.

getSerialVersionUID

public long getSerialVersionUID()
Description copied from class: BasicImpl
For the java serialization.

Specified by:
getSerialVersionUID in interface ImmutableBasic
Overrides:
getSerialVersionUID in class ResourceImpl
Returns:
the static serialVersionUID__ of this Actor class

clone

public java.lang.Object clone()
Returns a deep copy without registering of the new object in the ACSs. Caution: if the instance is a bridge target, this relation is not cloned since there is no information on the source. But if it is a bridge source, its target is cloned.

Overrides:
clone in class ResourceImpl
Returns:
Object is not registred in the ACSs. The names, the aclEntries, the Linux/Unix rights, the ACS controller names, the type, the bridge target are cloned. The external object references are not cloned (see "Eor" in get method).
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object _obj)
Tests all the internal Actor properties, and all the superclasses properties.

Specified by:
equals in interface BaseObject
Overrides:
equals in class ResourceImpl
Parameters:
_obj -
Returns:
true if _obj is an instance of ActorImpl (or an inherited class) equals to this instance

hashCode

public int hashCode()
Specified by:
hashCode in interface BaseObject
Overrides:
hashCode in class ResourceImpl
Returns:
the hashcode value for this object

setEorACSBridgeTarget

public void setEorACSBridgeTarget(Actor _target)
                           throws CreateError
Sets the another-ACS actor for which this instance is a bridge source. Fires a 'ACSBridgeTarget' event.

Specified by:
setEorACSBridgeTarget in interface Actor
Parameters:
_target - the bridge target. May be null.
Throws:
CreateError - if the target belongs to the same ACS, or if the target changing is not validated by the connected objects.

setEorACSBridgeTarget

protected void setEorACSBridgeTarget(Actor _target,
                                     BaseObject _caller)
                              throws CreateError
Sets the another-ACS actor for which this resource is a bridge source. Updates the bridge target and the two ACS. Fires a 'ACSBridgeTarget' event after the ACS relevant events. Does not check the resource type to allow the updating. Called by the constructor, by ACSImpl.closeBridges(), checkClosedBridges(), removeOwnActorBridgeTargetFromSource() and setEorACSBridgeTarget(ImmutableActor), and by finalizeForBase(). Calls add/removeBridgeSource().

Parameters:
_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).
Throws:
CreateError - if the target belongs to the same ACS, or if the target changing is not validated by the connected objects.

addBridgeSource

protected void addBridgeSource(Actor _act)
Adds an actor as source to this instance which is then a bridge target for this source. Invoked by Actor.setEorACSBridgeTarget(). Fires an event on "l_bridgeSources".

Parameters:
_act - is a bridge source for this actor as target.

removeBridgeSource

protected void removeBridgeSource(Actor _act)
Remove an actor as bridge source for this instance. Invoked by Actor.setEorACSBridgeTarget(). Fire an event on "l_bridgeSources".

Parameters:
_act - is a bridge source for this actor as target.

setEorL_bridgeSources

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. Called by copyOwnVariables(). Fire an event 'l_bridgeSources'.

Parameters:
_L - ImmutableActor[] external actors for which this actor is a bridge target. May be empty or null.

finalizeFromDeserialization

protected void finalizeFromDeserialization()
This method finalizes all the attributes, since it is used after a deserialization. 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. Called by EPRViewInBaseImpl only.

Overrides:
finalizeFromDeserialization in class ResourceImpl

copyOwnVariables

protected ActorImpl copyOwnVariables(ActorImpl _result,
                                     boolean _withoutInternalAcl)
                              throws CreateError
This method provides a copy of the instance variables. Copy the aclEntries. Caution: copies the current user and group, and the secondary groups, if it is the same ACS, or else in every UserID and GroupID copy which is found. In this second case, the user or group name must be made of the acs name ended by the user or group string name. Caution: does not copy the bridge sources, if they exist, nor the actor alias. Uses the super overridden method with one argument. Called by copy() and by the copyOwnVariables() methods of the subclasses.

Parameters:
_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
Returns:
updated _result
Throws:
CreateError

addAclEntryToEP

protected final void addAclEntryToEP(AclEntry _acl)
Adds an aclEntry to this instance as an EligibleParty, not as a Resource. Called by the ResourceImpl.addAclEntry(). There, the AclEntry ACS knowns the AclEntry. CAUTION: any update of this method must be also done in EligiblePartyImpl.

Parameters:
_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.

removeAclEntryToEP

protected final 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. This condition is handled by the calling method. Called from AclEntryImpl.finalizeForUser(). The related resource is unrecorded in L_AclConnectedResources since _acl is the last one connected to this resource. CAUTION: any update of this method must be also done in EligiblePartyImpl, and any other EligibleParty direct implementation.

Parameters:
_acl - to remove

removeEorCurrentUserID

protected void removeEorCurrentUserID()
Remove the current userID of the resource. To use only when the userID is finalizing. In the other cases, use setEorCurrentUserID(). The main differences with setEorCurrentUserID() are that removeCurrentActor(this) is not invoked in this method, and there is no checking of the resource type. Called by UserID.finalizeForBase().


removeEorCurrentGroupID

protected void removeEorCurrentGroupID()
Remove the current groupID of the resource. To use only when the groupID is finalizing. In the other cases, use setEorCurrentGroupID(). The main differences with setEorCurrentGroupID() are that removeCurrentActor(this) is not invoked in this method, and there is no checking of the resource type. Called by UserID.removePrimGroup().


removeSecondaryGroup

protected void removeSecondaryGroup(ImmutableGroupID _grp)
A secondary group is used by an Actor as rights user, to get complementary accesses to targets. Call GroupID.add/removeOwnActor(). Fire an event 'SecondaryGroups'. Called by GroupID.finalizeForBase(), which is not called back.

Parameters:
_grp - secondary groupID attached to this actor. May be null.

getAuthorizeCurrentGroupID

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. Called by setEorCurrentGroupID() and setEorCurrentUserID().

Returns:
true if the type-oriented ACS policy authorizes this instance to have a current GroupID, or if the type is null.