ARoad0.CNot
Class DisplayableLinkImpl

java.lang.Object
  extended by ARoad0.CNot.DisplayableLinkImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public final class DisplayableLinkImpl
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class is responsible for modeling a displayable link that manages a path of base objects connected through AccessControlLinkImpls. Typically, it is associated to an item in a graphical view (an arrow or a line for instance) between two view objects. A displayable link manages a chain of nodes where there is one node for one base object. It manages also the access control links between nodes, defining the paths. The results in the right searching for a view are put by the gWork classes in DisplayableLinkImpl instances. They may be seen as a dynamic data base of the access paths in the open views. They are ridden both to get the effective rights and to directly generate the 'See Why' text of the view.

A displayable link may be simple - it contains then only the 2 base objects as ends and one link between them - or it may be a chain of n base objects (or nodes) with n-1 links. In this last case, the intermediate base objects are often hidden, if it is for a view. The two ends are always immutable. They can't be changed in the displayable link, but it is possible to create a new link from a previous link with the static method valueOf().

An internal list contains the chain of BaseObjects and AccessControlLinks which defines the DisplayableLink. Usually, the intermediate BaseObjects are ImmutableSources: Actors, GroupIDMembers, VirtualFolders. The possible sizes of the internal vector is 3, 5, 7... Its structure is designed to add easily a link or a node without changing of the ends. It is:

- 0: first end,

- 1: second end,

- 2: first access control link between the first end and its next node (which is the second end if the displayable link is simple),

- 3: first intermediate node if the displayable link is not simple,

- 4: second access control link between the first intermediate node and the second intermediate node, if it exists, or the second end if the path has 3 nodes.

- ...

Some general properties are defined for a DisplayableLinkImpl in a map. The first use is the 2 map keys AG_CONTEXT_NODE_POSITION and AG_CONTEXT_SET, for the Account/Groups context of the link. The AG context is a set of GroupIDMembers that may contain, first, an optional couple (UserID, GroupID), and, second, a list of optional GroupIDs. AG_CONTEXT_NODE_POSITION is the index of a node in the DislayableLinkImpl for which there is a defined Account/Groups context. The key AG_CONTEXT_SET returns a couple (UserID, GroupID) the node at AG_CONTEXT_NODE_POSITION may use as Account/Main_Group context. The key AG_CONTEXT_SET may also return complementary groups.

The links depend on the varied ACS which are implied in the view, and also may depend on some ACS not implied in the view but which control some intermediate base objects. A displayable link is not always displayed in a view. For instance, it may contain a right between two objects which is deleted by a stronger right in another displayable link containing the same objects.

See Also:
AccessControlLinkImpl, DisplayableLinkUtilities.getEffectiveRightsAndCommentOnRights(ARoad0.CNot.DisplayableLinkImpl, boolean), Serialized Form

Field Summary
static java.lang.String AG_CONTEXT_NODE_POSITION
          Key of l_properties_ where the value is the position of the node having the AG context set in AG_CONTEXT_SET.
static java.lang.String AG_CONTEXT_SET
          Key of l_properties_ where the value is the Set of (O to 1) UserId and (0 to N) GroupIDs that defines the Account/Groups context of the node given by the key AG_CONTEXT_NODE_POSITION.
protected static int INITIAL_CAPACITY
           
protected  java.util.Map<java.lang.String,java.lang.Object> m_properties_
          This map describes the general properties of the DisplayableLinkImpl.
private static int PRIME
           
static java.io.ObjectStreamField[] serialPersistentFields
          standardized variable for the JDK 2 serialization
private static long serialVersionUID__
           
protected  java.util.ArrayList vector_
          This list contains the chain of BaseObjects and AccessControlLinks which defines the DisplayableLink.
 
Constructor Summary
DisplayableLinkImpl()
           
DisplayableLinkImpl(java.util.ArrayList _components)
          Used by valueOf().
DisplayableLinkImpl(BaseObject _firstEnd, BaseObject _secondEnd, AccessControlLinkImpl _link)
           
DisplayableLinkImpl(BaseObject _firstEnd, BaseObject _secondEnd, BaseObject[] _path)
          Returns instance of a displayable link with empty AccessControlLinks.
 
