ARoad0.gWork
Class DisplayableLinkUtilities

java.lang.Object
  extended by ARoad0.gWork.DisplayableLinkUtilities
All Implemented Interfaces:
CoreAlgorithm

public class DisplayableLinkUtilities
extends java.lang.Object
implements CoreAlgorithm

This class provides core algorithms about DisplayableLinks. This class is stateless, and RightsMediatorImpl at its creation setups an instance for its ViewInBase. There is no direct call to the ACS methods. It is used by the gWork and Gui2 classes.

See Also:
DisplayableLinkImpl, CoreAlgorithm

Field Summary
private  UtilityImpl baseUtil_
           
private  AlgorithmInterpreter interpreter_
           
private  java.util.ArrayList resultVector_
          To speed up mergeLinks()
 
Fields inherited from interface ARoad0.gWorkInterface.CoreAlgorithm
INITIAL_CAPACITY
 
Constructor Summary
protected DisplayableLinkUtilities(AlgorithmInterpreter _interpreter)
          only one protected constructor
 
Method Summary
 boolean containsDisplayableLinks(BaseObject _ep, BaseObject _obj, java.util.Map _m_l_DisplayableLinks)
          Returns true if there are DisplayableLinkImpls for a couple of BaseObjects.
 java.util.List<DisplayableLinkImpl> containsIndirectPaths(java.util.List<DisplayableLinkImpl> _l_dLinks, java.util.Map<ImmutableName,java.util.Set<StringRight>> _m_rights, boolean _detectPositiveIndirectPaths)
          Gets the simple DisplayableLinksImpls for which there is at least one indirect path through the other view nodes.
 void copyUpNodeComments(DisplayableLinkImpl _dLink, int _nodeIndex, boolean _forXIDonly, boolean _toGLOBAL)
          NO USE.
 void finalizeForProcess()
          Finalizes the instance.
 java.util.Set getAllEndsInDisplayableLinks(java.util.Collection _linksCollection, boolean _forFirstEnd)
          Gets all the first or all the second ends.
 java.util.Set getAllNodesInDisplayableLinks(java.util.Collection _linksCollection)
          Get all the nodes, including the intermediate ones, the first and the second ones.
 boolean getContainVirtualFolderWithoutMember(DisplayableLinkImpl _dLink)
          Tests the link for denying, if the result is true, the adding of a new Resource node to the argument, if this Resource is not a VirtualFolder member.
private  java.util.List<Name>[] getCurrentEndKeys(ImmutableName _firstEndName, ImmutableName _secondEndName, java.util.Map<ImmutableName,java.util.Set<StringRight>> _m_rights, boolean _detectPositiveRights)
          Gets a first list containing the _m_rights keys starting with _firstEndName, and a second list containing the _m_rights keys ending with _secondEndName, if the _m_rights key has the sens of _detectPositiveRights.
 DisplayableLinkImpl getDisplayableLink(BaseObject _ep, BaseObject _obj, BaseObject[] _path, java.util.Map _m_l_DisplayableLinks)
          Gets a DisplayableLinkImpl if it exists.
 java.util.List<DisplayableLinkImpl> getDLinksForLoopsOnTarget(ImmutableName _target, java.util.Collection<DisplayableLinkImpl> _l_paths)
          UNUSED - Analyzes a network of nodes and oriented links to detect the paths which end to _target and may participate to some loops.
