Package com.tangosol.coherence.dslquery
Class QueryPlus.DefaultDependencies
java.lang.Object
com.tangosol.coherence.dslquery.QueryPlus.DefaultDependencies
- All Implemented Interfaces:
QueryPlus.Dependencies
- Enclosing class:
QueryPlus
A default implementation of
QueryPlus.Dependencies.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CoherenceQueryLanguageTheCoherenceQueryLanguageto use.protected final PrintWriterThePrintWriterto use to display output.protected StatementExecutorTheStatementExecutorto use to execute statements.protected booleanWhentrue, echo input statement to output as it is read.protected booleanA flag indicating whether a CohQL session should be exited when the list of statements has been executed.protected booleanFlag that controls whether we except Map, and List as literals.protected booleanA flag that enables sanity checking.protected booleanA flag indicating whether the query session is running in silent mode.protected booleanFlag that indicates tracing mode.A list of statement script files to execute when the CohQL session starts.A list of statements to execute when the CohQL session starts.protected BufferedReaderTheBufferedReaderto use to obtain user input.protected StringAn optional application name to use.protected String[]A comma delimited list of domain partition names.protected StringThe name of an optional GAR file to load.protected StringString to use for Title that heads each result displayed.protected com.oracle.coherence.common.util.DurationThe timeout value to use for CohQL statement execution. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDependencies(PrintWriter writer, BufferedReader reader, CoherenceQueryLanguage language) Create a DefaultDependencies instance that will use the specifiedPrintWriterandBufferedReaderfor output and input. -
Method Summary
Modifier and TypeMethodDescriptionReturn the optional application name to use if loading a GAR file.Return an instance ofCoherenceQueryLanguageto be used by the QueryPlus session.String[]Return the optional array of domain partition names to use if loading a GAR file.getFiles()Return the list of statement script files that should be executed prior to the start of the CohQL session.Return the name of the optional GAR file to load before running QueryPlus.Return an instance of aPrintWriterthat should be used to display query output.Return theBufferedReaderto use to obtain user input.Return theStatementExecutorto use to parse and execute statements.Return the list of statements that should be executed prior to the start of the CohQL session.com.oracle.coherence.common.util.DurationReturn the initial value that will be set as the CohQL statement timeout.getTitle()Return the String to use for title that heads each result.booleanisEcho()Return true if echo is on, resulting in each input statement being written to output as it is read.booleanReturn whether the QueryPlus session should exit once all of the statements added to the statements list have been executed.booleanReturn whether "Extended Language" features are enabled.booleanReturn whether sanity checking should be enabled when executing statements.booleanisSilent()Return true if the current query session is running in silent mode.booleanReturn whether trace is enabled.voidsetApplicationName(String sApplicationName) Set the application name to use.voidsetDomainPartitions(String[] asDomainPartitions) Set the array of domain partition names to use.voidsetEcho(boolean fEcho) Set echo mode.voidsetExitWhenProcessingComplete(boolean fExit) Set the flag that indicates the QueryPlus process should exit after processing the statements from the command line.voidsetExtendedLanguage(boolean fExtendedLanguage) Set whether extended language features should be enabled.voidSet the list of statement files to execute before the QueryPlus session starts.voidsetGarFileName(String sGarFile) Set the name of the GAR file to load before starting the QueryPlus session.voidsetSanityCheckingEnabled(boolean fSanity) Set whether sanity checking is enabled.voidsetSilentMode(boolean fSilent) Set the flag indicating that the QueryPlus session is running in silent mode.voidsetStatementExecutor(StatementExecutor executor) Set theStatementExecutorto use to parse and execute statements.voidsetStatements(List<String> listStatements) Set the list of statements to execute before the QueryPlus session starts.voidsetTimeout(com.oracle.coherence.common.util.Duration timeout) Set the timeout value for CohQL statement execution.voidSet the title that will be displayed as the results heading.voidsetTraceEnabled(boolean fTraceEnabled) Set whether trace logging is enabled.
-
Field Details
-
f_language
TheCoherenceQueryLanguageto use. -
m_fTraceEnabled
protected boolean m_fTraceEnabledFlag that indicates tracing mode. -
m_fSanity
protected boolean m_fSanityA flag that enables sanity checking. -
m_fExtendedLanguage
protected boolean m_fExtendedLanguageFlag that controls whether we except Map, and List as literals. This gives a json like feel to the language. -
f_writer
ThePrintWriterto use to display output. -
m_fSilent
protected boolean m_fSilentA flag indicating whether the query session is running in silent mode. -
m_sTitle
String to use for Title that heads each result displayed. -
m_fExitWhenProcessingComplete
protected boolean m_fExitWhenProcessingCompleteA flag indicating whether a CohQL session should be exited when the list of statements has been executed. -
m_listStatements
A list of statements to execute when the CohQL session starts. -
m_listFiles
A list of statement script files to execute when the CohQL session starts. -
m_reader
TheBufferedReaderto use to obtain user input. -
m_executor
TheStatementExecutorto use to execute statements. -
m_sGarFileName
The name of an optional GAR file to load. -
m_sApplicationName
An optional application name to use. This is only used in combination with the GAR file named inm_sGarFileName. -
m_sDomainPartitions
A comma delimited list of domain partition names. This is only used in combination with the GAR file named inm_sGarFileName. -
m_timeout
protected com.oracle.coherence.common.util.Duration m_timeoutThe timeout value to use for CohQL statement execution. -
m_fEcho
protected boolean m_fEchoWhentrue, echo input statement to output as it is read. Defaults tofalse.- Since:
- 24.09
-
-
Constructor Details
-
DefaultDependencies
public DefaultDependencies(PrintWriter writer, BufferedReader reader, CoherenceQueryLanguage language) Create a DefaultDependencies instance that will use the specifiedPrintWriterandBufferedReaderfor output and input.- Parameters:
writer- the PrintWriter to use to display outputreader- the reader to obtain user inputlanguage- an instance of CoherenceQueryLanguage
-
-
Method Details
-
getCoherenceQueryLanguage
Description copied from interface:QueryPlus.DependenciesReturn an instance ofCoherenceQueryLanguageto be used by the QueryPlus session.- Specified by:
getCoherenceQueryLanguagein interfaceQueryPlus.Dependencies- Returns:
- the instance of CoherenceQueryLanguage to be used by the QueryPlus session
-
getOutputWriter
Description copied from interface:QueryPlus.DependenciesReturn an instance of aPrintWriterthat should be used to display query output.- Specified by:
getOutputWriterin interfaceQueryPlus.Dependencies- Returns:
- the current PrintWriter to be used to display output
-
setTraceEnabled
public void setTraceEnabled(boolean fTraceEnabled) Set whether trace logging is enabled.- Parameters:
fTraceEnabled- is trace logging enabled
-
isTraceEnabled
public boolean isTraceEnabled()Description copied from interface:QueryPlus.DependenciesReturn whether trace is enabled. Enabling trace displays verbose output when executing statements.- Specified by:
isTraceEnabledin interfaceQueryPlus.Dependencies- Returns:
- true if trace is enabled, otherwise returns false
-
setSanityCheckingEnabled
public void setSanityCheckingEnabled(boolean fSanity) Set whether sanity checking is enabled.- Parameters:
fSanity- is sanity checking enabled
-
isSanityChecking
public boolean isSanityChecking()Description copied from interface:QueryPlus.DependenciesReturn whether sanity checking should be enabled when executing statements.- Specified by:
isSanityCheckingin interfaceQueryPlus.Dependencies- Returns:
- whether sanity checking should be enabled when executing statements
-
setEcho
public void setEcho(boolean fEcho) Set echo mode.- Since:
- 24.09
-
isEcho
public boolean isEcho()Description copied from interface:QueryPlus.DependenciesReturn true if echo is on, resulting in each input statement being written to output as it is read. Default is false.- Specified by:
isEchoin interfaceQueryPlus.Dependencies- Returns:
- if echo is on.
-
setExtendedLanguage
public void setExtendedLanguage(boolean fExtendedLanguage) Set whether extended language features should be enabled.- Parameters:
fExtendedLanguage- whether extended language features should be enabled
-
isExtendedLanguageEnabled
public boolean isExtendedLanguageEnabled()Description copied from interface:QueryPlus.DependenciesReturn whether "Extended Language" features are enabled.- Specified by:
isExtendedLanguageEnabledin interfaceQueryPlus.Dependencies- Returns:
- whether "Extended Language" features are enabled
-
setExitWhenProcessingComplete
public void setExitWhenProcessingComplete(boolean fExit) Set the flag that indicates the QueryPlus process should exit after processing the statements from the command line.- Parameters:
fExit- true if QueryPlus should exit after processing the command line statements
-
isExitWhenProcessingComplete
public boolean isExitWhenProcessingComplete()Description copied from interface:QueryPlus.DependenciesReturn whether the QueryPlus session should exit once all of the statements added to the statements list have been executed.- Specified by:
isExitWhenProcessingCompletein interfaceQueryPlus.Dependencies- Returns:
- whether the QueryPlus session should exit once all of the statements added to the statements list have been executed
-
setStatements
Set the list of statements to execute before the QueryPlus session starts.- Parameters:
listStatements- the list of statements to execute before the QueryPlus session starts
-
getStatements
Description copied from interface:QueryPlus.DependenciesReturn the list of statements that should be executed prior to the start of the CohQL session.- Specified by:
getStatementsin interfaceQueryPlus.Dependencies- Returns:
- the list of statements that should be executed prior to the start of the CohQL session
-
setFiles
Set the list of statement files to execute before the QueryPlus session starts.- Parameters:
listFiles- the list of flies of QueryPlus statements to execute before the QueryPlus session starts.
-
getFiles
Description copied from interface:QueryPlus.DependenciesReturn the list of statement script files that should be executed prior to the start of the CohQL session.- Specified by:
getFilesin interfaceQueryPlus.Dependencies- Returns:
- the list of statements that should be executed prior to the start of the CohQL session
-
isSilent
public boolean isSilent()Description copied from interface:QueryPlus.DependenciesReturn true if the current query session is running in silent mode.- Specified by:
isSilentin interfaceQueryPlus.Dependencies- Returns:
- true if the current session is running in silent mode
-
setSilentMode
public void setSilentMode(boolean fSilent) Set the flag indicating that the QueryPlus session is running in silent mode.- Parameters:
fSilent- true to indicate that the QueryPlus session is running in silent mode.
-
setTitle
Set the title that will be displayed as the results heading.- Parameters:
sTitle- the title that will be displayed as the results heading
-
getTitle
Description copied from interface:QueryPlus.DependenciesReturn the String to use for title that heads each result.- Specified by:
getTitlein interfaceQueryPlus.Dependencies- Returns:
- the String to use for title that heads each result
-
getReader
Description copied from interface:QueryPlus.DependenciesReturn theBufferedReaderto use to obtain user input.- Specified by:
getReaderin interfaceQueryPlus.Dependencies- Returns:
- the BufferedReader to use to obtain user input
-
setStatementExecutor
Set theStatementExecutorto use to parse and execute statements.- Parameters:
executor- the StatementExecutor to use
-
getStatementExecutor
Description copied from interface:QueryPlus.DependenciesReturn theStatementExecutorto use to parse and execute statements.- Specified by:
getStatementExecutorin interfaceQueryPlus.Dependencies- Returns:
- the StatementExecutor to use to parse and execute statements
-
setGarFileName
Set the name of the GAR file to load before starting the QueryPlus session. This name should point to an existing GAR file or an exploded GAR file directory.- Parameters:
sGarFile- the name of the GAR file to load
-
getGarFileName
Description copied from interface:QueryPlus.DependenciesReturn the name of the optional GAR file to load before running QueryPlus.- Specified by:
getGarFileNamein interfaceQueryPlus.Dependencies- Returns:
- the name of the optional GAR file to load before running QueryPlus
-
setApplicationName
Set the application name to use. This name only applies if them_sGarFileNamehas also been set.- Parameters:
sApplicationName- the application name to use
-
getApplicationName
Description copied from interface:QueryPlus.DependenciesReturn the optional application name to use if loading a GAR file.- Specified by:
getApplicationNamein interfaceQueryPlus.Dependencies- Returns:
- the optional application name to use if loading a GAR file
-
setDomainPartitions
Set the array of domain partition names to use. This list only applies if them_sGarFileNamehas also been set.- Parameters:
asDomainPartitions- the comma delimited list of domain partition names
-
getDomainPartitions
Description copied from interface:QueryPlus.DependenciesReturn the optional array of domain partition names to use if loading a GAR file.- Specified by:
getDomainPartitionsin interfaceQueryPlus.Dependencies- Returns:
- the optional array of domain partition names to use if loading a GAR file
-
setTimeout
public void setTimeout(com.oracle.coherence.common.util.Duration timeout) Set the timeout value for CohQL statement execution.- Parameters:
timeout- timeout value for CohQL statement execution
-
getTimeout
public com.oracle.coherence.common.util.Duration getTimeout()Description copied from interface:QueryPlus.DependenciesReturn the initial value that will be set as the CohQL statement timeout.- Specified by:
getTimeoutin interfaceQueryPlus.Dependencies- Returns:
- the initial value that will be set as the CohQL statement timeout.
-