public final class KEngine extends Object implements KClient, StringConstants
KClient.State
AMPERSAND, AT, BR, CLASS, CLOSE_ANGLE_BRACKET, CLOSE_BRACE, CLOSE_BRACKET, CLOSE_PRE_CMT, CLOSE_PRE_TAG, CLOSE_SQUARE_BRACKET, COLON, COMMA, CONNECTION_SUFFIX, CURRENT_FOLDER_SYMBOL, DDL, DEFAULT_LOCAL_WORKSPACE_NAME, DIVIDE, DOLLAR_SIGN, DOT, DOT_CHAR, DOT_DOT, DOT_KOMODO, DOUBLE_BACK_SLASH, DRIVE_SEPARATOR, EMPTY_ARRAY, EMPTY_STRING, ENUM, EQUALS, FILE_EXTENSION_SEPARATOR, FILE_NAME_WILDCARD, FINAL, FORWARD_SLASH, HASH, HYPHEN, INTERFACE, JAR, JAVA, JAVA_IO_TMPDIR, JBOSS_SERVER_TMP_DIR, KOMODO, LINE_SEPARATOR, LINE_SEPARATOR_PROPERTY_NAME, LOG, MINUS, MULTIPLY, NBSP, NEW_LINE, OPEN_ANGLE_BRACKET, OPEN_BRACE, OPEN_BRACKET, OPEN_PRE_CMT, OPEN_PRE_TAG, OPEN_SQUARE_BRACKET, PARENT_FOLDER_SYMBOL, PERCENT, PIPE, PLUS, PREFIX_PATTERN, PRIVATE, PUBLIC, QUESTION_MARK, QUOTE_MARK, SEMI_COLON, SERVICE_VDB_SUFFIX, SERVICE_VDB_VIEW_MODEL, SERVICE_VDB_VIEW_SUFFIX, SOURCES, SPACE, SPEECH_MARK, SRC, STAR, STATIC, TAB, TARGET, UNDERSCORE, UNDERSCORE_CHAR, VDB_DEPLOYMENT_SUFFIX, VDB_PREFIX, XML, XML_SUFFIX, ZIP, ZIP_SUFFIX
Constructor and Description |
---|
KEngine() |
Modifier and Type | Method and Description |
---|---|
void |
add(Repository repository)
Adds the repository to the engine.
|
void |
addErrorHandler(KErrorHandler errorHandler)
Sets the error handler implementation of the engine
|
void |
addObserver(KObserver observer)
Adds the observer to the engine
|
void |
errorOccurred(Throwable e) |
void |
eventOccurred(KEvent<?> event) |
Repository |
getDefaultRepository() |
KErrorHandler |
getErrorHandler() |
MetadataInstance |
getMetadataInstance() |
Set<Repository> |
getRepositories() |
KClient.State |
getState() |
org.teiid.query.sql.LanguageObject |
parse(String sql)
Not included on
MetadataInstance interface due to dependency on LanguageObject |
void |
remove(Repository repository) |
void |
removeObserver(KObserver observer)
Removes the observer from the engine
|
void |
setDefaultRepository(Repository repository)
Sets the default repository.
|
void |
setMetadataInstance(MetadataInstance instance) |
void |
shutdown() |
void |
shutdownAndWait()
Shutdown the engine and wait for it and all repositories to
be disconnected, including the local repository which should
be shutdown as well.
|
void |
start() |
boolean |
startAndWait()
Start the engine and wait for the default repository,
metadata server to be started
|
public Repository getDefaultRepository() throws KException
KException
public void setDefaultRepository(Repository repository) throws Exception
start()
2. When tests are completed, shutdown the engine
3. Call this again with a value of null to clear the default repository fieldrepository
- the default repositoryException
- if an error occurspublic MetadataInstance getMetadataInstance() throws KException
KException
public void setMetadataInstance(MetadataInstance instance)
public void add(Repository repository) throws KException
repository
- the repository being added (cannot be null
)KException
- if error occurspublic KClient.State getState()
public Set<Repository> getRepositories()
null
but can be empty)public void remove(Repository repository) throws KException
repository
- the repository being removed (cannot be null
)KException
- if the repository was not removedpublic void shutdown() throws KException
KException
- if there is an error during engine shutdownpublic void shutdownAndWait() throws Exception
Exception
- if shutdown failspublic void start() throws KException
KException
- if there is an error starting the enginepublic boolean startAndWait() throws Exception
Exception
- if start failspublic KErrorHandler getErrorHandler()
public void addErrorHandler(KErrorHandler errorHandler)
errorHandler
- additional error handler to be notified of errorspublic void addObserver(KObserver observer)
observer
- public void removeObserver(KObserver observer)
observer
- public void eventOccurred(KEvent<?> event)
eventOccurred
in interface KObserver
public void errorOccurred(Throwable e)
errorOccurred
in interface KObserver
public org.teiid.query.sql.LanguageObject parse(String sql) throws Exception
MetadataInstance
interface due to dependency on LanguageObject
sql
- Exception
Copyright © 2013–2019. All rights reserved.