Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class CreateRoleConstantAction

extends DDLConstantAction
Class Inheritance
Imports
org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.util.IdUtil, org.apache.derby.iapi.jdbc.AuthenticationService, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator, .RoleGrantDescriptor, .DataDictionary, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.impl.jdbc.authentication.BasicAuthenticationServiceImpl, org.apache.derby.shared.common.reference.SQLState, .Property

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

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public
CreateRoleConstantAction(String
The name of the role being created
roleName
)

Make the ConstantAction for a CREATE ROLE statement.

Method Summary

Modifier and TypeMethod and Description
public void
executeConstantAction(Activation
The execution environment for this constant action.
activation
)

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

This is the guts of the Execution-time logic for CREATE ROLE.

private boolean
knownUser(String roleName, 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.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.impl.sql.execute.DDLConstantAction:
addColumnDependenciesadjustUDTDependenciesadjustUDTDependenciesconstructToStringgetAndCheckSchemaDescriptorgetSchemaDescriptorForCreatelockTableForDDLstoreConstraintDependenciesOnPrivilegesstoreViewTriggerDependenciesOnPrivileges

Field Detail

roleNameback to summary
private String roleName

Constructor Detail

CreateRoleConstantActionback to summary
public CreateRoleConstantAction(String roleName)

Make the ConstantAction for a CREATE ROLE statement. When executed, will create a role by the given name.

Parameters
roleName:String

The name of the role being created

Method Detail

executeConstantActionback to summary
public void executeConstantAction(Activation activation) throws StandardException

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

This is the guts of the Execution-time logic for CREATE ROLE.

Parameters
activation:Activation

Doc from org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

The execution environment for this constant action.

Exceptions
StandardException:
Thrown on failure
See Also
ConstantAction#executeConstantAction
knownUserback to summary
private boolean knownUser(String roleName, 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.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object