|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.platform.admin.apiimpl.PermissionDataNodeTreeViewImpl
public class PermissionDataNodeTreeViewImpl
Provides a view into the tree of PermissionDataNodes and supports utility
methods that perform funcions on the tree as a whole.
A property can be set (or toggled) to determine if clients want methods to return nodes marked
hidden. See setShowHidden(boolean).
| Constructor Summary | |
|---|---|
PermissionDataNodeTreeViewImpl(PermissionNode root)
Construct a PermissionDataNode. |
|
| Method Summary | |
|---|---|
boolean |
allDescendantsShareActions(PermissionNode startingPoint)
Determine whether all descendants of the given node share the exact same actions as the given node. |
protected PermissionDataNodeImpl |
assertPermissionDataNode(PermissionNode node)
Perform safe runtime casts. |
java.util.Iterator |
breadthFirstIterator()
Obtain a breadth-first Iterator over the whole tree starting at the root. |
java.util.Iterator |
breadthFirstIterator(PermissionNode startingPoint)
Obtain a breadth-first Iterator starting at the given node. |
java.util.List |
getChildren(PermissionNode parent)
Obtain the set of entries that are considered the children of the specified PermissionDataNode. |
java.util.List |
getDescendants(PermissionNode startingPoint)
Obtain all the PermissionDataNodes in the tree under the given
node. |
java.util.List |
getDescendantsWithActions(PermissionNode startingPoint,
AuthorizationActions actions,
boolean strict)
Obtain all the PermissionDataNodes in the tree under the given
node. |
java.util.Set |
getMarked()
Obtain all the marked PermissionDataNodes in the tree. |
java.util.Set |
getMarkedDescendants(PermissionNode startingPoint)
Obtain all the marked PermissionDataNodes in the tree under the given
node. |
java.util.List |
getModified()
Obtain all the modified PermissionDataNodes in the tree.This method will get hidden nodes if showHidden == true. |
java.util.List |
getModifiedBreadthFirst()
Obtain the modified PermissionDataNodes closest to the root in the tree. |
java.util.List |
getModifiedDescendants(PermissionNode startingPoint)
Obtain all the modified PermissionDataNodes in the tree under the
given node. |
PermissionNode |
getParent(PermissionNode node)
Determine the parent PermissionDataNode for the specified entry, or null if
the specified entry is a root. |
PermissionNode |
getRoot()
Obtain the root PermissionDataNode of the tree. |
java.util.List |
getRoots()
Obtain a list of PermissionDataNodes which are the children of the root. |
java.util.List |
getUnModifiedDescendants(PermissionNode startingPoint)
Obtain all the unmodified PermissionDataNodes in the tree under the
given node. |
void |
hideAllSystemNodes()
Hide all nodes whose resource name starts with "System". |
boolean |
isAncestorOf(PermissionNode ancestor,
PermissionNode descendant)
Determine whether the given descendant is a descendant of the given
ancestor.This method will check all ancesters of the descendant, even if they are marked hidden. |
boolean |
isDescendantOf(PermissionNode ancestor,
PermissionNode descendant)
Determine whether the given descendant is a descendant of the given
ancestor.This method will check all descendants of the ancester, even if they are marked hidden. |
java.util.Iterator |
iterator()
Obtain a depth-first Iterator over the whole tree starting at the root. |
java.util.Iterator |
iterator(PermissionNode startingPoint)
Obtain a depth-first Iterator starting at the given node. |
void |
resetTree()
Reset all tree nodes to their original AuthorizationActions values. |
void |
setBranchAllowedActions(PermissionNode startingPoint,
AuthorizationActions actions)
Set the allowed AuthorizationActions for the subtree rooted at this node (inclusive). |
void |
setBranchHidden(PermissionNode startingPoint)
Set the subtree rooted at this node as hidden (inclusive). |
void |
setMarked(PermissionNode entry,
boolean markedState)
(Un)Mark this node. |
java.util.Collection |
setPermissions(java.util.Collection permissions)
Set the permissions on the node containing each permission's resource. |
void |
setShowHidden(boolean showHidden)
Determines whether methods in this class return hidden nodes in results. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PermissionDataNodeTreeViewImpl(PermissionNode root)
PermissionDataNode.
| Method Detail |
|---|
protected PermissionDataNodeImpl assertPermissionDataNode(PermissionNode node)
node - The node to check.
public void setShowHidden(boolean showHidden)
false (don't show hidden nodes).
setShowHidden in interface PermissionTreeViewshowHidden - If true, hidden nodes will be returned in results, if
false, they will not.public void hideAllSystemNodes()
hideAllSystemNodes in interface PermissionDataNodeTreeView
public void setMarked(PermissionNode entry,
boolean markedState)
setMarked in interface PermissionTreeViewentry - The node to mark or unmark.markedState - If true, the node will be marked, if false,
the node will be unmarked.public java.util.Iterator iterator(PermissionNode startingPoint)
Iterator starting at the given node.
iterator in interface PermissionTreeViewpublic java.util.Iterator iterator()
Iterator over the whole tree starting at the root.
iterator in interface PermissionTreeViewpublic java.util.Iterator breadthFirstIterator(PermissionNode startingPoint)
Iterator starting at the given node.
breadthFirstIterator in interface PermissionTreeViewpublic java.util.Iterator breadthFirstIterator()
Iterator over the whole tree starting at the root.
breadthFirstIterator in interface PermissionTreeViewpublic PermissionNode getRoot()
PermissionDataNode of the tree. The root of this tree is always
hidden but will always be returned even if the state of showHidden is
false.
getRoot in interface PermissionTreeViewpublic java.util.List getRoots()
PermissionDataNodes which are the children of the root. These
nodes are the real roots of the tree, since the root is just a placeholder that holds
the real roots.
getRoots in interface PermissionTreeViewPermissionDataNodes that are the roots of the forest.public PermissionNode getParent(PermissionNode node)
PermissionDataNode for the specified entry, or null if
the specified entry is a root.
getParent in interface PermissionTreeViewnode - the PermissionDataNode instance for which the parent is to be obtained;
may not be null
public java.util.List getChildren(PermissionNode parent)
PermissionDataNode.
getChildren in interface PermissionTreeViewparent - the PermissionDataNode instance for which the child entries
are to be obtained; may not be null
PermissionDataNode instances that are considered
the children of the specified entry; never null but possibly empty
public boolean isAncestorOf(PermissionNode ancestor,
PermissionNode descendant)
descendant is a descendant of the given
ancestor.
ancestor - The node to check to see if it is an ancestor of the descendant.descendant - The node to check to see if it is a descendant ancestor.
true if ancestor is the ancestor of descendant.
public boolean isDescendantOf(PermissionNode ancestor,
PermissionNode descendant)
descendant is a descendant of the given
ancestor.
isDescendantOf in interface PermissionTreeViewancestor - The node to check to see if it is an ancestor of the descendant.descendant - The node to check to see if it is a descendant ancestor.
true if ancestor is the ancestor of descendant.
public void setBranchAllowedActions(PermissionNode startingPoint,
AuthorizationActions actions)
AuthorizationActions for the subtree rooted at this node (inclusive).
entry - The node to mark or unmark.actions - The actions to allow on this node and its descendants.public void setBranchHidden(PermissionNode startingPoint)
setBranchHidden in interface PermissionTreeViewentry - The node to mark or unmark.setShowHiddenpublic void resetTree()
AuthorizationActions values.
resetTree in interface PermissionTreeViewpublic java.util.Set getMarked()
PermissionDataNodes in the tree. Note that the
nodes are not nessesarily in tree form. They are just a collection of nodes.showHidden == true.
getMarked in interface PermissionTreeViewSet of all marked nodes in the tree.public java.util.Set getMarkedDescendants(PermissionNode startingPoint)
PermissionDataNodes in the tree under the given
node. Note that the nodes are not nessesarily in tree form. They are just a
collection of nodes.
showHidden == true.
getMarkedDescendants in interface PermissionTreeViewSet of all marked nodes in the tree below startingPoint.public java.util.List getDescendants(PermissionNode startingPoint)
PermissionDataNodes in the tree under the given
node. Note that the nodes are not nessesarily in tree form. They are just a
collection of nodes.
showHidden == true.
getDescendants in interface PermissionTreeViewstartingPoint - The point in the tree to start the search for descendants.
List of all nodes in the tree below startingPoint.
public java.util.List getDescendantsWithActions(PermissionNode startingPoint,
AuthorizationActions actions,
boolean strict)
PermissionDataNodes in the tree under the given
node. Note that the nodes are not nessesarily in tree form. They are just a
collection of nodes.
showHidden == true.
startingPoint - The point in the tree to start the search for descendants.actions - Get only those descendants that possess the given AuthorizationActions.strict - If true, get only those descendants with actions equal to
the given actions.
List of all nodes in the tree below startingPoint that
possess the given actions.public java.util.List getModified()
PermissionDataNodes in the tree.showHidden == true.
getModified in interface PermissionTreeViewList of all modified nodes in the tree.public java.util.List getModifiedBreadthFirst()
PermissionDataNodes closest to the root in the tree.
showHidden == true.
getModifiedBreadthFirst in interface PermissionTreeViewList of all top level modified nodes in the tree.public java.util.List getModifiedDescendants(PermissionNode startingPoint)
PermissionDataNodes in the tree under the
given node. Note that the nodes are not nessesarily in tree form.
showHidden == true.
getModifiedDescendants in interface PermissionTreeViewList of all modified nodes in the tree below startingPoint.public java.util.List getUnModifiedDescendants(PermissionNode startingPoint)
PermissionDataNodes in the tree under the
given node. Note that the nodes are not nessesarily in tree form.
showHidden == true.
getUnModifiedDescendants in interface PermissionTreeViewList of all unmodified nodes in the tree below startingPoint.public boolean allDescendantsShareActions(PermissionNode startingPoint)
showHidden.
allDescendantsShareActions in interface PermissionDataNodeTreeViewstartingPoint - The root of the subtree to check.public java.util.Collection setPermissions(java.util.Collection permissions)
setPermissions in interface PermissionDataNodeTreeViewpermissions - The Collection of BasicAuthorizationPermissions to set
(each contains the the resource and an AuthorizationAction.)
Collection of DataNodeExceptionss each containing
a resource name that was not found in the tree.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||