Method Summary
 void addEorNode(int _index, BaseObject _newNode, AccessControlLinkImpl _firstLink, AccessControlLinkImpl _secondLink)
          Adds a node at the position _index with its two AccessControlLinkImpl.
 java.lang.Object addProperty(java.lang.String _key, java.lang.Object _value)
          Sets a new value for a known key or a new key.
 java.lang.Object clone()
          Gets a clone of a displayable link, with a shallow copy of each node and value in the properties map, and a deep copy of each AccessControlLink.
 boolean contains2NodesSequenceAndFirstEnd(BaseObject[] _l_sequence, BaseObject _firstEnd)
          Detects the presence of a sequence of 2 nodes in this instance, in the same order, for a given first end.
 boolean contains3NodesSequence(BaseObject[] _l_sequence)
          Detects the presence of a sequence of 3 nodes in this instance, in the same order.
 boolean containsAclLinkTypes()
          Tests if each of its AccessControlLinks has a ACL or NEG_ACL relation.
 boolean containsBaseObject(BaseObject _obj)
           
 boolean containsOwnerContainLinkTypes()
          Tests if each of its AccessControlLinks has a OWNER or CONTAIN relation.
 boolean containsPseudoStructuralLinkTypes()
          No use.
 boolean containsRight(StringRight _right)
          Tests if a right is in any AccessControlLink in this instance, through the use of AccessControlLinkImpl.getRedondantRights().
 boolean containsStrengthenLinkTypes()
          GraphicEPRView displays a strengthen relation as a line, not an arrow.
 boolean containsStructureLinkTypes()
          NO USE.
 boolean equals(java.lang.Object _obj)
          Two DisplayableLinkImpls are equals if and only if the sequences of nodes are identical, and all the nodes are identical, and not simply equal.
 void finalizeForGui()
          Finalizes the AccessControlLinkImpl associated to this instance, and clears the list vector_.
 java.util.List<java.lang.Integer> getAclLinkTypePositions()
          Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the types ACL or NEG_ACL.
 java.util.List<java.lang.Integer> getContainLinkTypePositions()
          Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the type CONTAIN.
 AccessControlLinkImpl[] getEorAllACLinks()
          Gets an array of all the AccessControlLinkImpl in this DisplayableLinkImpl.
 BaseObject[] getEorAllNodes()
          Returns a sorted array of all the nodes, including the first end at the index 0 and the second end at the end of the array.
 AccessControlLinkImpl[] getEorConnectedLinks(BaseObject _obj)
          Gets the 2 AccessControlLinks connected to a BaseObject which this DisplayableLinkImpl contains.
 BaseObject[] getEorConnectedNodes(AccessControlLinkImpl _link)
           
 BaseObject getEorFirstEnd()
           
 AccessControlLinkImpl getEorFirstLink()
          If the instance is simple, return the single aclink.
 ImmutableActor getEorLastActorInPath()
          The path contains all the intermediate nodes between the two ends.
 AccessControlLinkImpl getEorLastLink()
          If the instance is simple, returns the single aclink.
 ImmutableVirtualFolder getEorLastVirtualFolderInPath()
          The path contains all the intermediate nodes between the two ends.
 BaseObject getEorNodeJustBeforeTheSecondEnd()
           
 BaseObject[] getEorNodesPath()
          Note: getEorAllNodes() is a little bit faster.
 BaseObject getEorSecondEnd()
           
 java.util.List<java.lang.Integer> getNegativeAclLinkTypePositions()
          Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the type NEG_ACL.
 java.util.List<java.lang.Integer> getOwnerLinkTypePositions()
          Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the type OWNER.
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Gets the general properties of this DisplayableLinkImpl.
 long getSerialVersionUID()
           
 int hashCode()
          Based on the hashCode nodes.
 java.util.List immutableComponents()
           
 int indexOfBaseObject(BaseObject _obj)
          Returns the position of the BaseObject as node returned in getEorAllNodes().
 boolean isEmpty()
           
 boolean isSimple()
           
 boolean isWeak()
           
 boolean mergeCommentsWithoutFiltering(DisplayableLinkImpl _dLink)
          If the argument has the same ends and the same path, adds all the comments in the _dLink AccessControlLinks to the relevant AccessControlLinks of this instance, whatever the link type values in each AccessControlLink.
 java.lang.String mergeGlobalComments()
          Merges all the GLOBAL comments in the AccessControlLinks of this instance.
 boolean mergeRightsWithoutFiltering(DisplayableLinkImpl _dLink)
          If the argument has the same ends and the same path, and for the activated AccessControlLink types, adds all the rights and the comments of the argument to the relevant AccessControlLinks of this instance.
 int noOfComponents()
           
 int noOfNodes()
          Returns the number of nodes, including the first and the second ends.
 java.lang.Object removeProperty(java.lang.String _key)
          Removes a known key.
 java.lang.String toString()
          Returns the list of the nodes and links between them, where the two first objects are the first end and the second end.
