|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gWork.CompoundRightsFactoryImpl
public final class CompoundRightsFactoryImpl
This class is responsible for all the core algorithms about the long access paths, mixing the searches among all types of rights. This class contains the most complex algorithms of Access Road, in the method detectHiddenCompoundEpRights() responsible to find all the access paths having more than 3 nodes. It provides also some small methods for handling the ACS links, the Bridges, the Alias and the virtual members. This class is stateless, and RightsMediatorImpl at its creation setups an instance for its ViewInBase. The calls to ACS are only in the method detectAcsLinks().
Fields inherited from interface ARoad0.gWorkInterface.CoreAlgorithm |
---|
INITIAL_CAPACITY |
Constructor Summary | |
---|---|
protected |
CompoundRightsFactoryImpl(AlgorithmInterpreter _interpreter)
only one protected constructor |
Method Summary | |
---|---|
java.util.Map |
addPathFromNegativeRightsInOneACS(GraphicView _gview,
EPRViewInBase _viewInBase,
java.util.Map _m_l_DisplayableLinks)
Creates or sets some new simple negative-rights links (or updates the current simple links), which may be first-rate ones, in various cases. |
protected static java.util.Map |
detectAcsLinks(GraphicView _gview,
ViewInBase _viewInBase,
java.util.Map _upd_m_l_DisplayableLinks)
Defines the BRIDGE and ACL relations between all the ACS which are in the view, that are Bridge links between actors, or AclEntries between eligible parties and resources. |
java.util.Map |
detectBridges(EPRViewInBase _viewInBase,
java.util.Map _upd_m_l_DisplayableLinks,
BaseObject _center)
Defines the direct BRIDGE relations between the view objects. |
protected java.util.Map |
detectHardAliasesForReferences(EPRViewInBase _viewInBase,
java.util.Map _m_l_DisplayableLinks,
BaseObject _center)
Defines the links from an ACSObject as reference for its hard alias, when the objects are in the view. |
protected java.util.Map |
detectHardReferencesForAliases(EPRViewInBase _viewInBase,
java.util.Map _m_l_DisplayableLinks,
BaseObject _center)
Defines the links from an ACSObject as alias to its hard reference, when the objects are in the view. |
java.util.Map |
detectHiddenCompoundEpRights(GraphicView _gview,
EPRViewInBase _viewInBase,
java.util.Map _upd_m_l_DisplayableLinks)
This is the most complex Access Road method, which defines the effective applicable rights through all the access paths containing more than 3 nodes. |
java.util.Map |
detectLastSimpleSoftRunUnderDisplayableLinks(GraphicView _gview,
EPRViewInBase _viewInBase,
java.util.Map _upd_m_l_DisplayableLinks)
Adds a SOFT_RUN_UNDER relation between two view objects of the same ACS. |
protected java.util.Map |
detectReferencesForAliases(EPRViewInBase _viewInBase,
java.util.Map _m_l_DisplayableLinks,
BaseObject _center)
Defines the simple links from an ACSObject as alias to its reference, when all the objects are in the view. |
protected java.util.Map |
detectVirtualMembers(EPRViewInBase _viewInBase,
java.util.Map _m_l_DisplayableLinks,
BaseObject _center)
Defines the direct links from a VirtualFolder to its members, when all the objects are in the view, even if the member ACS does not manage the VirtualFolder rights propagation to members. |
void |
finalizeForProcess()
Finalizes the instance. |
protected DisplayableLinkImpl |
selectDirectHardAliasInViewForReference(EPRViewInBase _viewInBase,
ACSObject _ref)
Defines the link from an ACSObject as hard reference to its alias when the alias is in the view. |
protected DisplayableLinkImpl |
selectDirectHardReferenceInViewForAlias(EPRViewInBase _viewInBase,
ACSObject _alias)
Defines the link from an ACSObject as hard alias to its reference when the reference is in the view. |
java.util.Set<DisplayableLinkImpl> |
selectDirectHiddenMembersForVirtualFolder(GraphicView _gview,
EPRViewInBase _viewInBase,
ImmutableVirtualFolder _vf)
Detects the paths from a VirtualFolder to its members, considering the paths only if the member ACS manages the VirtualFolder rights propagation to the members. |
java.util.Set<DisplayableLinkImpl> |
selectDirectHiddenReferenceForAlias(GraphicView _gview,
EPRViewInBase _viewInBase,
ACSObject _ali)
Detects the references of an alias that are not in _viewInBase. |
protected java.util.Set<DisplayableLinkImpl> |
selectDirectReferencesInViewForAlias(EPRViewInBase _viewInBase,
ACSObject _alias)
Defines the links from an ACSObject as alias to its references when the references are in the view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Set<ImmutableSource> l_hiddenSourceToTest_
private java.util.Set<DisplayableLinkImpl> l_hiddenSourceLinks_
private java.util.Set<ImmutableGroupIDMember> l_ownersForOwnAndContainToTest_
private java.util.Set<ImmutableActor> l_actorsToTest_
private java.util.Set<ImmutableVirtualFolder> l_virtualFoldersToTest_
private java.util.Set<ImmutableGroupIDMember> l_ownersForXIDToTest_
private java.util.Set<DisplayableLinkImpl> l_currentOwnersLinks_
private java.util.Set<DisplayableLinkImpl> l_currentActorsLinks_
private java.util.Set<DisplayableLinkImpl> l_currentVirtualFoldersLinks_
private java.util.Set<DisplayableLinkImpl> l_hiddenOwnersLinks_
private java.util.Set<DisplayableLinkImpl> l_hiddenActorsLinks_
private java.util.Set<DisplayableLinkImpl> l_hiddenVirtualFoldersLinks_
private java.util.Set<DisplayableLinkImpl> l_allHiddenOwnersLinks_
private java.util.Set<DisplayableLinkImpl> l_allHiddenActorsLinks_
private java.util.Set<DisplayableLinkImpl> l_allHiddenVirtualFoldersLinks_
private java.util.Set<DisplayableLinkImpl> l_endOfLinks_
private java.util.Set<DisplayableLinkImpl> l_endOfLinks2_
private AlgorithmInterpreter interpreter_
private DisplayableLinkUtilities linkUtil_
private AclRightsFactoryImpl acl_
private AgoRightsFactoryImpl ago_
private PrivilegeRightsFactoryImpl pri_
private UtilityImpl utility_
Constructor Detail |
---|
protected CompoundRightsFactoryImpl(AlgorithmInterpreter _interpreter)
_interpreter
- algorithm interpreterMethod Detail |
---|
public final java.util.Map detectHiddenCompoundEpRights(GraphicView _gview, EPRViewInBase _viewInBase, java.util.Map _upd_m_l_DisplayableLinks) throws ProcessError, java.lang.InterruptedException
All the work may be viewed as building up new CNot.DisplayableLinkImpls from the list of the current ones, as the result of the analysis of rights and structure. This is why the main parameter is the map of all the current DisplayableLinkImpls, named _upd_m_l_DisplayableLinks. This map is filled with new DisplayableLinkImpls by each method like this one. A good start to understand this method is to read the code of the ThreeNodesRightsFactoryImpl class.
The search deep is up to 40 iterations, and all the access paths are found. To be fast and maintenable, this method is based on very structured loops that could be seen as elementay blocks. There are 3 main steps in this method:
- the initializing search defines all the simple DisplayableLinkImpls from the view nodes that are sources; this implies 9 cases, including 3 hooks for the AcsAddons,
- the central search extends these simple DisplayableLinkImpls in a continuous loop that ends only when there is no new path to found; this implies the test of 19 cases, including 7 tests for Actors, 8 tests for GroupIDMembers, 4 tests for Virtualfolders, with 3 tests on hooks for the AcsAddons on Actors, GroupIDMembers and VirtualFolders,
- the final search defines the last AccessControlLinkImpls from the current DisplayableLinkImpls to the view nodes that are targets; this implies the test of 14 cases, with 4 hooks for the AcsAddons, including 3 final tests for filtering about the rules to reject some DisplayableLinkImpls.
This method fills the resulting map with new DisplayableLinkImpls. There are two cases where a link has to be removed from the map after its insertion.
The first case is about the filtering of access paths to apply some priority rules among the AGO, PRI, ACL, BDG rights. Some of these priority rules may be from an AcsAddon, through the call to a method LinkRights.detectAddonPriorityInXXX(). These methods have the property to detect a prioritary link which enforces to remove one or several longer links. The inverse is not true, since a long link cannot enforce, by its existence, the removing of a shorter link. Caution: due to the sequence of calls to the ACS addons, the longer link may be added in the resulting map before the shorter link which produces the removing of this longer link.
The second case is for applying a rule on the virtual folders. This rule is 'virtual folder: an indirect access to a Resource that is not a virtual member, is always through a virtual member'. To detect this second case, the method DisplayableLinkUtilitites.getContainVirtualFolderWithoutMember() is called.
Called by RightsFactory_Facade.detectRights(). Calls selectDirectHiddenMembersForVirtualFolder(), AclRightsFactoryImpl.selectDirectHiddenExternalAclBridgeLinksToActorForEP(), addAclBridgeRightsInDisplayableLink(), AgoRightsFactoryImpl.selectHiddenDirectGroupIDForGroupIDMember(), selectHiddenDirectOwnerContainForActor(), selectHiddenDirectOwnerContainForTarget(), addOwnerContainRightsToDisplayableLink(), PrivilegeRightsFactoryImpl.selectDirectHiddenPrivilegeLinksForEP(), addPrivilegeInAccessControlLink(), and FactoryUtilities.withExecuteRight(), FactoryUtilities.detectPriorityInAllLinksAllRights(), DisplayableLinkImpl.getAllEndsInDisplayableLinks(), mergoTwoLinksCollection(), selectDisplayableLinksForSecondEnd().
_gview
- is the graphic view to update_viewInBase
- EPRViewInBase_upd_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update.
InterruptedException,
- ProcessError if there is a loop in the rights search
ProcessError
java.lang.InterruptedException
public final java.util.Map detectBridges(EPRViewInBase _viewInBase, java.util.Map _upd_m_l_DisplayableLinks, BaseObject _center)
_viewInBase
- EPRViewInBase_upd_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update._center
- is the central object of a sketch view. Null if it is not a sketch view.
protected static final java.util.Map detectAcsLinks(GraphicView _gview, ViewInBase _viewInBase, java.util.Map _upd_m_l_DisplayableLinks)
_gview
- is the graphic view associated to the view_viewInBase
- is the view_upd_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update.
public final java.util.Map addPathFromNegativeRightsInOneACS(GraphicView _gview, EPRViewInBase _viewInBase, java.util.Map _m_l_DisplayableLinks) throws java.lang.InterruptedException
- if there is a non-simple DisplayableLinkImpl (A to B) having negative right(s) in its last AccessControlLink, a new simple link (A to B) is created with a copy of these negative rights, or, if there is already a simple link, these negative rights are copied into it.
- if there is a simple negative-right DisplayableLinkImpl (A to B) while there are an indirect positive-rights or structural paths from A to B through one or several nodes of the view, the link (A to B) is set as 'first-rate' to say that the negative right is a prioritary one, and that A cannot access to B through the other view nodes.
If the negative rights of the non-simple DisplayableLinkImpl are from several types, all the negative rights are added. Thus, the resulting simple link has one of the applicable types: AccessControlLink.NEG_TPRI is the prioritary one, or AccessControlLink.NEG_LPRI, and AccessControlLink.NEG_ACL is the last one. This method uses the indicator 'AccessControlLink.C_COPIED_FROM_LINK' when a current simple DisplayableLinkimpl is updated with the negative rights of another DisplayableLinkImpl. This method uses a metaright '|transfer_all_rights|' to indicate a structural link.
The results of this method may be changed by an AcsAddon, through the call to the heavy method NodeRights.detectAddonFinalAllNodes() after this method.
Called by RightsFactory_Facade.detectEPRRights(). Calls RightsFactory_Facade.getFirstShapeEffectiveRights() and linkUtil_.containsIndirectPaths().
_gview
- is the graphic view to update_viewInBase
- EPRViewInBase_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update.
java.lang.InterruptedException
protected final java.util.Map detectVirtualMembers(EPRViewInBase _viewInBase, java.util.Map _m_l_DisplayableLinks, BaseObject _center)
_viewInBase
- the EPRViewInBase to analyze_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update._center
- the central object of a sketch view. Null if it is not a sketch view.
protected final java.util.Map detectReferencesForAliases(EPRViewInBase _viewInBase, java.util.Map _m_l_DisplayableLinks, BaseObject _center)
_viewInBase
- the EPRViewInBase to analyze_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update._center
- the central object of a sketch view. Null if it is not a sketch view.
protected final java.util.Map detectHardReferencesForAliases(EPRViewInBase _viewInBase, java.util.Map _m_l_DisplayableLinks, BaseObject _center)
_viewInBase
- the EPRViewInBase to analyze_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update._center
- the central object of a sketch view. Null if it is not a sketch view.
protected final java.util.Map detectHardAliasesForReferences(EPRViewInBase _viewInBase, java.util.Map _m_l_DisplayableLinks, BaseObject _center)
_viewInBase
- the EPRViewInBase to analyze_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view, and to update._center
- the central object of a sketch view. Null if it is not a sketch view.
protected final java.util.Set<DisplayableLinkImpl> selectDirectReferencesInViewForAlias(EPRViewInBase _viewInBase, ACSObject _alias)
Calls ACS.getReferenceOfSoftAlias() which may be a heavy processing load in some ACS. Called by detectHiddenCompoundEpRights(), detectReferencesForAliases() and ThreeNodesRightsFactoryImpl.endsPathsFromActorWithAclBridgePrivilege(), endsPathsFromVirtualFolderWithMemberAlias(), selectOneHiddenNodePathsForVirtualFolder(), selectOneHiddenNodePathsForFirstLinkPrivileges(). Synchronized to _viewInBase from the GraphicView call.
_viewInBase
- the EPRViewInBase_alias
- may be an alias or not. Never null.
protected final DisplayableLinkImpl selectDirectHardReferenceInViewForAlias(EPRViewInBase _viewInBase, ACSObject _alias)
Called by selectDirectReferencesInViewForAlias() and detectHardReferencesForAliases(). Synchronized to _viewInBase from the GraphicView call.
_viewInBase
- the EPRViewInBase_alias
- may be an alias or not. Never null.
protected final DisplayableLinkImpl selectDirectHardAliasInViewForReference(EPRViewInBase _viewInBase, ACSObject _ref)
Called by detectHardAliasesForReferences(). Synchronized to _viewInBase from the GraphicView call.
_viewInBase
- the EPRViewInBase_ref
- may be an alias reference or not. Never null.
public final java.util.Set<DisplayableLinkImpl> selectDirectHiddenMembersForVirtualFolder(GraphicView _gview, EPRViewInBase _viewInBase, ImmutableVirtualFolder _vf)
Trees of virtual folders are possible. There is no privilege inheritance in the tree for the generic gBase classes, while an AcsAddon may override the hook methods.
Called by CompoundRightsFactoryImpl.detectHiddenCompoundEpRights() and ThreeNodesRightsFacoryImpl.selectOneHiddenNodePathsForVirtualFolder().
_gview
- is the graphic view to update_viewInBase
- view on which _gview is based_vf
- is in _viewInBase or not
public final java.util.Set<DisplayableLinkImpl> selectDirectHiddenReferenceForAlias(GraphicView _gview, EPRViewInBase _viewInBase, ACSObject _ali)
Generally speaking, the hard alias transfers directly its rights as target to its reference, including its Account/Groups context. If the elements of the AG context are not yet in the path, this may define new links, from the reference to each account or group of the context. This is called the propagation of the indirect AG context, and the alias relation is alone to handle that in Access Road. There is no such a propagation in an AclEntry relation, even if it transfers the direct AG context. The case occurs when an Actor is an alias running as actor under an account, if, in the path, the nodes before this actor do not transmit their proper AG context. The responsability of this method is not to set the good AG context on the reference. It does not know the current paths having _ali as second end. But it is the responsibility of the caller of this method to handle properly the reference AG context (see the ARoad0.gBase.CAliasImpl documentation).
In this version, the visible space of the _ali ACS is not considered in the search for the external soft aliases. All the open ACS are considered. Called by CompoundRightsFactoryImpl.detectHiddenCompoundEpRights() and ThreeNodesRightsFacoryImpl.selectOneHiddenNodePathsForVirtualFolder(), addPathsFromActorStartsUnderGroupIDMember(), addPathsFromActorAliasReference() and addPathsFromGroupIDMemberAliasReference().
_gview
- is the graphic view to update_viewInBase
- view on which _gview is based_ali
- is in _viewInBase or not
CAliasImpl
public final java.util.Map detectLastSimpleSoftRunUnderDisplayableLinks(GraphicView _gview, EPRViewInBase _viewInBase, java.util.Map _upd_m_l_DisplayableLinks)
This method has to be called at the end of the access paths search. If the two view objects are not from the same ACS, or if a simple link for the same ends does already exist, this method does not operate. Called only by RightsFactory_Facade.detectEPRRights().
_gview
- is the graphic view to update_viewInBase
- EPRViewInBase_upd_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair).
Never null. May be updated by new simple links.
public void finalizeForProcess()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |