|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.BasicImpl
ARoad0.gBase.EligiblePartyImpl
public class EligiblePartyImpl
This class is responsible for modeling the simplest rights user for which an ACS grants access or denies access to some targets through AclEntries or Privileges. This kind of entity may be an account (UserID), a group (GroupID) or an actor (Actor). This class manages the resources connected to the EligibleParty through AclEntries, and it manages its Privileges. The constructor adds '<U>' or '<G>' after the ACS name, in the name components, if the new instance is an UserID or a GroupID, which are subclasses of this class. It is a javabean with the following bound properties: 'AclConnectedResources', 'OneSourceTypedPrivilege', 'OneSourceLinkedPrivilege'. The listeners are proper to this instance, outside gBase, transient (not serialized in this instance backup). They include ViewInBaseImpl, gWork.RightsMediatorImpl. 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. finalizeForUser() uses the ARoad0.Gui1.DialogBox class.
This class has several subclasses in this package and in the AcsAddon packages. Most of the variables are protected.
Field Summary | |
---|---|
static EligiblePartyImpl |
EMPTY_INSTANCE
A reusable empty instance for initialization, to avoid the use of 'new' for temporary values. |
protected java.util.SortedMap<ImmutableName,ImmutableResource> |
m_AclEntriesResources_
map(resource name, resource). |
static java.io.ObjectStreamField[] |
serialPersistentFields
Properties for the serialization. |
private static long |
serialVersionUID__
|
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 | |
---|---|
EligiblePartyImpl()
Default constructor |
|
EligiblePartyImpl(ImmutableName _name,
ACS _acs,
java.lang.String _epType)
Constructor used in the beamer by the editor for the ACS EP list, from 'New'. |
|
EligiblePartyImpl(ImmutableName _name,
ACS _acs,
java.lang.String _epType,
boolean _toRegisterInManager)
Used for the creation of an eligible party alias without base registration. |
Method Summary | |
---|---|
protected void |
addAclEntryToEP(AclEntry _acl)
CAUTION: any change in this method code MUST also be done in ActorImpl. |
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. |
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. |
protected EligiblePartyImpl |
copyOwnVariables(EligiblePartyImpl _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. |
protected static EligibleParty |
deleteAclEntries(EligibleParty _ep)
Removes all the aclEntries. |
boolean |
equals(java.lang.Object _obj)
Does not compare the comment. |
void |
finalizeForBase()
This method removes the EligibleParty in the ACS list, and in the Resources, deletes any AclEntry having this instance as source. |
protected void |
finalizeFromDeserialization()
NO USE. |
java.util.List<ImmutableResource> |
getEorL_AclConnectedResources()
Gets the resources connected to this eligible party. |
java.util.List<PrivilegeForLinks> |
getEorL_SourcePrivilegeForLinks()
Gets all the PrivilegeForLinks linked to this source. |
java.util.List<PrivilegeForType> |
getEorL_SourcePrivilegeForTypes()
Gets all the PrivilegeForTypes of this source. |
java.util.List<Privilege> |
getEorL_SourcePrivileges()
Gets all the privileges linked to this source. |
java.lang.String |
getEPType()
|
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String _propertyName)
Returns the change listeners for a property. |
long |
getSerialVersionUID()
For the java serialization. |
int |
hashCode()
|
protected void |
removeAclEntryToEP(AclEntry _acl)
Removes the related resource of an aclEntry, if the argument is the single AclEntry for 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. |
void |
setEPType(java.lang.String _st)
Sets the type which drives the immutablility and the allowed rights of the object. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ARoad0.gBaseInterface.ImmutableEligibleParty |
---|
getM_ConstrainedChildACS |
Methods inherited from interface ARoad0.gBaseInterface.Basic |
---|
finalizeForUser, setComment |
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.BoundBean |
---|
addPropertyChangeListener, removePropertyChangeListener |
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 |
Field Detail |
---|
private static final long serialVersionUID__
protected java.util.SortedMap<ImmutableName,ImmutableResource> m_AclEntriesResources_
public static final EligiblePartyImpl EMPTY_INSTANCE
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
public EligiblePartyImpl()
public EligiblePartyImpl(ImmutableName _name, ACS _acs, java.lang.String _epType) throws CreateError
_name
- of the eligible party_acs
- main ACS of the eligible party_epType
- the eligible party type which drives the rights and the immutability
of the instance. If null, the value is set to '<undefined>'.
CreateError
- if ACSImpl.newEorEligibleParty() throws it - the instance
must then be deleted!must apply
the same UserID and GroupID naming policy
public EligiblePartyImpl(ImmutableName _name, ACS _acs, java.lang.String _epType, boolean _toRegisterInManager) throws CreateError
_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_acs
- is the ACS of the eligible party to create_epType
- is the eligible party type which drives the rights and the immutability
of the instance. If null, the value is set to '<undefined>'._toRegisterInManager
- false if this method must not register
the instance in its ACS.
CreateError
- if ACSImpl.newEorEligibleParty() or setType() throws it -
the instance must then be deleted!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 BasicImpl
_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 java.lang.Object copyWithoutInternalAcl(ImmutableName _name, ACS _acs, Directory _parent, java.lang.Boolean _toRegisterInManager) throws CreateError
copyWithoutInternalAcl
in interface EligibleParty
_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 void setEPType(java.lang.String _st) throws UpDateError
setEPType
in interface EligibleParty
_st
- type of the resource.
UpDateError
- if the type is null, or does not comply to the criteria.public java.lang.String getEPType()
getEPType
in interface ImmutableEligibleParty
public final java.util.List<ImmutableResource> getEorL_AclConnectedResources()
getEorL_AclConnectedResources
in interface ImmutableEligibleParty
public void addEorPrivilegeForTypeToSource(PrivilegeForType _priv) throws BaseError
addEorPrivilegeForTypeToSource
in interface PrivilegeSource
_priv
- is a Privilege to register in the source
BaseError
- if this instance is not a privilege source,
if the privilege second type is not authorized for this source.protected void addEorPrivilegeForLinksToSource(PrivilegeForLinks _priv) throws BaseError
_priv
- to register in the source
BaseError
- if this instance is not a privilege source or is immutable,
if the privilege second type is not authorized for this source.public void removeEorPrivilegeToSource(Privilege _priv) throws BaseError
removeEorPrivilegeToSource
in interface PrivilegeSource
_priv
- to unregister
BaseError
- if the privilege is unknown.public java.util.List<Privilege> getEorL_SourcePrivileges()
- PrivilegeForLinks: linked privilege established for a couple (ACSObject, privilege),
- PrivilegeForType: typed privilege, where the ACSObject and the privilege has a common type, but without the TYPED_FOR_SEED and TYPED_CLASSED_SPECIFIC privileges.
getEorL_SourcePrivileges
in interface ImmutablePrivilegeSource
public java.util.List<PrivilegeForType> getEorL_SourcePrivilegeForTypes()
getEorL_SourcePrivilegeForTypes
in interface ImmutablePrivilegeSource
public java.util.List<PrivilegeForLinks> 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 BasicImpl
_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 BasicImpl
_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 BasicImpl
_propertyName
- name of the listened property.
public void finalizeForBase() throws UpDateError
finalizeForBase
in interface FinalizedObject
finalizeForBase
in class BasicImpl
UpDateError
- if the eligible party is unknown
by the main ACS (if it is a clone, typically) or if the ACS of an aclEntry
is closed or unknown, or if a linked immutable object fires an exception,
or from ACSFactoryUtilityImpl.removeAssociatesAfterDeletion().public java.lang.Object clone()
clone
in class BasicImpl
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object _obj)
equals
in interface BaseObject
equals
in class BasicImpl
_obj
- object to compare
public int hashCode()
hashCode
in interface BaseObject
hashCode
in class BasicImpl
public long getSerialVersionUID()
BasicImpl
getSerialVersionUID
in interface ImmutableBasic
getSerialVersionUID
in class BasicImpl
protected EligiblePartyImpl copyOwnVariables(EligiblePartyImpl _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
- if _result is null or if Resource.addAclEntry()
throws it.protected void addAclEntryToEP(AclEntry _acl)
_acl
- appplied 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 aclEntry ACS may be different to
the eligible party ACS.protected void removeAclEntryToEP(AclEntry _acl)
_acl
- to removeprotected static final EligibleParty deleteAclEntries(EligibleParty _ep)
_ep
- is an EligibleParty
protected void finalizeFromDeserialization()
finalizeFromDeserialization
in class BasicImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |