org.apache.derby.impl.sql.conn
Class GenericAuthorizer

java.lang.Object
  extended byorg.apache.derby.impl.sql.conn.GenericAuthorizer
All Implemented Interfaces:
Authorizer

class GenericAuthorizer
extends java.lang.Object
implements Authorizer


Field Summary
private  java.lang.String authorizationId
           
private static int FULL_ACCESS
           
private  LanguageConnectionContext lcc
           
private static int NO_ACCESS
           
private static int READ_ACCESS
           
(package private)  boolean readOnlyConnection
           
private  int userAccessLevel
           
 
Fields inherited from interface org.apache.derby.iapi.sql.conn.Authorizer
JAR_WRITE_OP, PROPERTY_WRITE_OP, SQL_ARBITARY_OP, SQL_CALL_OP, SQL_DDL_OP, SQL_SELECT_OP, SQL_WRITE_OP
 
Constructor Summary
(package private) GenericAuthorizer(java.lang.String authorizationId, LanguageConnectionContext lcc, boolean sqlConnection)
           
 
Method Summary
 void authorize(int operation)
          Verify the connected user is authorized to perform the requested operation.
private  boolean connectionMustRemainReadOnly()
           
private static StandardException externalRoutineException(int operation, int sqlAllowed)
           
 java.lang.String getAuthorizationId()
          Get the Authorization ID for this Authorizer.
private  int getDefaultAccessLevel()
           
private  void getUserAccessLevel()
           
 boolean isReadOnlyConnection()
          Get the readOnly status for this authorizer's connection.
 void refresh()
          Refresh this authorizer to reflect a change in the database permissions.
 void setReadOnlyConnection(boolean on, boolean authorize)
          Set the readOnly status for this authorizer's connection.
private  boolean userOnAccessList(java.lang.String listName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ACCESS

private static final int NO_ACCESS
See Also:
Constant Field Values

READ_ACCESS

private static final int READ_ACCESS
See Also:
Constant Field Values

FULL_ACCESS

private static final int FULL_ACCESS
See Also:
Constant Field Values

userAccessLevel

private int userAccessLevel

readOnlyConnection

boolean readOnlyConnection

lcc

private final LanguageConnectionContext lcc

authorizationId

private final java.lang.String authorizationId
Constructor Detail

GenericAuthorizer

GenericAuthorizer(java.lang.String authorizationId,
                  LanguageConnectionContext lcc,
                  boolean sqlConnection)
            throws StandardException
Method Detail

connectionMustRemainReadOnly

private boolean connectionMustRemainReadOnly()

authorize

public void authorize(int operation)
               throws StandardException
Description copied from interface: Authorizer
Verify the connected user is authorized to perform the requested operation.

Specified by:
authorize in interface Authorizer
Parameters:
operation - the enumeration code for the requsted operation.
Throws:
StandardException - Thrown if the operation is not allowed
See Also:
Authorizer.authorize(int)

externalRoutineException

private static StandardException externalRoutineException(int operation,
                                                          int sqlAllowed)

getAuthorizationId

public java.lang.String getAuthorizationId()
Description copied from interface: Authorizer
Get the Authorization ID for this Authorizer.

Specified by:
getAuthorizationId in interface Authorizer
See Also:
Authorizer.getAuthorizationId()

getUserAccessLevel

private void getUserAccessLevel()
                         throws StandardException
Throws:
StandardException

getDefaultAccessLevel

private int getDefaultAccessLevel()
                           throws StandardException
Throws:
StandardException

userOnAccessList

private boolean userOnAccessList(java.lang.String listName)
                          throws StandardException
Throws:
StandardException

isReadOnlyConnection

public boolean isReadOnlyConnection()
Description copied from interface: Authorizer
Get the readOnly status for this authorizer's connection.

Specified by:
isReadOnlyConnection in interface Authorizer
See Also:
Authorizer.isReadOnlyConnection()

setReadOnlyConnection

public void setReadOnlyConnection(boolean on,
                                  boolean authorize)
                           throws StandardException
Description copied from interface: Authorizer
Set the readOnly status for this authorizer's connection.

Specified by:
setReadOnlyConnection in interface Authorizer
Parameters:
on - true means set the connection to read only mode, false means set the connection to read wrte mode.
authorize - true means to verify the caller has authority to set the connection and false means do not check.
Throws:
StandardException - Thrown if the operation is not allowed
See Also:
Authorizer.isReadOnlyConnection()

refresh

public void refresh()
             throws StandardException
Description copied from interface: Authorizer
Refresh this authorizer to reflect a change in the database permissions.

Specified by:
refresh in interface Authorizer
Throws:
StandardException - Thrown if the operation is not allowed
See Also:
Authorizer.refresh()

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.