|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.farrago.session.mock.MockSessionStmtValidator
public class MockSessionStmtValidator
MockSessionStmtValidator provides a bare-bones implementation of FarragoSessionStmtValidator. It primarily exists to support the retrieval of a MockReposTxnContext in the SQL parser.
| Field Summary | |
|---|---|
(package private) FarragoSessionParser |
parser
|
(package private) FarragoReposTxnContext |
reposTxnContext
|
| Constructor Summary | |
|---|---|
MockSessionStmtValidator()
|
|
| Method Summary | ||
|---|---|---|
void |
addAllocation(ClosableAllocation allocation)
Assigns ownership of a ClosableAllocation to this owner. |
|
void |
closeAllocation()
Closes this object. |
|
CwmCatalog |
findCatalog(String catalogName)
Looks up a catalog by name, throwing a validation error if not found. |
|
CwmColumn |
findColumn(CwmNamedColumnSet namedColumnSet,
String columnName)
Looks up a table's column by name, throwing a validation error if not found. |
|
FemDataServer |
findDataServer(SqlIdentifier serverName)
Looks up a data server by name, throwing a validation error if not found. |
|
FemDataWrapper |
findDataWrapper(SqlIdentifier wrapperName,
boolean isForeign)
Looks up a data wrapper by name, throwing a validation error if not found. |
|
FemJar |
findJarFromLiteralName(String jarName)
Looks up a jar from a string literal representing its name (typically from a LIBRARY clause), throwing an exception if not found. |
|
List<FemRoutine> |
findRoutineOverloads(SqlIdentifier invocationName,
ProcedureType routineType)
Looks up all matching routine overloads by invocation name. |
|
FemLocalSchema |
findSchema(SqlIdentifier schemaName)
Looks up a schema by name, throwing a validation error if not found. |
|
|
findSchemaObject(SqlIdentifier qualifiedName,
Class<T> clazz)
Looks up a schema object by name, throwing a validation error if not found. |
|
CwmSqldataType |
findSqldataType(SqlIdentifier typeName)
Looks up a SQL datatype by name, throwing an exception if not found. |
|
|
findUnqualifiedObject(SqlIdentifier unqualifiedName,
Class<T> clazz)
Looks up a top-level object (e.g. |
|
List<SqlMoniker> |
getAllSchemaObjectNames(List<String> names)
Gets schema object names as specified. |
|
FarragoObjectCache |
getCodeCache()
|
|
FarragoDataWrapperCache |
getDataWrapperCache()
|
|
FarragoDdlLockManager |
getDdlLockManager()
|
|
CwmCatalog |
getDefaultCatalog()
Gets the default catalog for unqualified schema names. |
|
FemDataServer |
getDefaultLocalDataServer()
|
|
FennelDbHandle |
getFennelDbHandle()
|
|
FarragoSessionIndexMap |
getIndexMap()
|
|
FarragoSessionParser |
getParser()
|
|
FarragoSessionPrivilegeChecker |
getPrivilegeChecker()
|
|
FarragoRepos |
getRepos()
|
|
FarragoReposTxnContext |
getReposTxnContext()
|
|
CwmNamedColumnSet |
getSampleDataset(CwmNamedColumnSet columnSet,
String datasetName)
Looks up a sample dataset for a given schema object, or returns null if none is found. |
|
FarragoSession |
getSession()
|
|
FarragoSessionVariables |
getSessionVariables()
|
|
FarragoObjectCache |
getSharedDataWrapperCache()
|
|
EigenbaseTimingTracer |
getTimingTracer()
|
|
FarragoTypeFactory |
getTypeFactory()
|
|
FarragoWarningQueue |
getWarningQueue()
Gets the warning queue to be used by this validator |
|
void |
requestPrivilege(CwmModelElement obj,
String action)
Submits a request for access from the current user and/or role to a catalog object via this validator's privilege checker. |
|
|
resolveSchemaObjectName(String[] names,
Class<T> clazz)
Resolve a (possibly qualified) name of a schema object. |
|
void |
setParser(FarragoSessionParser parser)
|
|
void |
setParserPosition(SqlParserPos pos)
Sets the parser position to use for context in error messages. |
|
void |
setReposTxnContext(FarragoReposTxnContext reposTxnContext)
Sets the repository transaction context associated with this statement. |
|
void |
setTimingTracer(EigenbaseTimingTracer timingTracer)
Sets the timing tracer associated with this statement |
|
void |
setWarningQueue(FarragoWarningQueue queue)
Sets the warning queue to be used by this validator |
|
void |
validateDataType(SqlDataTypeSpec dataType)
Validates a data type expression. |
|
void |
validateFeature(org.eigenbase.resgen.ResourceDefinition feature,
SqlParserPos context)
Validates that a particular feature is enabled. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
FarragoSessionParser parser
FarragoReposTxnContext reposTxnContext
| Constructor Detail |
|---|
public MockSessionStmtValidator()
| Method Detail |
|---|
public void setParser(FarragoSessionParser parser)
public FarragoSessionParser getParser()
getParser in interface FarragoSessionStmtValidatorpublic void setReposTxnContext(FarragoReposTxnContext reposTxnContext)
FarragoSessionStmtValidator
setReposTxnContext in interface FarragoSessionStmtValidatorreposTxnContext - repos txn context to usepublic FarragoReposTxnContext getReposTxnContext()
getReposTxnContext in interface FarragoSessionStmtValidatorpublic FarragoSession getSession()
getSession in interface FarragoSessionStmtValidatorpublic FarragoRepos getRepos()
getRepos in interface FarragoSessionStmtValidatorpublic FennelDbHandle getFennelDbHandle()
getFennelDbHandle in interface FarragoSessionStmtValidatorpublic FarragoTypeFactory getTypeFactory()
getTypeFactory in interface FarragoSessionStmtValidatorpublic FarragoSessionVariables getSessionVariables()
getSessionVariables in interface FarragoSessionStmtValidatorpublic FarragoObjectCache getCodeCache()
getCodeCache in interface FarragoSessionStmtValidatorpublic FarragoDataWrapperCache getDataWrapperCache()
getDataWrapperCache in interface FarragoSessionStmtValidatorpublic FarragoSessionIndexMap getIndexMap()
getIndexMap in interface FarragoSessionStmtValidatorpublic FarragoObjectCache getSharedDataWrapperCache()
getSharedDataWrapperCache in interface FarragoSessionStmtValidatorpublic FarragoSessionPrivilegeChecker getPrivilegeChecker()
getPrivilegeChecker in interface FarragoSessionStmtValidatorpublic FarragoDdlLockManager getDdlLockManager()
getDdlLockManager in interface FarragoSessionStmtValidator
public void requestPrivilege(CwmModelElement obj,
String action)
FarragoSessionStmtValidator
requestPrivilege in interface FarragoSessionStmtValidatorobj - object to be accessedaction - the action to be performed on obj (see PrivilegedActionEnum for base set)
public CwmColumn findColumn(CwmNamedColumnSet namedColumnSet,
String columnName)
FarragoSessionStmtValidator
findColumn in interface FarragoSessionStmtValidatornamedColumnSet - the table to searchcolumnName - name of column to find
public CwmCatalog findCatalog(String catalogName)
FarragoSessionStmtValidator
findCatalog in interface FarragoSessionStmtValidatorcatalogName - name of catalog to look up
public CwmCatalog getDefaultCatalog()
FarragoSessionStmtValidator
getDefaultCatalog in interface FarragoSessionStmtValidatorpublic FemLocalSchema findSchema(SqlIdentifier schemaName)
FarragoSessionStmtValidator
findSchema in interface FarragoSessionStmtValidatorschemaName - name of schema to look up
public FemDataWrapper findDataWrapper(SqlIdentifier wrapperName,
boolean isForeign)
FarragoSessionStmtValidator
findDataWrapper in interface FarragoSessionStmtValidatorwrapperName - name of wrapper to look up (must be simple)isForeign - true for foreign data wrapper; false for local data
wrapper
public FemDataServer findDataServer(SqlIdentifier serverName)
FarragoSessionStmtValidator
findDataServer in interface FarragoSessionStmtValidatorserverName - name of server to look up (must be simple)
public FemDataServer getDefaultLocalDataServer()
getDefaultLocalDataServer in interface FarragoSessionStmtValidator
public <T extends CwmModelElement> T findSchemaObject(SqlIdentifier qualifiedName,
Class<T> clazz)
FarragoSessionStmtValidator
findSchemaObject in interface FarragoSessionStmtValidatorqualifiedName - name of object to look upclazz - expected class of object; if the object exists with a
different class, it will be treated as if it did not exist
public <T extends CwmModelElement> T findUnqualifiedObject(SqlIdentifier unqualifiedName,
Class<T> clazz)
FarragoSessionStmtValidator
findUnqualifiedObject in interface FarragoSessionStmtValidatorunqualifiedName - SqlIdentifier which returns true for isSimple()clazz - class of object to find
public List<FemRoutine> findRoutineOverloads(SqlIdentifier invocationName,
ProcedureType routineType)
FarragoSessionStmtValidator
findRoutineOverloads in interface FarragoSessionStmtValidatorinvocationName - invocation name of routine to look uproutineType - type of routine to look up, or null for any type
public CwmSqldataType findSqldataType(SqlIdentifier typeName)
FarragoSessionStmtValidator
findSqldataType in interface FarragoSessionStmtValidatortypeName - name of type to find
public FemJar findJarFromLiteralName(String jarName)
FarragoSessionStmtValidator
findJarFromLiteralName in interface FarragoSessionStmtValidatorjarName - string literal representing name of jar
public <T extends CwmModelElement> FarragoSessionResolvedObject<T> resolveSchemaObjectName(String[] names,
Class<T> clazz)
FarragoSessionStmtValidator
resolveSchemaObjectName in interface FarragoSessionStmtValidatornames - array of 1 or more name components, from most general to
most specificclazz - type of object to resolve
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names)
FarragoSessionStmtValidator
getAllSchemaObjectNames in interface FarragoSessionStmtValidatornames - the array contains either 2 elements representing a
partially qualified object name in the format of 'schema.object', or an
unqualified name in the format of 'object'
SqlMoniker object (schema and table)
names under the above criteriapublic void setParserPosition(SqlParserPos pos)
FarragoSessionStmtValidator
setParserPosition in interface FarragoSessionStmtValidatorpos - new position to set, or null to clear
public void validateFeature(org.eigenbase.resgen.ResourceDefinition feature,
SqlParserPos context)
FarragoSessionStmtValidator
validateFeature in interface FarragoSessionStmtValidatorfeature - feature being used, represented as a resource definition
from EigenbaseResourcecontext - parser position context for error reporting, or null if
none availablepublic void setTimingTracer(EigenbaseTimingTracer timingTracer)
FarragoSessionStmtValidator
setTimingTracer in interface FarragoSessionStmtValidatortimingTracer - tracer to usepublic EigenbaseTimingTracer getTimingTracer()
getTimingTracer in interface FarragoSessionStmtValidator
public CwmNamedColumnSet getSampleDataset(CwmNamedColumnSet columnSet,
String datasetName)
FarragoSessionStmtValidator
getSampleDataset in interface FarragoSessionStmtValidatorcolumnSet - Schema objectdatasetName - Name of dataset, not null
public void validateDataType(SqlDataTypeSpec dataType)
throws SqlValidatorException
FarragoSessionStmtValidator
validateDataType in interface FarragoSessionStmtValidatorSqlValidatorExceptionpublic void addAllocation(ClosableAllocation allocation)
ClosableAllocationOwner
addAllocation in interface ClosableAllocationOwnerallocation - the ClosableAllocation to take overpublic void closeAllocation()
ClosableAllocation
closeAllocation in interface ClosableAllocationpublic void setWarningQueue(FarragoWarningQueue queue)
FarragoSessionStmtValidator
setWarningQueue in interface FarragoSessionStmtValidatorqueue - target queue to usepublic FarragoWarningQueue getWarningQueue()
FarragoSessionStmtValidator
getWarningQueue in interface FarragoSessionStmtValidator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||