protected  java.util.Set<StringRight>[] getEffectiveRightsAndCommentOnRights(DisplayableLinkImpl _dLink, boolean _withComment)
          This central method gets the current effective rights in a DisplayableLinkImpl, and the rights for comments, with the list of all the implied rights.
 java.util.Set getIntermediateNodesListsForPair(ImmutableName _pairKey, java.util.Map _m_l_DisplayableLinks)
          Select the lists of intermediate nodes in the DisplayableLinks associated to a BaseObject pair.
 java.util.Set<ImmutableGroupIDMember> getSecondEndAGcontext(DisplayableLinkImpl _upd_dLink)
          This important method returns the current Account/Groups context of the DisplayableLinkImpl second end, and it may update the argument.
 DisplayableLinkImpl mergeLinks(DisplayableLinkImpl _startingDisplayableLink, DisplayableLinkImpl _endingDisplayableLink)
          Puts the ending DisplayableLinkImpl after the starting DisplayableLinkImpl to build up a new DisplayableLink where the AccessControlLinkImpls are cloned.
 java.util.Set mergeTwoLinksCollection(java.util.Collection _l_startingDisplayableLinks, java.util.Collection _l_endingDisplayableLinks)
          Merge each starting DisplayableLinkImpl with each ending DisplayableLinkImpl to build up a new DisplayableLink which is put on the returned set.
 java.util.Set<BaseObject[]> removeTooNumerous3NodesSequence(java.util.List _l_dLinksToUpdate)
          Removes in the argument the DisplayableLink which fulfills with this criterion: - contains a sequence of 3 nodes A-B-C
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForFirstEnd(BaseObject _obj, java.util.Collection _l_DisplayableLinks)
          Select all the DisplayableLinks for which a BaseObject is a first end in a view.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForSecondEnd(BaseObject _obj, java.util.Collection _l_DisplayableLinks)
          Select all the DisplayableLinks for which a BaseObject is a second end in a view.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForSecondEnd(BaseObject _obj, java.util.Map _m_l_DisplayableLinks)
          Selects all the DisplayableLinks for which a BaseObject is a second end in a view.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWith2NodesSequenceAndFirstEnd(BaseObject _obj1, BaseObject _obj2, BaseObject _firstEnd, java.util.Collection _l_DisplayableLinks)
          Select all the DisplayableLinks for which a couple of BaseObjects are nodes in a continous sequence without other internmediate nodes, and for a given first end.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWith3NodesSequence(BaseObject _obj1, BaseObject _obj2, BaseObject _obj3, java.util.Collection _l_DisplayableLinks)
          Select all the DisplayableLinks for which a triplet of BaseObjects are nodes in a continous sequence without other internmediate nodes.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndFirstEnd(BaseObject _obj1, BaseObject _firstEnd, java.util.Collection _l_DisplayableLinks)
          Select all the DisplayableLinks for which a BaseObject is a node, and for a given first end.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndSecondEnd(BaseObject _obj1, BaseObject _secondEnd, java.util.Collection _l_DisplayableLinks)
          Select all the DisplayableLinks for which a BaseObject is a node, and for a given second end.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndTwoEnds(BaseObject _obj1, BaseObject _firstEnd, BaseObject _secondEnd, java.util.Collection _l_DisplayableLinks)
          Select all the DisplayableLinks for which a BaseObject is a node, and for a given couple of ends.
 java.util.Set<DisplayableLinkImpl> selectDisplayableLinkWithStartPath(ACSObject[] _l_path, java.util.Map _m_l_DisplayableLinks)
          Selects the DisplayableLinks which contain _l_path at the beginning of their node chains.
 java.util.Set<DisplayableLinkImpl> selectNodesPathInDisplayableLinks(java.util.Set<DisplayableLinkImpl> _linksCollection, BaseObject[] _l_path)
          Gets all the links which contain all the path, in the same order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interpreter_

private AlgorithmInterpreter interpreter_

baseUtil_

private UtilityImpl baseUtil_

resultVector_

private final java.util.ArrayList resultVector_
To speed up mergeLinks()

Constructor Detail

DisplayableLinkUtilities

protected DisplayableLinkUtilities(AlgorithmInterpreter _interpreter)
only one protected constructor

Parameters:
_interpreter - algorithm interpreter
Method Detail

getAllEndsInDisplayableLinks

public final java.util.Set getAllEndsInDisplayableLinks(java.util.Collection _linksCollection,
                                                        boolean _forFirstEnd)
Gets all the first or all the second ends. Called by getDLinksForLoopsOnTarget(). Called by ThreeRightsFactoryImpl.

Parameters:
_linksCollection - of DisplayableLinkImpls
_forFirstEnd - false to get the second ends, true for the first ends
Returns:
Set of the BaseObjects which are all the first or all the second ends.
Throws:
java.lang.InternalError - if an element in _linksCollection is not a DisplayableLinkImpl.

getAllNodesInDisplayableLinks

