|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gWork.DisplayableLinkUtilities
public class DisplayableLinkUtilities
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.
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 |
---|
private AlgorithmInterpreter interpreter_
private UtilityImpl baseUtil_
private final java.util.ArrayList resultVector_
Constructor Detail |
---|
protected DisplayableLinkUtilities(AlgorithmInterpreter _interpreter)
_interpreter
- algorithm interpreterMethod Detail |
---|
public final java.util.Set getAllEndsInDisplayableLinks(java.util.Collection _linksCollection, boolean _forFirstEnd)
_linksCollection
- of DisplayableLinkImpls_forFirstEnd
- false to get the second ends, true for the first ends
java.lang.InternalError
- if an element in _linksCollection is not a DisplayableLinkImpl.public final java.util.Set getAllNodesInDisplayableLinks(java.util.Collection _linksCollection)
_linksCollection
- of DisplayableLinkImpls
java.lang.InternalError
- if an element in _linksCollection is not a DisplayableLinkImpl.public final java.util.Set<DisplayableLinkImpl> selectNodesPathInDisplayableLinks(java.util.Set<DisplayableLinkImpl> _linksCollection, BaseObject[] _l_path)
_linksCollection
- of DisplayableLinkImpls_l_path
- to detect in each _linksCollection element. May be null.
java.lang.InternalError
- if an element in _linksCollection is not
a DisplayableLinkImpl.public final boolean containsDisplayableLinks(BaseObject _ep, BaseObject _obj, java.util.Map _m_l_DisplayableLinks)
_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).
public final DisplayableLinkImpl getDisplayableLink(BaseObject _ep, BaseObject _obj, BaseObject[] _path, java.util.Map _m_l_DisplayableLinks)
_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).
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinkWithStartPath(ACSObject[] _l_path, java.util.Map _m_l_DisplayableLinks)
_l_path
- chain of nodes._m_l_DisplayableLinks
- Map of DisplayableLinks lists to analyze
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForSecondEnd(BaseObject _obj, java.util.Map _m_l_DisplayableLinks)
_obj
- BaseObject_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair).
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForFirstEnd(BaseObject _obj, java.util.Collection _l_DisplayableLinks)
_obj
- BaseObject_l_DisplayableLinks
- is a Collection of DisplayableLinks.
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksForSecondEnd(BaseObject _obj, java.util.Collection _l_DisplayableLinks)
_obj
- BaseObject_l_DisplayableLinks
- is a Collection of DisplayableLinks.
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWith3NodesSequence(BaseObject _obj1, BaseObject _obj2, BaseObject _obj3, java.util.Collection _l_DisplayableLinks)
_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.
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWith2NodesSequenceAndFirstEnd(BaseObject _obj1, BaseObject _obj2, BaseObject _firstEnd, java.util.Collection _l_DisplayableLinks)
_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.
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndFirstEnd(BaseObject _obj1, BaseObject _firstEnd, java.util.Collection _l_DisplayableLinks)
_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.
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndSecondEnd(BaseObject _obj1, BaseObject _secondEnd, java.util.Collection _l_DisplayableLinks)
_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.
public final java.util.Set<DisplayableLinkImpl> selectDisplayableLinksWithOneNodeAndTwoEnds(BaseObject _obj1, BaseObject _firstEnd, BaseObject _secondEnd, java.util.Collection _l_DisplayableLinks)
_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.
public final java.util.Set mergeTwoLinksCollection(java.util.Collection _l_startingDisplayableLinks, java.util.Collection _l_endingDisplayableLinks)
_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.
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.public final DisplayableLinkImpl mergeLinks(DisplayableLinkImpl _startingDisplayableLink, DisplayableLinkImpl _endingDisplayableLink)
_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.
java.lang.InternalError
- if a parameter is null, empty, or if
the central objet rule is not satisfied.public final java.util.Set getIntermediateNodesListsForPair(ImmutableName _pairKey, java.util.Map _m_l_DisplayableLinks)
_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).
public final void copyUpNodeComments(DisplayableLinkImpl _dLink, int _nodeIndex, boolean _forXIDonly, boolean _toGLOBAL)
_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)public final java.util.Set<BaseObject[]> removeTooNumerous3NodesSequence(java.util.List _l_dLinksToUpdate)
- 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().
_l_dLinksToUpdate
- to analyze, all with the same two ends. Not null. This
argument is updated.
protected final java.util.Set<StringRight>[] getEffectiveRightsAndCommentOnRights(DisplayableLinkImpl _dLink, boolean _withComment)
_dLink
- to analyze. Not null._withComment
- true to return the second set of detailled rights for comments
public final java.util.List<DisplayableLinkImpl> getDLinksForLoopsOnTarget(ImmutableName _target, java.util.Collection<DisplayableLinkImpl> _l_paths)
_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.
public final java.util.Set<ImmutableGroupIDMember> getSecondEndAGcontext(DisplayableLinkImpl _upd_dLink)
_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.
public final boolean getContainVirtualFolderWithoutMember(DisplayableLinkImpl _dLink)
_dLink
- is never null
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
_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
java.lang.InterruptedException
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
_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
java.lang.InterruptedException
public void finalizeForProcess()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |