org.apache.derby.impl.sql.execute
Class CreateRoleConstantAction

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.DDLConstantAction
      extended by org.apache.derby.impl.sql.execute.CreateRoleConstantAction
All Implemented Interfaces:
ConstantAction

 class CreateRoleConstantAction
extends DDLConstantAction

This class performs actions that are ALWAYS performed for a CREATE ROLE statement at execution time. These SQL objects are stored in the SYS.SYSROLES table.


Field Summary
private  java.lang.String roleName
           
 
Constructor Summary
CreateRoleConstantAction(java.lang.String roleName)
          Make the ConstantAction for a CREATE ROLE statement.
 
Method Summary
 void executeConstantAction(Activation activation)
          This is the guts of the Execution-time logic for CREATE ROLE.
private  boolean knownUser(java.lang.String roleName, java.lang.String currentUser, LanguageConnectionContext lcc, DataDictionary dd, TransactionController tc)
          Heuristically, try to determine is a proposed role identifier is already known to Derby as a user name.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction
addColumnDependencies, adjustUDTDependencies, adjustUDTDependencies, constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, storeConstraintDependenciesOnPrivileges, storeViewTriggerDependenciesOnPrivileges
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

roleName

private java.lang.String roleName
Constructor Detail

CreateRoleConstantAction

public CreateRoleConstantAction(java.lang.String roleName)
Make the ConstantAction for a CREATE ROLE statement. When executed, will create a role by the given name.

Parameters:
roleName - The name of the role being created
Method Detail

executeConstantAction

public void executeConstantAction(Activation activation)
                           throws StandardException
This is the guts of the Execution-time logic for CREATE ROLE.

Parameters:
activation - The execution environment for this constant action.
Throws:
StandardException - Thrown on failure
See Also:
ConstantAction.executeConstantAction(org.apache.derby.iapi.sql.Activation)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

knownUser

private boolean knownUser(java.lang.String roleName,
                          java.lang.String currentUser,
                          LanguageConnectionContext lcc,
                          DataDictionary dd,
                          TransactionController tc)
                   throws StandardException
Heuristically, try to determine is a proposed role identifier is already known to Derby as a user name. Method: If BUILTIN authentication is used, check if there is such a user. If external authentication is used, we lose. If there turns out to be collision, and we can't detect it here, we should block such a user from connecting (FIXME), since there is now a role with that name.

Throws:
StandardException

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.