public final java.util.Set getAllNodesInDisplayableLinks(java.util.Collection _linksCollection)
Get all the nodes, including the intermediate ones, the first and the second ones.

Parameters:
_linksCollection - of DisplayableLinkImpls
Returns:
Set of the relevant BaseObjects as path nodes
Throws:
java.lang.InternalError - if an element in _linksCollection is not a DisplayableLinkImpl.

selectNodesPathInDisplayableLinks

public final java.util.Set<DisplayableLinkImpl> selectNodesPathInDisplayableLinks(java.util.Set<DisplayableLinkImpl> _linksCollection,
                                                                                  BaseObject[] _l_path)
Gets all the links which contain all the path, in the same order.

Parameters:
_linksCollection - of DisplayableLinkImpls
_l_path - to detect in each _linksCollection element. May be null.
Returns:
Set of the relevant DisplayableLinks. May be empty, but not null.
Throws:
java.lang.InternalError - if an element in _linksCollection is not a DisplayableLinkImpl.

containsDisplayableLinks

public final boolean containsDisplayableLinks(BaseObject _ep,
                                              BaseObject _obj,
                                              java.util.Map _m_l_DisplayableLinks)
Returns true if there are DisplayableLinkImpls for a couple of BaseObjects.

Parameters:
_ep - is the first end of the DisplayableLinkImpl
_obj - is the second end of the DisplayableLinkImpl. It is a resource or a GroupID.
_m_l_DisplayableLinks - Map of DisplayableLinks lists (one per pair) (_ep, _obj).
Returns:
true if this couple has at least one DisplayableLinkImpl

getDisplayableLink

public final DisplayableLinkImpl getDisplayableLink(BaseObject _ep,
                                                    BaseObject _obj,
                                                    BaseObject[] _path,
                                                    java.util.Map _m_l_DisplayableLinks)
Gets a DisplayableLinkImpl if it exists. Compares the identity of the nodes, in the same order, but does not compare the AccessControlLinkImpls, Note: derived from the equals method in DisplayableLinkImpl; it declares that 2 instances are equal if and only if the sequences of nodes are identical, and if the nodes are identical, and not simply equal.

Parameters:
_ep - is the first end of the DisplayableLinkImpl
_obj - is the second end of the DisplayableLinkImpl. It is a resource or a GroupID.
_path - BaseObject[] of the intermediate nodes in a DisplayableLink to create or update, that is associated to the pair (_ep, _obj). Is null when there is no intermediate nodes.
_m_l_DisplayableLinks - Map of DisplayableLinks lists (one per pair) (_ep, _obj).
Returns:
a DisplayableLinkImpl in _m_l_DisplayableLinks, or null.

selectDisplayableLinkWithStartPath

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinkWithStartPath(ACSObject[] _l_path,
                                                                                   java.util.Map _m_l_DisplayableLinks)
Selects the DisplayableLinks which contain _l_path at the beginning of their node chains. If _l_path is found as a complet chain, returns only this link. Called by AgoRightsFactoryImpl.selectHiddenButNoDirectGroupLinks().

Parameters:
_l_path - chain of nodes.
_m_l_DisplayableLinks - Map of DisplayableLinks lists to analyze
Returns:
Set of DisplayableLinkImpl in _m_l_DisplayableLinks, or null if _l_path is not in any DisplayableLink in the map.

selectDisplayableLinksForSecondEnd

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForSecondEnd(BaseObject _obj,
                                                                                   java.util.Map _m_l_DisplayableLinks)
Selects all the DisplayableLinks for which a BaseObject is a second end in a view.

Parameters:
_obj - BaseObject
_m_l_DisplayableLinks - Map of DisplayableLinks lists (one per pair).
Returns:
Set of DisplayableLinks that contains _obj as a second end. May be null but not empty.

selectDisplayableLinksForFirstEnd

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForFirstEnd(BaseObject _obj,
                                                                                  java.util.Collection _l_DisplayableLinks)
Select all the DisplayableLinks for which a BaseObject is a first end in a view.

Parameters:
_obj - BaseObject
_l_DisplayableLinks - is a Collection of DisplayableLinks.
Returns:
Set of DisplayableLinks that contains _obj as a first end. May be null but not empty.

selectDisplayableLinksForSecondEnd

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForSecondEnd(BaseObject _obj,
                                                                                   java.util.Collection _l_DisplayableLinks)
Select all the DisplayableLinks for which a BaseObject is a second end in a view.

Parameters:
_obj - BaseObject
_l_DisplayableLinks - is a Collection of DisplayableLinks.
Returns:
Set of DisplayableLinks that contains _obj as a second end. May be null but not empty.

selectDisplayableLinksWith3NodesSequence

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWith3NodesSequence(BaseObject _obj1,
                                                                                         BaseObject _obj2,
                                                                                         BaseObject _obj3,
                                                                                         java.util.Collection _l_DisplayableLinks)
Select all the DisplayableLinks for which a triplet of BaseObjects are nodes in a continous sequence without other internmediate nodes. Some of these nodes may be ends or not. Called by removeTooNumerous3NodesSequence(). Call DisplayableLinkImpl.contains3NodesSequence(BaseObject[] _l_sequence).

Parameters:
_obj1 - is the first BaseObject to test. Never null.
_obj2 - is the second BaseObject to test has beeing just after _obj1. Never null.
_obj3 - is the third BaseObject to test has beeing just after _obj2. Never null.
_l_DisplayableLinks - is a Collection of DisplayableLinks. Never null.
Returns:
Set of DisplayableLinks that contains the sequence _obj1/_obj2/_obj3. May be empty. Never null.

selectDisplayableLinksWith2NodesSequenceAndFirstEnd

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWith2NodesSequenceAndFirstEnd(BaseObject _obj1,
                                                                                                    BaseObject _obj2,
                                                                                                    BaseObject _firstEnd,
                                                                                                    java.util.Collection _l_DisplayableLinks)
Select all the DisplayableLinks for which a couple of BaseObjects are nodes in a continous sequence without other internmediate nodes, and for a given first end. Some of these nodes may be ends or not. Calls DisplayableLinkImpl.contains3NodesSequence(BaseObject[] _l_sequence).

Parameters:
_obj1 - is the first BaseObject to test. Never null.
_obj2 - is the second BaseObject to test has beeing just after _obj1. Never null.
_firstEnd - is the first end to test. Never null.
_l_DisplayableLinks - is a Collection of DisplayableLinks. Never null.
Returns:
Set of DisplayableLinks that contains the sequence _obj1/_obj2, and _firstEnd as first end. May be empty. Never null.

selectDisplayableLinksWithOneNodeAndFirstEnd

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndFirstEnd(BaseObject _obj1,
                                                                                             BaseObject _firstEnd,
                                                                                             java.util.Collection _l_DisplayableLinks)
Select all the DisplayableLinks for which a BaseObject is a node, and for a given first end. The node may be an end or not.

Parameters:
_obj1 - is the first BaseObject to test. Never null.
_firstEnd - is the first end to test. Never null.
_l_DisplayableLinks - is a Collection of DisplayableLinks. Never null.
Returns:
Set of DisplayableLinks that contains _obj1 and _firstEnd as first end. May be empty. Never null.

selectDisplayableLinksWithOneNodeAndSecondEnd

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndSecondEnd(BaseObject _obj1,
                                                                                              BaseObject _secondEnd,
                                                                                              java.util.Collection _l_DisplayableLinks)
Select all the DisplayableLinks for which a BaseObject is a node, and for a given second end. The node may be an end or not.

Parameters:
_obj1 - is the first BaseObject to test. Never null.
_secondEnd - is the second end to test. Never null.
_l_DisplayableLinks - is a Collection of DisplayableLinks. Never null.
Returns:
Set of DisplayableLinks that contains _obj1 and _secondEnd as a second end. May be empty. Never null.

selectDisplayableLinksWithOneNodeAndTwoEnds

public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndTwoEnds(BaseObject _obj1,
                                                                                            BaseObject _firstEnd,
                                                                                            BaseObject _secondEnd,
                                                                                            java.util.Collection _l_DisplayableLinks)
Select all the DisplayableLinks for which a BaseObject is a node, and for a given couple of ends. The node may be an end or not. Called by CompoundRightsFactoryimpl.detectHiddenCompoundEpRights().

Parameters:
_obj1 - is the first BaseObject to test. May be an end. Never null.
_firstEnd - is the first end to test. Never null.
_secondEnd - is the first end to test. Never null.
_l_DisplayableLinks - is a Collection of DisplayableLinks. Never null.
Returns:
Set of DisplayableLinks that contains _obj1 and _firstEnd as first end. May be empty. Never null.

mergeTwoLinksCollection

public final java.util.Set mergeTwoLinksCollection(java.util.Collection _l_startingDisplayableLinks,
                                                   java.util.Collection _l_endingDisplayableLinks)
Merge each starting DisplayableLinkImpl with each ending DisplayableLinkImpl to build up a new DisplayableLink which is put on the returned set. So, if there are 2 starting DisplayableLinkImpls and 3 ending DisplayableLinkImpls, the size of the returned set is 6. All starting DisplayableLinkImpls must have the same second end, that must be the first end of all the ending DisplayableLinkImpls. This BaseObject is called the central object. No new link if there is a loop in the new link. All the AccessControlLinkImpls are cloned in the returned DisplayableLinkImpls. Called by detectHiddenCompoundEpRights(). Call the mergeLinks() method.

Parameters:
_l_startingDisplayableLinks - is a collection of DisplayableLinks for which the second node is associated to the central object.
_l_endingDisplayableLinks - is a collection of DisplayableLinks for which the first node is associated to the central object.
Returns:
Set of merged DisplayableLinks. Never empty.
Throws:
java.lang.InternalError - if a parameter is null, empty, if it is not a DisplayableLinkImpl collection, or if the central objet rule is not satisfyed.

mergeLinks

public final DisplayableLinkImpl mergeLinks(DisplayableLinkImpl _startingDisplayableLink,
                                            DisplayableLinkImpl _endingDisplayableLink)
Puts the ending DisplayableLinkImpl after the starting DisplayableLinkImpl to build up a new DisplayableLink where the AccessControlLinkImpls are cloned. The starting link second end must be the ending link first end. This BaseObject is called the central object. The properties of _startingDisplayableLink are copied in the result, while the properties of _endingDisplayableLink are not copied. No operation if there is a loop in the new link. Called by mergeTwoLinksCollections() and getDLinksForLoopsOnTarget().

Parameters:
_startingDisplayableLink - is a link for which the second node is associated to the central object.
_endingDisplayableLink - is a link for which the first node is associated to the central object.
Returns:
a new DisplayableLinkImpl, or null if there is a loop in the new link.
Throws:
java.lang.InternalError - if a parameter is null, empty, or if the central objet rule is not satisfied.

getIntermediateNodesListsForPair

public final java.util.Set getIntermediateNodesListsForPair(ImmutableName _pairKey,
                                                            java.util.Map _m_l_DisplayableLinks)
Select the lists of intermediate nodes in the DisplayableLinks associated to a BaseObject pair. Called by NodeRightsImpl.selectHiddenButNoDirectGroupLinks().

Parameters:
_pairKey - is a key of _m_l_DisplayableLinks - for instance an eligible party name extended by a resource name.
_m_l_DisplayableLinks - Map of DisplayableLinks lists (one per pair).
Returns:
Set of BaseObject[] where the intermediate nodes are from the first intermediate node to the last one, without the first end but with the second end. May be empty.

copyUpNodeComments

public final void copyUpNodeComments(DisplayableLinkImpl _dLink,
                                     int _nodeIndex,
                                     boolean _forXIDonly,
                                     boolean _toGLOBAL)
NO USE. Copy the comments in the AccessControlLink before a node, into the AccessControlLink after the node, in a DisplayableLinkImpl. Copy all the XID comments (ACL, OWNER, CONTAIN, IS_MEMBER, IS_INDIRECT_MEMBER) or copy all the comments, to the same comments type, or to the GLOBAL comments. addComment() is used, so the old comments are not deleted and the link types are not used.

Parameters:
_dLink - contains the node to process; the AccessControlLink after the node is updated
_nodeIndex - is the index of a _dLink node to process
_forXIDonly - is true if only ACL, OWNER, CONTAIN, IS_MEMBER, IS_INDIRECT_MEMBER, and false if all link types are to be copied
_toGLOBAL - is true if the comments are copied to the GLOBAL link type, and false if each link type is copied to the same type (for example, ACL in ACL)

removeTooNumerous3NodesSequence

public final java.util.Set<BaseObject[]> removeTooNumerous3NodesSequence(java.util.List _l_dLinksToUpdate)
Removes in the argument the DisplayableLink which fulfills with this criterion:

- contains a sequence of 3 nodes A-B-C. - A-B-C is a sequence which is in 5 other DisplayableLinks in the argument. It is recommanded to have an argument larger than 6 to avoid useless processing. Called by RightsFactoryUtilities.getEPRWhyText().

Parameters:
_l_dLinksToUpdate - to analyze, all with the same two ends. Not null. This argument is updated.
Returns:
set of BaseObject[] having a length of 3. May be null.

getEffectiveRightsAndCommentOnRights

protected final java.util.Set<StringRight>[] getEffectiveRightsAndCommentOnRights(DisplayableLinkImpl _dLink,
                                                                                  boolean _withComment)
This central method gets the current effective rights in a DisplayableLinkImpl, and the rights for comments, with the list of all the implied rights. This is the single method to get the true rights from a DisplayableLinkImpl. A DisplayableLinkImpl may be effective even if it has no effective rights. The result is never null to be well used by getFirstShapeEffectiveRights(). Called by RightsFactory_Facade.getEffectiveRightsForPair() and getFirstShapeEffectiveRights(). Calls AccessControlLinkImpl.getFilteredRights(), BaseUtilityImpl.subtractNegativeNotRemovingInOneACS(), UtilityImpl.selectHeaders().

Parameters:
_dLink - to analyze. Not null.
_withComment - true to return the second set of detailled rights for comments
Returns:
an array of two sets, where the first one is the effective rights (non-null set, may be empty), and the second one is the detailled rights for the 'See why' text. Never Null. May be empty.

getDLinksForLoopsOnTarget

public final java.util.List<DisplayableLinkImpl> getDLinksForLoopsOnTarget(ImmutableName _target,
                                                                           java.util.Collection<DisplayableLinkImpl> _l_paths)
UNUSED - Analyzes a network of nodes and oriented links to detect the paths which end to _target and may participate to some loops. In the returned list, there are no crossroads where two DisplayableLinkImpls have a commun intermediate node, but the aim is there to return those having a common first end, plus _target as common second end, since this is the definition of a path loop. Does not read the link types and the rights in each DisplayableLink. Creates for each matched path a DisplayableLink without rights nor comments. Intermediate nodes and AccessControlLinkImpls in _l_paths are not processed. Performance: the number of search cycles is limited to 200. Calls mergeLinks(), getAllEndsInDisplayableLinks(). Throw an InternalError if the search is in more than 200 cycles.

Parameters:
_target - a target name present in _l_paths
_l_paths - set of simple DisplayableLinkImpls, which define oriented links betwen the two end nodes, and where the link gives, at AccessControlLinkImpl.GLOBAL, the effective rights between the two ends.
Returns:
new simple or not-simple DisplayableLinks where _target is the name of the second end, node names are end names in _l_paths, and which may participate to a loop or not.

getSecondEndAGcontext

public final java.util.Set<ImmutableGroupIDMember> getSecondEndAGcontext(DisplayableLinkImpl _upd_dLink)
This important method returns the current Account/Groups context of the DisplayableLinkImpl second end, and it may update the argument. The AG context is a set of GroupIDMembers that may contain, first, an optional couple (UserID, GroupID), and, second, a list of optional GroupIDs. If the property for the DisplayableLinkImpl.AG_CONTEXT_NODE_POSITION is the position of the second end, this method returns the current AG context, and it does not change the argument. Otherwise, the argument is updated. This method split the call to LinkRights.updateAGrunningContext() for each ACS the argument uses. Called by CompoundRightsFactoryImpl.detectHiddenCompoundEpRights() and the AcsAddons. Calls LinkRights.updateAGrunningContext(), that the AcsAddon may overrides. It may also override LinkRights.setNextNodeAGrunningContext() and isTransferingAGcontext() the method updateAGrunningContext() uses.

Parameters:
_upd_dLink - is never null and it is updated for the properties DisplayableLinkImpl.AG_CONTEXT_NODE_POSITION and DisplayableLinkImpl.AG_CONTEXT_SET. _upd_dLink.getProperties() is never null after the call to this method.
Returns:
set of one UserID and some GroupIDs, as the AG context of the second end of the argument. May be null but never empty.

getContainVirtualFolderWithoutMember

public final boolean getContainVirtualFolderWithoutMember(DisplayableLinkImpl _dLink)
Tests the link for denying, if the result is true, the adding of a new Resource node to the argument, if this Resource is not a VirtualFolder member. Implements the rule 'virtual folder: an indirect access to a Resource that is not a virtual member, is always through a virtual member'. Called by CompoundRightsFactoryImpl.detectHiddenCompoundEpRights() and ThreeNodesRightsFactoryImpl. Calls DisplayableLinkImpl.getEorLastVirtualFolderInPath().

Parameters:
_dLink - is never null
Returns:
true if the argument contains a VirtualFolder node without any virtual member of the VirtualFolder as next node, after the VirtualFolder position in the link

containsIndirectPaths

public final java.util.List<DisplayableLinkImpl> containsIndirectPaths(java.util.List<DisplayableLinkImpl> _l_dLinks,
                                                                       java.util.Map<ImmutableName,java.util.Set<StringRight>> _m_rights,
                                                                       boolean _detectPositiveIndirectPaths)
                                                                throws java.lang.InterruptedException
Gets the simple DisplayableLinksImpls for which there is at least one indirect path through the other view nodes. For instance, in a view containing the nodes A, B, C and D, all the DisplayableLinksImpls in _l_dLinks from A to B are returned, if there are, in the arguments _m_rights, some rights from A to C, some rights from C to D, and some rights from D to B. The value of _detectPositiveIndirectPaths enforces the matched indirect path to have only positive or only negative rights, in _m_rights, for each couple of nodes in the indirect path. To detect the structural paths, a positive metaright may be used in _m_rights. The current rights of each _l_dLinks argument are not considered. Called by CompoundRightsFactoryImpl.addPathFromNegativeRightsInOneACS(), with a _l_dLinks argument containing only simple links. Calls getCurrentEndKeys().

Parameters:
_l_dLinks - to analyze. Not null.
_m_rights - where the key is a _m_l_DisplayableLinks key where rights are activated, and the value is a set of StringRights for this couple of nodes (it may be an empty set, but never null).
_detectPositiveIndirectPaths - true to detect the indirect positive paths only, and false to detect the indirect negative paths only
Returns:
simple DisplayableLinks which are already in _l_dLinks. May be null but not empty.
Throws:
java.lang.InterruptedException

getCurrentEndKeys

private final java.util.List<Name>[] getCurrentEndKeys(ImmutableName _firstEndName,
                                                       ImmutableName _secondEndName,
                                                       java.util.Map<ImmutableName,java.util.Set<StringRight>> _m_rights,
                                                       boolean _detectPositiveRights)
                                                throws java.lang.InterruptedException
Gets a first list containing the _m_rights keys starting with _firstEndName, and a second list containing the _m_rights keys ending with _secondEndName, if the _m_rights key has the sens of _detectPositiveRights. This method detects also a structural link if the argument _m_rights contains a positive metaright for a key. Called by containsIndirectPaths().

Parameters:
_firstEndName - is never null.
_secondEndName - is never null.
_m_rights - where the key is a _m_l_DisplayableLinks key where rights are activated, and the value is a set of StringRights for this couple of nodes (it may be an empty set, but never null).
_detectPositiveRights - true to detect the indirect positive paths only, and false to detect the indirect negative paths only
Returns:
array of two Name lists, where the first list contains the _m_rights keys starting with _firstEndName, and the second list contains the _m_rights keys ending with _secondEndName. A list may be empty.
Throws:
java.lang.InterruptedException

finalizeForProcess

public void finalizeForProcess()
Finalizes the instance. Called by RightsMediatorImpl.finalizeForProcess().