static DisplayableLinkImpl valueOf(DisplayableLinkImpl _dLink, BaseObject _secondEnd, AccessControlLinkImpl _lastLink)
          To create a new DisplayableLinkImpl, extends a current DisplayableLinkImpl _dLink to which, after a deep copy, a new node is added as the new second end.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID__

private static final long serialVersionUID__
See Also:
Constant Field Values

PRIME

private static final int PRIME
See Also:
Constant Field Values

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
See Also:
Constant Field Values

AG_CONTEXT_SET

public static final java.lang.String AG_CONTEXT_SET
Key of l_properties_ where the value is the Set of (O to 1) UserId and (0 to N) GroupIDs that defines the Account/Groups context of the node given by the key AG_CONTEXT_NODE_POSITION.

See Also:
Constant Field Values

AG_CONTEXT_NODE_POSITION

public static final java.lang.String AG_CONTEXT_NODE_POSITION
Key of l_properties_ where the value is the position of the node having the AG context set in AG_CONTEXT_SET.

See Also:
Constant Field Values

vector_

protected java.util.ArrayList vector_
This list contains the chain of BaseObjects and AccessControlLinks which defines the DisplayableLink. Usually, all intermediate BaseObjects are Actors, UserIDs or GroupIDs. The possible sizes of this vector is 3, 5, 7, 9... Its structure is designed to easily add a link without change the ends. It is:

- 0: first end,

- 1: second end,

- 2: first access control link between the first end and its next node (which is the second end if the displayable link is simple),

- 3: first intermediate node if the displayable link is not simple,

- 4: second access control link between the first intermediate node and the second intermediate node, if it exists, or the second end if the path has 3 nodes.

- ...


m_properties_

protected java.util.Map<java.lang.String,java.lang.Object> m_properties_
This map describes the general properties of the DisplayableLinkImpl. The first use is the 2 keys AG_CONTEXT_NODE_POSITION and AG_CONTEXT_SET for the Account/Groups context of the link.


serialPersistentFields

public static final java.io.ObjectStreamField[] serialPersistentFields
standardized variable for the JDK 2 serialization

Constructor Detail

DisplayableLinkImpl

public DisplayableLinkImpl()

DisplayableLinkImpl

public DisplayableLinkImpl(java.util.ArrayList _components)
Used by valueOf().

Parameters:
_components - is copied without detailled controls on its structure
Throws:
java.lang.InternalError - if _components is null, or if one node or one aclink is null or duplicated

DisplayableLinkImpl

public DisplayableLinkImpl(BaseObject _firstEnd,
                           BaseObject _secondEnd,
                           AccessControlLinkImpl _link)
Parameters:
_firstEnd - is a non-null BaseObject as the first end of the displayable link. It is not copied.
_secondEnd - is a non-null BaseObject as the second end of the displayable link. It is not copied.
_link - is a non-null first AccessControlLinkImpl
Throws:
java.lang.InternalError - if one parameter is null or a duplicate

DisplayableLinkImpl

public DisplayableLinkImpl(BaseObject _firstEnd,
                           BaseObject _secondEnd,
                           BaseObject[] _path)
Returns instance of a displayable link with empty AccessControlLinks.

Parameters:
_firstEnd - is a non-null BaseObject as the first end of the displayable link. It is not copied.
_secondEnd - is a non-null BaseObject as the second end of the displayable link. It is not copied.
_path - is an array of BaseObjects which are the intermediate nodes of the displayable link. May be null, but if not, each _path item must be non-null without duplication over the nodes.
Throws:
java.lang.InternalError - if a BaseObject is null or a duplicate
Method Detail

valueOf

public static final DisplayableLinkImpl valueOf(DisplayableLinkImpl _dLink,
                                                BaseObject _secondEnd,
                                                AccessControlLinkImpl _lastLink)
To create a new DisplayableLinkImpl, extends a current DisplayableLinkImpl _dLink to which, after a deep copy, a new node is added as the new second end. So, the returned value and _dLink have the same nodes excepting the second end, but with different AccessControlLinks since these links are cloned. The returned value has a copy of the _dLink properties where the values are cloned if they are ImmutableName, Integer, HashSet, ArrayList or anything else, but in the latter case, the value is not cloned. Returns a null result if the argument _secondEnd is already known in _dLink.

Parameters:
_secondEnd - to add at the end of _dLink to define a new second end. Never null.
_lastLink - to put before _secondEnd in the new DisplayableLinkImpl. Never null.
Returns:
the new displayable link, no-backed to _dLink, or null if _secondEnd is known in _dLink.
Throws:
java.lang.InternalError - if one parameter is null.

isEmpty

public boolean isEmpty()
Returns:
true if the displayable link has no component, or if all components are null.

isSimple

public boolean isSimple()
Returns:
true if the displayable link contains only the two ends and one direct link between us.

isWeak

public boolean isWeak()
Returns:
true if an AccessControlLink is weak, whatever its position.

getEorFirstEnd

public BaseObject getEorFirstEnd()
Returns:
the first end of the displayable link. May be null.

getEorSecondEnd

public BaseObject getEorSecondEnd()
Returns:
the second end of the displayable link May be null.

getEorNodeJustBeforeTheSecondEnd

public BaseObject getEorNodeJustBeforeTheSecondEnd()
Returns:
the node before the second end of the displayable link May be null. Is the first end if the displayable link is simple.

getEorFirstLink

public AccessControlLinkImpl getEorFirstLink()
If the instance is simple, return the single aclink.

Returns:
AccessControlLinkImpl the first link of the displayable link. May be null.

getEorLastLink

public AccessControlLinkImpl getEorLastLink()
If the instance is simple, returns the single aclink.

Returns:
AccessControlLinkImpl the last link of the displayable link. May be null.

getEorAllNodes

public BaseObject[] getEorAllNodes()
Returns a sorted array of all the nodes, including the first end at the index 0 and the second end at the end of the array. The value at the index i is connected to the acLinks getEorAllACLinks()[i-1] and getEorAllACLinks()[i], if it is not 0 or (noOfNodes() - 1).

Returns:
BaseObject[] array of all the nodes. May be null.

getEorNodesPath

public BaseObject[] getEorNodesPath()
Note: getEorAllNodes() is a little bit faster.

Returns:
BaseObject[] array of all the nodes, but not the ends. Is null if the link is empty or simple.

getEorAllACLinks

public AccessControlLinkImpl[] getEorAllACLinks()
Gets an array of all the AccessControlLinkImpl in this DisplayableLinkImpl. Internally synchronized on the vector. The value at the index i is connected to the nodes getEorAllNodes()[i] and getEorAllNodes()[i+1].

Returns:
AccessControlLinkImpl[] array of all the links, including the first one at the index 0. May be null.

getEorLastActorInPath

public ImmutableActor getEorLastActorInPath()
The path contains all the intermediate nodes between the two ends. Called by RightsFactory_Facade.getEffectiveRightsForPair() to add '' to the String for an arrow in the view.

Returns:
the last Actor, if any, inthe path. May be null.

getEorLastVirtualFolderInPath

public ImmutableVirtualFolder getEorLastVirtualFolderInPath()
The path contains all the intermediate nodes between the two ends. Called by DisplayableLinkImpl.getContainVirtualFolderWithoutMember().

Returns:
the last VirtualFolder, if any. May be null.

immutableComponents

public java.util.List immutableComponents()
Returns:
List of all the components in the displayable link (that is, BaseObjects and AccessControlLinkImpls). Is immutable. May be null.

noOfComponents

public int noOfComponents()
Returns:
int number of components in the instance, including all the AccessControlLinks and all the nodes

noOfNodes

public int noOfNodes()
Returns the number of nodes, including the first and the second ends.

Returns:
number of nodes in the instance

containsBaseObject

public boolean containsBaseObject(BaseObject _obj)
Parameters:
_obj - BaseObject
Returns:
true if _obj is a node of the DisplayableLinkImpl

indexOfBaseObject

public int indexOfBaseObject(BaseObject _obj)
Returns the position of the BaseObject as node returned in getEorAllNodes(). It is not the position in immutableComponents(). Uses getEorAllNodes().

Parameters:
_obj - BaseObject
Returns:
the position of the BaseObject, or -1 if it is not a node.

contains3NodesSequence

public boolean contains3NodesSequence(BaseObject[] _l_sequence)
Detects the presence of a sequence of 3 nodes in this instance, in the same order. Called by DisplayableLinkUtilities.selectDisplayableLinksWith3NodesSequence().

Parameters:
_l_sequence - array of 3 non-null nodes. Never null.
Returns:
true if the argument is a portion of the nodes sequence in this instance

contains2NodesSequenceAndFirstEnd

public boolean contains2NodesSequenceAndFirstEnd(BaseObject[] _l_sequence,
                                                 BaseObject _firstEnd)
Detects the presence of a sequence of 2 nodes in this instance, in the same order, for a given first end. Return true if the first end is the first node of the nodes sequence. Called by DisplayableLinkUtilities.selectDisplayableLinksWith2NodesSequenceAndFirstEnd().

Parameters:
_l_sequence - array of 2 non-null nodes. Never null. Return false if the array has not a lenght of 2.
_firstEnd - first end
Returns:
true if the first end is correct, and _l_sequence is a portion of the nodes sequence in this instance

containsRight

public boolean containsRight(StringRight _right)
Tests if a right is in any AccessControlLink in this instance, through the use of AccessControlLinkImpl.getRedondantRights(). Caution: the right may be invalidated by other rights in other AccessControlLinks, or may be invalidated by some negative rights in this instance.

Parameters:
_right - to test
Returns:
true if _right is there

containsPseudoStructuralLinkTypes

public boolean containsPseudoStructuralLinkTypes()
No use. Tests if all AccessControlLinks in this instance contain a pseudo structure relation: CONTAIN, OWNER, or BRIDGE.

Returns:
true if there is a pseudo structure relation between each nodes pair.

containsStructureLinkTypes

public boolean containsStructureLinkTypes()
NO USE. Tests if all AccessControlLinks in this instance contain a structure relation among IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, HAS_VIRTUAL_MEMBER, IS_ALIAS.

Returns:
true if there is a structure relation between each nodes pair.

containsStrengthenLinkTypes

public boolean containsStrengthenLinkTypes()
GraphicEPRView displays a strengthen relation as a line, not an arrow. Checks if all the AccessControlLinks have at least one same strengthen relation. Analyzes the state of activation for the types OWNER, IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, IS_ALIAS and RUN_UNDER. Called by Gui2.GraphicEPRView.hasStrengthenLinksInOneDLink() and RightsFactory_Facade.getEffectiveRightsForPair().

Returns:
true if there is the same strengthen relation between each nodes pair.

containsOwnerContainLinkTypes

public boolean containsOwnerContainLinkTypes()
Tests if each of its AccessControlLinks has a OWNER or CONTAIN relation. Called by Gui2.GraphicEPRView.hasOwnerContainLinkToGroupIDMember().

Returns:
true if there is a owner or contain relation between each nodes pair.

containsAclLinkTypes

public boolean containsAclLinkTypes()
Tests if each of its AccessControlLinks has a ACL or NEG_ACL relation.

Returns:
true if there is an acl relation between each nodes pair.

getOwnerLinkTypePositions

public java.util.List<java.lang.Integer> getOwnerLinkTypePositions()
Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the type OWNER.

Returns:
list of indexes. Null if there is no such relation between any nodes pair.

getContainLinkTypePositions

public java.util.List<java.lang.Integer> getContainLinkTypePositions()
Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the type CONTAIN.

Returns:
list of indexes. Null if there is no such relation between any nodes pair.

getAclLinkTypePositions

public java.util.List<java.lang.Integer> getAclLinkTypePositions()
Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the types ACL or NEG_ACL.

Returns:
list of indexes. Null if there is no such relation between any nodes pair.

getNegativeAclLinkTypePositions

public java.util.List<java.lang.Integer> getNegativeAclLinkTypePositions()
Gets the positions in getEorAllACLinks(), if any, of the AccessControlLinks having the type NEG_ACL. Called by DisplayableLinkUtilities.mergeNegativeACLPaths().

Returns:
list of indexes. Null if there is no such relation between any nodes pair.

getEorConnectedLinks

public AccessControlLinkImpl[] getEorConnectedLinks(BaseObject _obj)
Gets the 2 AccessControlLinks connected to a BaseObject which this DisplayableLinkImpl contains. Caution: getEorConnectedLinks(_obj)[0] always exists, but not getEorConnectedLinks(_obj)[1].

Parameters:
_obj - is in this displayable link
Returns:
AccessControlLinkImpl[] array of references to the two links directly connected to _obj, or one link at index 0 or 1, and a null value if _obj is an end. Is null if _obj is not in this displayable link.

getEorConnectedNodes

public BaseObject[] getEorConnectedNodes(AccessControlLinkImpl _link)
Parameters:
_link - is in this displayable link
Returns:
BaseObject[] array of references to the two nodes directly connected to _link. The first node is at the index 0. Is null if _link is not in this displayable link.

addEorNode

public void addEorNode(int _index,
                       BaseObject _newNode,
                       AccessControlLinkImpl _firstLink,
                       AccessControlLinkImpl _secondLink)
Adds a node at the position _index with its two AccessControlLinkImpl. Removes before the AccessControlLinkImpl between the current node at (_index - 2) and the current node at _index, and move this last node to _index + 2. But if _index is 1, the second end is NOT removed, _newNode is put just before the second end, and the last link is removed. No action if the instance is empty. The AccessControlLinkImpls may be known.

Parameters:
_index - int where to add _newNode. Can't be 0 nor pair.
_newNode - BaseObject to add to this displayable link
_firstLink - AccessControlLinkImpl to put between _newNode and the node at _index - 2
_secondLink - AccessControlLinkImpl to put between _newNode and the node at _index + 2, which was at _index before the add operation
Throws:
java.lang.InternalError - if _index is null or pair, if _newNode is known.

mergeRightsWithoutFiltering

public boolean mergeRightsWithoutFiltering(DisplayableLinkImpl _dLink)
If the argument has the same ends and the same path, and for the activated AccessControlLink types, adds all the rights and the comments of the argument to the relevant AccessControlLinks of this instance. Caution: the DisplayableLinkImpl properties are not merged.

Parameters:
_dLink - to merge
Returns:
boolean true if the operation has been processed. If false, the last merging operation on AccessControlLinkImpl which has been processed is the false operation.
Throws:
java.lang.InternalError - in _dLink has not the same path, if an end is not the same.
See Also:
AccessControlLinkImpl.mergeAccessControlLinkWithoutFiltering(ARoad0.CNot.AccessControlLinkImpl)

mergeCommentsWithoutFiltering

public boolean mergeCommentsWithoutFiltering(DisplayableLinkImpl _dLink)
If the argument has the same ends and the same path, adds all the comments in the _dLink AccessControlLinks to the relevant AccessControlLinks of this instance, whatever the link type values in each AccessControlLink. Caution: the DisplayableLinkImpl properties are not merged. Called by DisplayableLinkUtilities.addDisplayableLink().

Parameters:
_dLink -
Returns:
boolean true in all cases.
Throws:
java.lang.InternalError - in _dLink has not the same path, if an end is not the same.

mergeGlobalComments

public java.lang.String mergeGlobalComments()
Merges all the GLOBAL comments in the AccessControlLinks of this instance. Calls AccesControlLinkImpl.getLinkTypeComments().

Returns:
resulting GLOBAL comments. May be empty but never null.

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Gets the general properties of this DisplayableLinkImpl. The first use is the 2 keys AG_CONTEXT_NODE_POSITION and AG_CONTEXT_SET for the Account/Groups context of this link. The AG context is a set of GroupIDMembers that may contain, first, an optional couple (UserID, GroupID), and, second, a list of optional GroupIDs.

AG_CONTEXT_NODE_POSITION is the index of a node in the DislayableLinkImpl for which there is a defined Account/Groups context. The key AG_CONTEXT_SET returns a couple (UserID, GroupID) the node at AG_CONTEXT_NODE_POSITION may use as Account/Main_Group context. The key AG_CONTEXT_SET may also return complementary groups. The UserID is generally, but not only, given by the last UserID node in the DisplayableLinkImpl that is the source for an AccessControlLink with the types OWNER. The UserID is get through a chain of links that transfers the AG context. The GroupID is given by the last GroupID node in the DisplayableLinkImpl that is the source for an AccessControlLink with the types CONTAIN, and through a chain of links that transfers the AG context.

The list of GroupIDs depends on the node giving its proper context, if the chain of links transfers the AG context. If the first end is a GroupIDMember, the list contains the groups to which this GroupIDMember is member, if any. If the first end is an Actor, the list may contain the secondary groups of this Actor, if any. If the chain of links does not transfer the first end AG context, the list of GroupIDs is the secondary groups of the last intermediate Actor starting from no previous transfered AG context. The values in the retured map may be an ImmutableName, an Integer, a HashSet, an ArrayList or anything else.

Returns:
the immutable DisplayableLinkImpl properties, or null
Since:
0.7.0
See Also:
DisplayableLinkUtilities.getSecondEndAGcontext(ARoad0.CNot.DisplayableLinkImpl), LinkRightsImpl.setNextNodeAGrunningContext(ARoad0.CNot.DisplayableLinkImpl, int)

addProperty

public java.lang.Object addProperty(java.lang.String _key,
                                    java.lang.Object _value)
Sets a new value for a known key or a new key. The first use is the 2 keys AG_CONTEXT_NODE_POSITION and AG_CONTEXT_SET for the Account/Groups context of the link.

Parameters:
_key - the key for the new property
_value - the new value may be a Name, a Set or another object
Returns:
the previous value associated with _key, or null if there was no mapping for _key or if an argument is null, or if the value for the key AG_CONTEXT_SET is not a set of ImmutableGroupIDMembers, or if the value for the AG_CONTEXT_NODE_POSITION is not an Integer as position of the node having the AG context, or if it is a value lesser than the previous Integer value
Since:
0.7.0
See Also:
DisplayableLinkUtilities.getSecondEndAGcontext(ARoad0.CNot.DisplayableLinkImpl)

removeProperty

public java.lang.Object removeProperty(java.lang.String _key)
Removes a known key. The first use is the 2 keys AG_CONTEXT_NODE_POSITION and AG_CONTEXT_SET for the Account/Groups context of the link.

Parameters:
_key - the key for the property to remove
Returns:
the previous value associated with _key, or null if there was no mapping for _key
Since:
0.7.0

clone

public java.lang.Object clone()
Gets a clone of a displayable link, with a shallow copy of each node and value in the properties map, and a deep copy of each AccessControlLink.

Overrides:
clone in class java.lang.Object
Returns:
a cloned and no-backed instance of displayable link. May be null.
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object _obj)
Two DisplayableLinkImpls are equals if and only if the sequences of nodes are identical, and all the nodes are identical, and not simply equal. The AccessControlLinks and the properties are not implied.

Overrides:
equals in class java.lang.Object
Parameters:
_obj - the object to compare
Returns:
true if the argument is equal

hashCode

public int hashCode()
Based on the hashCode nodes.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode value for this instance. May be 0.

finalizeForGui

public void finalizeForGui()
Finalizes the AccessControlLinkImpl associated to this instance, and clears the list vector_.


getSerialVersionUID

public long getSerialVersionUID()
Returns:
long serial version UID for serialization of the class

toString

public java.lang.String toString()
Returns the list of the nodes and links between them, where the two first objects are the first end and the second end. An exemple of returned String, from the MySQL AcsAddon, is:

tom |localhost| ACL: EXECU; ( EXECUTE conditional ACL via |AllSimpleHosts| sets Group) Amounts view alias Runs Under,

to desccribe a link where the suite of 3 nodes is ('tom', 'Amounts view alias', '|localhost|'), where the first AccessControlLink from 'tom' to 'Amounts view alias' is described by 'ACL: EXECU; ( EXECUTE conditional ACL via |AllSimpleHosts| sets Group)', and the last AccessControlLink is, as always, at the end: 'Runs Under' from 'Amounts view alias' to '|localhost|'. Calls AccessControlLinkImpl.toString().

Overrides:
toString in class java.lang.Object
Returns:
String