|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.metamatrix.common.tree.basic.BasicTreeNode com.metamatrix.platform.admin.apiimpl.PermissionDataNodeImpl
public class PermissionDataNodeImpl
Defines a tree node for displaying entitlements.
Field Summary |
---|
Fields inherited from class com.metamatrix.common.tree.basic.BasicTreeNode |
---|
DELIMITER, DELIMITER_CHAR |
Constructor Summary | |
---|---|
PermissionDataNodeImpl(BasicTreeNode parent,
AuthorizationActions allowedActions,
PermissionDataNodeDefinition nodeDefinition,
boolean nodeIsPhysical,
ObjectID guid)
Construct a new instance by specifying the parent that owns this entity, the name of the instance, the type of the instance and the global UID for the instance. |
Method Summary | |
---|---|
boolean |
actionsAreEqual(AuthorizationActions actions)
Determine if this node's AuthorizationActions are equal to the given actions. |
boolean |
actionsAreEqual(PermissionNode node)
Determine if this node's AuthorizationActions are equal to the given node's
actions. |
boolean |
actionsAreEqual(java.lang.String[] actions)
Determine if this node's AuthorizationActions are equal to the given actions. |
boolean |
allChildrenEnabledFor(AuthorizationActions actions)
Do all> children of this node share the given AuthorizationActions ? |
static int |
compare(PermissionDataNodeImpl obj1,
PermissionDataNodeImpl obj2)
Utility method to compare two PermissionDataNodeImpl instances. |
int |
compareTo(java.lang.Object obj)
Compares this object to another. |
boolean |
equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. |
java.lang.String[] |
getActionLabels()
The AuthorizationActions labels currently on this data node. |
AuthorizationActions |
getActions()
The AuthorizationActions currently on this data node. |
AuthorizationActions |
getAllowedActions()
The AuthorizationActions allowed on this data node. |
int |
getDataNodeType()
Get the type of this PermissionDataNode . |
AuthorizationActions |
getDescendantActions()
Get the actions allowed by all descendants. |
java.lang.String |
getDisplayName()
Display name for node. |
AuthorizationActions |
getOriginalActions()
Get the original actions this node was created with. |
java.lang.String |
getResourceName()
Resource name for node (the DataNodeID). |
ObjectID |
getUUID()
The node's unique ID. |
int |
hashCode()
Override hashCode() to be consistant with overriden equals(). |
boolean |
hasPermission()
Does this node have any permission associated with it? Note: if hasPermission() returns false ,
there will be no AuthorizatinPoicyID associated with this node
and getPolicyID() will return null . |
boolean |
isDescendantEnabled()
Are there any entitled nodes below this point in the tree? |
boolean |
isDescendantEnabledFor(AuthorizationActions actions)
Does this node have any descendants enabled for the given AuthorizationActions ? |
boolean |
isGroupNode()
Is this node a group (has only one level of children)? |
boolean |
isHidden()
Check whether or not this node is hidden from the PermissionDataNodeTreeView . |
boolean |
isLeafNode()
Is this node a leaf? |
boolean |
isPhysical()
Does this node belong to a physical model? |
boolean |
isRecursive()
A node is recursive if its actions are shared by its descendants' actions. |
java.lang.String |
printDebug()
Return stringafied representation of the object. |
void |
setActions(AuthorizationActions actions)
Set the AuthorizationActions on this data node. |
void |
setActions(int actions)
Set the allowed AuthorizationActions on this data node. |
void |
setAllowedActions(AuthorizationActions actions)
Set the allowed AuthorizationActions on this data node. |
void |
setHidden(boolean isHidden)
Set whether or not this node is hidden from the PermissionDataNodeTreeView . |
java.lang.String |
toString()
Return stringafied representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.metamatrix.common.tree.TreeNode |
---|
exists, getFullName, getName, getNamespace, getSeparator, getSeparatorChar, getType, isModified |
Constructor Detail |
---|
public PermissionDataNodeImpl(BasicTreeNode parent, AuthorizationActions allowedActions, PermissionDataNodeDefinition nodeDefinition, boolean nodeIsPhysical, ObjectID guid)
parent
- the parent that is considered the owning namespace for this
instance; may be null if the new instance is to be the rootallowedActions
- Contain the only actions that will be allowed on this node.nodeDefinition
- The "type" of this treeNode which contains the "subtype"
of the PermissionDataNode
: PermissionDataNodeDefinition.TYPE
nodeIsPhysical
- Is this node physical are virtual.guid
- the globally-unique identifier for this instance; may not be nullMethod Detail |
---|
public int getDataNodeType()
PermissionDataNode
.
PermissionDataNodeDefinition.TYPE
.
getDataNodeType
in interface PermissionDataNode
PermisionDataNode
.public java.lang.String getDisplayName()
getDisplayName
in interface PermissionNode
public java.lang.String getResourceName()
getResourceName
in interface PermissionNode
public boolean isPhysical()
isPhysical
in interface PermissionDataNode
true
if this node is part of a physical model.public boolean hasPermission()
hasPermission()
returns false
,
there will be no AuthorizatinPoicyID
associated with this node
and getPolicyID()
will return null
.
hasPermission
in interface PermissionNode
Action
other than NONE
.public ObjectID getUUID()
getUUID
in interface PermissionNode
public java.lang.String[] getActionLabels()
AuthorizationActions
labels currently on this data node.
getActionLabels
in interface PermissionNode
com.metatamatrix.platform.security.api.StandardAuthorizationActions
public AuthorizationActions getActions()
AuthorizationActions
currently on this data node.
getActions
in interface PermissionNode
com.metatamatrix.platform.security.api.StandardAuthorizationActions
public AuthorizationActions getAllowedActions()
AuthorizationActions
allowed on this data node.
getAllowedActions
in interface PermissionNode
com.metatamatrix.platform.security.api.StandardAuthorizationActions
public void setActions(AuthorizationActions actions) throws PermissionNodeNotActionableException
AuthorizationActions
on this data node.
setActions
in interface PermissionNode
actions
- The the actions to set on this data node.
PermissionNodeNotActionableException
- If attempt is made to set actions on a node that can't
accept any actions.public void setActions(int actions) throws PermissionNodeNotActionableException
AuthorizationActions
on this data node.
setActions
in interface PermissionNode
actions
- The the actions to set on this data node.
PermissionNodeNotActionableException
- If attempt is made to set actions on a node that can't
accept any actions.public AuthorizationActions getOriginalActions()
public void setAllowedActions(AuthorizationActions actions)
AuthorizationActions
on this data node.
actions
- The the actions that can be applied to this data node.public boolean actionsAreEqual(AuthorizationActions actions)
AuthorizationActions
are equal to the given actions. The actions
are considered equal if number of actions are the same and all corresponding pairs of actions
are equal.
actionsAreEqual
in interface PermissionNode
actions
- The AuthorizationActions
to compare with this node's actions.
Actions
of this node are equal to the given actions.public boolean actionsAreEqual(java.lang.String[] actions)
AuthorizationActions
are equal to the given actions. The actions
are considered equal if number of actions are the same and all corresponding pairs of actions
are equal.
actionsAreEqual
in interface PermissionNode
actions
- The Array Actions
of this node are equal to the given actions.public boolean actionsAreEqual(PermissionNode node)
AuthorizationActions
are equal to the given node's
actions. The actions are considered equal if number of actions are the same and all
corresponding pairs of actions are equal.
actionsAreEqual
in interface PermissionNode
node
- The node whose actions to compare with this node's actions.
Actions
of this node are equal to the given node's actions.public boolean isDescendantEnabled()
isDescendantEnabled
in interface PermissionDataNode
public boolean isDescendantEnabledFor(AuthorizationActions actions)
AuthorizationActions
?
isDescendantEnabledFor
in interface PermissionDataNode
actions
- The actions of interest.
public boolean allChildrenEnabledFor(AuthorizationActions actions)
AuthorizationActions
?
actions
- The actions of interest.
public boolean isRecursive()
true
if this node is recursive.public boolean isHidden()
PermissionDataNodeTreeView
. The
default is false
, the node is not hidden.
isHidden
in interface PermissionNode
true
if this node may be hidden from the view.PermissionTreeView.setShowHidden(boolean)
public void setHidden(boolean isHidden)
PermissionDataNodeTreeView
. The
default is false
, the node is not hidden.
setHidden
in interface PermissionNode
isHidden
- If true
, this node may be hidden from the view.PermissionTreeView.setShowHidden(boolean)
public boolean isLeafNode()
isLeafNode
in interface PermissionNode
true
, if this node has no children.public boolean isGroupNode()
isGroupNode
in interface PermissionDataNode
true
, if this node has only on level of children.public AuthorizationActions getDescendantActions()
public boolean equals(java.lang.Object obj)
compareTo()
.
equals
in interface TreeNode
equals
in class BasicTreeNode
obj
- the object that this instance is to be compared to.
public int compareTo(java.lang.Object obj)
PermissionDataNodeImpl
class, then this method throws a
ClassCastException (as instances are comparable only to instances of the same
class).
Note: this method is consistent with equals()
, meaning
that (compare(x, y)==0) == (x.equals(y))
.
compareTo
in interface TreeNode
compareTo
in interface java.lang.Comparable
compareTo
in class BasicTreeNode
obj
- the object that this instance is to be compared to; may not be null.
java.lang.ClassCastException
- if the specified object's type prevents it
from being compared to this instance.public static final int compare(PermissionDataNodeImpl obj1, PermissionDataNodeImpl obj2)
This method assumes that all type-checking has already been performed.
obj1
- the first node to be comparedobj2
- the second node to be compared
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in interface TreeNode
toString
in class BasicTreeNode
public java.lang.String printDebug()
printDebug
in interface PermissionDataNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |