|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gWork.RightsFactory_Facade
public class RightsFactory_Facade
This class is the "facade" (GoF design pattern) for all the core algorithms about the sequence of method calls in the access paths search. This work may be summarized as building up new CNot.DisplayableLinkImpls from the old ones, as the result of the analysis of rights and structures. The main parameter to handle is the map of all the current DisplayableLinkImpls, usually named _m_l_DisplayableLinks. At each method call, this map is filled with new DisplayableLinkImpls, and at the end, Gui2.GraphicView reads the map to display the view diagram and the view 'See why' text.
This class is stateless. For each ViewInBase, RightsMediatorImpl at its creation setups an instance of this class for its ViewInBase, to be processed in a worker thread. The architecture view and the sketch view are the two exceptions. They are not managed by RightsMediatorImpl. They use specific static methods and they are processed in the event dispatch thread or the main thread. No direct call to the ACS methods. Called by Gui1, Gui2 and gDMak objects. For the EPR and the NoThan ViewInBases, only Gui2.GraphicEPRView and Gui2.GraphiNoThanView are the consumers.
Field Summary | |
---|---|
private FactoryUtilities |
factoryUtil_
|
private static int |
INITIAL_CAPACITY
|
private AlgorithmInterpreter |
interpreter_
|
private java.util.Set<java.lang.String> |
l_lastLinkStringResult_
|
private java.util.Set<StringRight> |
l_noActorResult_
|
private java.util.Set<StringRight> |
l_result_
|
private DisplayableLinkUtilities |
linkUtil_
|
private UtilityImpl |
utility_
|
Constructor Summary | |
---|---|
RightsFactory_Facade(AlgorithmInterpreter _interpreter)
only one constructor |
Method Summary | |
---|---|
java.util.Map |
detectEPRRights(GraphicEPRView _gview,
EPRViewInBase _viewInBase,
boolean _detectACL,
boolean _detectAGO,
boolean _detectPRI,
boolean _detectLargeLinks)
Detects the access paths between BaseObjects in an EPRViewInBase. |
java.util.Map |
detectNoThanRights(GraphicNoThanView _gview,
NoThanViewInBase _viewInBase)
Detects if the No-More-Than and No-Less-Than rights criteria are fulfilled or not. |
static java.util.Map |
detectRights(GraphicView _gview,
ViewInBase _viewInBase)
Defines the BRIDGE and ACL relations between all the ACS which are in the view, that are Bridge links between actors, or AclEntries between EligibleParties and resources. |
static java.util.Map |
detectSketchRights(EPRViewInBase _viewInBase,
BaseObject _center,
boolean _detectAcl,
boolean _detectUserGroupLinks)
Detects access-control links between BaseObjects in _viewModel, for a sketch view on a central object rights. |
void |
finalizeForProcess()
Finalizes the instance. |
StringRight |
fulfilNoThanRightCriteria(java.util.Map _m_l_DisplayableLinks,
StringRight _right,
boolean _moreCriterion)
Tests the rights in the last AccessControlLink of each DisplayableLink, to say if the criterion right is fulfilled or not. |
java.lang.String |
getEffectiveRightsForPair(BaseObject _so,
BaseObject _tg,
java.util.Map _m_l_DisplayableLinks)
This important method selects the current effective rights from the DisplayableLinkImpls associated to each BaseObject pair, for an EPR ViewInBase. |
javax.swing.JTextPane |
getEPRWhyText(GraphicEPRView _gview,
java.util.Map _m_l_DisplayableLinks,
EPRViewInBase _view)
Constructs a JTextPane with all the DisplayableLinks and AccessControlLinks, to be displayed as a comment for the GraphicView associated to _m_l_DisplayableLinks. |
java.util.Map<ImmutableName,java.util.Set<StringRight>> |
getFirstShapeEffectiveRights(java.util.Map _m_l_DisplayableLinks)
Sets the current effective rights from the DisplayableLinks associated to each BaseObject pair in a view, after a parsing of all the direct and indirect paths from the first end to the second end of the pair. |
javax.swing.JTextPane |
getNoThanWhyText(GraphicNoThanView _gview,
java.util.Map _m_l_DisplayableLinks,
NoThanViewInBase _view)
Constructs a JTextPane with all the DisplayableLinks and AccessControlLinks, to be displayed as a comment for the GraphicNoThanView associated to _m_l_DisplayableLinks. |
static javax.swing.JTextPane |
getWhyText(GraphicView _gview,
java.util.Map _m_l_DisplayableLinks,
ViewInBase _view)
Constructs a JTextPane with all the DisplayableLinks and AccessControlLinks, to be displayed as a comment for the GraphicView associated to _m_l_DisplayableLinks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int INITIAL_CAPACITY
private java.util.Set<StringRight> l_result_
private java.util.Set<StringRight> l_noActorResult_
private java.util.Set<java.lang.String> l_lastLinkStringResult_
private AlgorithmInterpreter interpreter_
private FactoryUtilities factoryUtil_
private DisplayableLinkUtilities linkUtil_
private UtilityImpl utility_
Constructor Detail |
---|
RightsFactory_Facade(AlgorithmInterpreter _interpreter)
Method Detail |
---|
public final java.util.Map detectEPRRights(GraphicEPRView _gview, EPRViewInBase _viewInBase, boolean _detectACL, boolean _detectAGO, boolean _detectPRI, boolean _detectLargeLinks) throws ProcessError, java.lang.InterruptedException
_gview
- graphic view associated to the view_viewInBase
- the view to analyze_detectACL
- true for detecting the pure AclEntry access paths_detectPRI
- true for detecting the pure Privilege access paths_detectAGO
- true for detecting the AGO access paths_detectLargeLinks
- true for detecting the access paths having
more than 3 nodes
ProcessError
- if there is a loop in the rights search
java.lang.InterruptedException
public static final java.util.Map detectRights(GraphicView _gview, ViewInBase _viewInBase) throws ProcessError, java.lang.InterruptedException
_gview
- is the graphic view associated to the view_viewInBase
- is the view to analyze
ProcessError
- if
java.lang.InterruptedException
public static final java.util.Map detectSketchRights(EPRViewInBase _viewInBase, BaseObject _center, boolean _detectAcl, boolean _detectUserGroupLinks) throws ProcessError, java.lang.InterruptedException
_viewInBase
- is the view to analyze_center
- is the central object of a sketch view_detectAcl
- true for detecting aclEntry links._detectUserGroupLinks
- true for detecting
userID and groupID ACS-specific access-control links.
ProcessError
- if there is a loop in the rights search
java.lang.InterruptedException
public final java.util.Map detectNoThanRights(GraphicNoThanView _gview, NoThanViewInBase _viewInBase) throws ProcessError, java.lang.InterruptedException
At most, there are two DisplayableLinks in the returned map, where the second end is the view target, and the first end is one of view EPs, or one of the members, or one of the running-under actors.
This method calls all the methods used by detectEPRRights() for the paths search, excepted for the method CompoundRightsFactoryImpl.detectLastSimpleSoftRunUnderDisplayableLinks(). For each elementary pair (EP of the checking perimeter, first target), it searches the rights in creating a dedicated EPRViewInBase with a constant name. If the resulting rights do not comply with the two criterion during the iteration on all the tested EP, the general search is ended. The transient EPRViewInBases are usable because the RightsMediator of the NoThanViewInBase manages all the BaseObjects of the view checking perimeter. They works also because, when some methods find access paths through hidden intermediate nodes which are in the NoThanViewInBase, this simply accelerates the final result and does not change it.
This method is called from several worker threads. Called by GraphicNoThanView.initialize(), that synchronizes on _viewInBase, and called by resetRights(), but the result is indeed processed by GraphicNoThanView.resetCriteria(). Calls NoThanViewInBase.getCheckingPerimeter(), getMoreCriterion(), getLessCriterion() and all the methods called by detectEPRrights().
_gview
- the graphic view associated to the view_viewInBase
- view to analyze
ProcessError
- if there is a loop in the rights search
java.lang.InterruptedException
public final java.lang.String getEffectiveRightsForPair(BaseObject _so, BaseObject _tg, java.util.Map _m_l_DisplayableLinks)
- (EligibleParty, Basic or VirtualFolder),
- (GroupIDMember, GroupIDMember),
- (Actor, GroupIDMember), for actors with currentUID/GID,
- (VirtualFolder, Basic),
in an EPRViewInBase, and :
- by the way of a simple 'add' operation, plus some indicators as 'acl', for positive rights.
- by the way of 'remove' operations when a negative acl forbids a right, or when 'no rights' forbids all rights.
The negative-right types are displayed only if the link is simple. These negative rights are then subtracted from the positive rights in the other links.
If a DisplayableLinkImpl contain an Actor, adds '
_so
- BaseObject of the view_tg
- BaseObject of the view_m_l_DisplayableLinks
- immutable Map of DisplayableLinks lists.
May update the last AccessControlLink of each DisplayableLink.
AccessControlLink
,
UtilityImpl.subtractNegativeNotRemovingInOneACS(java.util.Set, java.util.Set, ARoad0.gBaseInterface.ImmutableACS, boolean)
,
DisplayableLinkUtilities.getEffectiveRightsAndCommentOnRights(ARoad0.CNot.DisplayableLinkImpl, boolean)
public static final javax.swing.JTextPane getWhyText(GraphicView _gview, java.util.Map _m_l_DisplayableLinks, ViewInBase _view)
_gview
- is the graphic view associated to the view_m_l_DisplayableLinks
- is an immutable Map of DisplayableLinks lists._view
- associated to _m_l_DisplayableLinks
public final javax.swing.JTextPane getEPRWhyText(GraphicEPRView _gview, java.util.Map _m_l_DisplayableLinks, EPRViewInBase _view)
_gview
- is the graphic view associated to the view_m_l_DisplayableLinks
- is an immutable Map of DisplayableLinks lists._view
- associated to _m_l_DisplayableLinks
public final javax.swing.JTextPane getNoThanWhyText(GraphicNoThanView _gview, java.util.Map _m_l_DisplayableLinks, NoThanViewInBase _view)
_gview
- is the graphic view associated to the view_m_l_DisplayableLinks
- is an immutable Map of DisplayableLinks lists._view
- associated to _m_l_DisplayableLinks
public final java.util.Map<ImmutableName,java.util.Set<StringRight>> getFirstShapeEffectiveRights(java.util.Map _m_l_DisplayableLinks)
This method is a simplified form of getEffectiveRightsForPair() with a different return. The negative types in the last access control link are processed. Each key into the argument _m_l_DisplayableLinks has to produce a key in the result, and an empty set for a key means it is a structural link.
. Called by detectEPRRights(), detectNoThanrights(), and by CompoundRightsFactoryImpl.addPathFromNegativeRightsInOneACS(), by fulfilNoThanRightCriteria() for the NoThan ViewInBases. Calls FactoryUtilities.isActivePath(), UtilityImpl.selectHeaders() and DisplayableLinkUtilities.getEffectiveRightsAndComment().
_m_l_DisplayableLinks
- Map of DisplayableLinks lists (one per pair)
associated to the view. No update.
public final StringRight fulfilNoThanRightCriteria(java.util.Map _m_l_DisplayableLinks, StringRight _right, boolean _moreCriterion)
_m_l_DisplayableLinks
- is an immutable Map of DisplayableLinks lists
for one couple of BaseObjects in a view_right
- is the more or less criterion_moreCriterion
- true for checking a more criterion, and false for a less criterion
public void finalizeForProcess()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |