Class PrivilegeNode
- java.lang.Object
-
- org.apache.derby.impl.sql.compile.QueryTreeNode
-
- org.apache.derby.impl.sql.compile.PrivilegeNode
-
- All Implemented Interfaces:
Visitable
class PrivilegeNode extends QueryTreeNode
This node represents a set of privileges that are granted or revoked on one object.
-
-
Field Summary
Fields Modifier and Type Field Description static int
AGGREGATE_PRIVILEGES
private Provider
dependencyProvider
private TableName
objectName
private int
objectType
private java.lang.String
privilege
private boolean
restrict
static int
ROUTINE_PRIVILEGES
private RoutineDesignator
routineDesignator
static int
SEQUENCE_PRIVILEGES
private TablePrivilegesNode
specificPrivileges
static int
TABLE_PRIVILEGES
static int
UDT_PRIVILEGES
-
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
-
-
Constructor Summary
Constructors Constructor Description PrivilegeNode(int objectType, java.lang.Object objectOfPrivilege, TablePrivilegesNode specificPrivileges, ContextManager cm)
Initialize a PrivilegeNode for use against SYS.SYSTABLEPERMS and SYS.SYSROUTINEPERMS.PrivilegeNode(int objectType, TableName objectName, java.lang.String privilege, boolean restrict, ContextManager cm)
Constructor a PrivilegeNode for use against SYS.SYSPERMS.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
acceptChildren(Visitor v)
Accept a visitor on all child nodes.QueryTreeNode
bind(java.util.HashMap<Provider,Provider> dependencies, java.util.List<java.lang.String> grantees, boolean isGrant)
Bind this GrantNode.(package private) PrivilegeInfo
makePrivilegeInfo()
private StandardException
unimplementedFeature()
Report an unimplemented feature-
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, toString, treePrint, treePrint, verifyClassExist
-
-
-
-
Field Detail
-
TABLE_PRIVILEGES
public static final int TABLE_PRIVILEGES
- See Also:
- Constant Field Values
-
ROUTINE_PRIVILEGES
public static final int ROUTINE_PRIVILEGES
- See Also:
- Constant Field Values
-
SEQUENCE_PRIVILEGES
public static final int SEQUENCE_PRIVILEGES
- See Also:
- Constant Field Values
-
UDT_PRIVILEGES
public static final int UDT_PRIVILEGES
- See Also:
- Constant Field Values
-
AGGREGATE_PRIVILEGES
public static final int AGGREGATE_PRIVILEGES
- See Also:
- Constant Field Values
-
objectType
private int objectType
-
objectName
private TableName objectName
-
specificPrivileges
private TablePrivilegesNode specificPrivileges
-
routineDesignator
private RoutineDesignator routineDesignator
-
privilege
private java.lang.String privilege
-
restrict
private boolean restrict
-
dependencyProvider
private Provider dependencyProvider
-
-
Constructor Detail
-
PrivilegeNode
PrivilegeNode(int objectType, java.lang.Object objectOfPrivilege, TablePrivilegesNode specificPrivileges, ContextManager cm) throws StandardException
Initialize a PrivilegeNode for use against SYS.SYSTABLEPERMS and SYS.SYSROUTINEPERMS.- Parameters:
objectType
-objectOfPrivilege
- (a TableName or RoutineDesignator)specificPrivileges
- null for routines and usagecm
- the context manager- Throws:
StandardException
-
PrivilegeNode
PrivilegeNode(int objectType, TableName objectName, java.lang.String privilege, boolean restrict, ContextManager cm)
Constructor a PrivilegeNode for use against SYS.SYSPERMS.- Parameters:
objectType
- E.g., SEQUENCEobjectName
- A possibles schema-qualified nameprivilege
- A PermDescriptor privilege, e.g.PermDescriptor.USAGE_PRIV
restrict
- True if this is a REVOKE...RESTRICT actioncm
- The context manager
-
-
Method Detail
-
bind
public QueryTreeNode bind(java.util.HashMap<Provider,Provider> dependencies, java.util.List<java.lang.String> grantees, boolean isGrant) throws StandardException
Bind this GrantNode. Resolve all table, column, and routine references. Register a dependency on the object of the privilege if it has not already been done- Parameters:
dependencies
- The list of privilege objects that this statement has already seen. If the object of this privilege is not in the list then this statement is registered as dependent on the object.grantees
- The list of granteesisGrant
- grant if true; revoke if false- Returns:
- the bound node
- Throws:
StandardException
- Standard error policy.
-
makePrivilegeInfo
PrivilegeInfo makePrivilegeInfo() throws StandardException
- Returns:
- PrivilegeInfo for this node
- Throws:
StandardException
-
unimplementedFeature
private StandardException unimplementedFeature()
Report an unimplemented feature
-
acceptChildren
void acceptChildren(Visitor v) throws StandardException
Description copied from class:QueryTreeNode
Accept a visitor on all child nodes. All sub-classes that add fields that should be visited, should override this method and callaccept(v)
on all visitable fields, as well assuper.acceptChildren(v)
to make sure all visitable fields defined by the super-class are accepted too.- Overrides:
acceptChildren
in classQueryTreeNode
- Parameters:
v
- the visitor- Throws:
StandardException
- on errors raised by the visitor
-
-