|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 FarragoSessionStmtValidator
public void setReposTxnContext(FarragoReposTxnContext reposTxnContext)
FarragoSessionStmtValidator
setReposTxnContext
in interface FarragoSessionStmtValidator
reposTxnContext
- repos txn context to usepublic FarragoReposTxnContext getReposTxnContext()
getReposTxnContext
in interface FarragoSessionStmtValidator
public FarragoSession getSession()
getSession
in interface FarragoSessionStmtValidator
public FarragoRepos getRepos()
getRepos
in interface FarragoSessionStmtValidator
public FennelDbHandle getFennelDbHandle()
getFennelDbHandle
in interface FarragoSessionStmtValidator
public FarragoTypeFactory getTypeFactory()
getTypeFactory
in interface FarragoSessionStmtValidator
public FarragoSessionVariables getSessionVariables()
getSessionVariables
in interface FarragoSessionStmtValidator
public FarragoObjectCache getCodeCache()
getCodeCache
in interface FarragoSessionStmtValidator
public FarragoDataWrapperCache getDataWrapperCache()
getDataWrapperCache
in interface FarragoSessionStmtValidator
public FarragoSessionIndexMap getIndexMap()
getIndexMap
in interface FarragoSessionStmtValidator
public FarragoObjectCache getSharedDataWrapperCache()
getSharedDataWrapperCache
in interface FarragoSessionStmtValidator
public FarragoSessionPrivilegeChecker getPrivilegeChecker()
getPrivilegeChecker
in interface FarragoSessionStmtValidator
public FarragoDdlLockManager getDdlLockManager()
getDdlLockManager
in interface FarragoSessionStmtValidator
public void requestPrivilege(CwmModelElement obj, String action)
FarragoSessionStmtValidator
requestPrivilege
in interface FarragoSessionStmtValidator
obj
- 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 FarragoSessionStmtValidator
namedColumnSet
- the table to searchcolumnName
- name of column to find
public CwmCatalog findCatalog(String catalogName)
FarragoSessionStmtValidator
findCatalog
in interface FarragoSessionStmtValidator
catalogName
- name of catalog to look up
public CwmCatalog getDefaultCatalog()
FarragoSessionStmtValidator
getDefaultCatalog
in interface FarragoSessionStmtValidator
public FemLocalSchema findSchema(SqlIdentifier schemaName)
FarragoSessionStmtValidator
findSchema
in interface FarragoSessionStmtValidator
schemaName
- name of schema to look up
public FemDataWrapper findDataWrapper(SqlIdentifier wrapperName, boolean isForeign)
FarragoSessionStmtValidator
findDataWrapper
in interface FarragoSessionStmtValidator
wrapperName
- 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 FarragoSessionStmtValidator
serverName
- 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 FarragoSessionStmtValidator
qualifiedName
- 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 FarragoSessionStmtValidator
unqualifiedName
- SqlIdentifier which returns true for isSimple()clazz
- class of object to find
public List<FemRoutine> findRoutineOverloads(SqlIdentifier invocationName, ProcedureType routineType)
FarragoSessionStmtValidator
findRoutineOverloads
in interface FarragoSessionStmtValidator
invocationName
- 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 FarragoSessionStmtValidator
typeName
- name of type to find
public FemJar findJarFromLiteralName(String jarName)
FarragoSessionStmtValidator
findJarFromLiteralName
in interface FarragoSessionStmtValidator
jarName
- string literal representing name of jar
public <T extends CwmModelElement> FarragoSessionResolvedObject<T> resolveSchemaObjectName(String[] names, Class<T> clazz)
FarragoSessionStmtValidator
resolveSchemaObjectName
in interface FarragoSessionStmtValidator
names
- 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 FarragoSessionStmtValidator
names
- 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 FarragoSessionStmtValidator
pos
- new position to set, or null to clearpublic void validateFeature(org.eigenbase.resgen.ResourceDefinition feature, SqlParserPos context)
FarragoSessionStmtValidator
validateFeature
in interface FarragoSessionStmtValidator
feature
- feature being used, represented as a resource definition
from EigenbaseResource
context
- parser position context for error reporting, or null if
none availablepublic void setTimingTracer(EigenbaseTimingTracer timingTracer)
FarragoSessionStmtValidator
setTimingTracer
in interface FarragoSessionStmtValidator
timingTracer
- tracer to usepublic EigenbaseTimingTracer getTimingTracer()
getTimingTracer
in interface FarragoSessionStmtValidator
public CwmNamedColumnSet getSampleDataset(CwmNamedColumnSet columnSet, String datasetName)
FarragoSessionStmtValidator
getSampleDataset
in interface FarragoSessionStmtValidator
columnSet
- Schema objectdatasetName
- Name of dataset, not null
public void validateDataType(SqlDataTypeSpec dataType) throws SqlValidatorException
FarragoSessionStmtValidator
validateDataType
in interface FarragoSessionStmtValidator
SqlValidatorException
public void addAllocation(ClosableAllocation allocation)
ClosableAllocationOwner
addAllocation
in interface ClosableAllocationOwner
allocation
- the ClosableAllocation to take overpublic void closeAllocation()
ClosableAllocation
closeAllocation
in interface ClosableAllocation
public void setWarningQueue(FarragoWarningQueue queue)
FarragoSessionStmtValidator
setWarningQueue
in interface FarragoSessionStmtValidator
queue
- 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 |