|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.tui.CmdRunner
public class CmdRunner
Command line utility which reads and executes MDX commands.
TODO: describe how to use this class.
Nested Class Summary | |
---|---|
protected static class |
CmdRunner.Options
|
Field Summary | |
---|---|
(package private) static NumberFormat |
nf
|
Constructor Summary | |
---|---|
CmdRunner(CmdRunner.Options options,
PrintWriter out)
Creates a CmdRunner . |
Method Summary | |
---|---|
protected static void |
appendCube(StringBuilder buf)
|
protected static void |
appendEcho(StringBuilder buf)
|
protected static void |
appendError(StringBuilder buf)
|
protected static void |
appendExit(StringBuilder buf)
|
protected static void |
appendExpr(StringBuilder buf)
|
protected static void |
appendFile(StringBuilder buf)
|
protected static void |
appendFunc(StringBuilder buf)
|
protected static void |
appendIndent(StringBuilder buf,
int i)
|
protected static void |
appendList(StringBuilder buf)
|
protected static void |
appendLog(StringBuilder buf)
|
protected static void |
appendParam(StringBuilder buf)
|
protected static void |
appendSet(StringBuilder buf)
|
(package private) void |
clearError()
|
protected void |
commandLoop(boolean interactive)
|
protected void |
commandLoop(File file)
|
protected void |
commandLoop(Reader in,
boolean interactive)
The Command Loop where lines are read from the InputStream and interpreted. |
protected void |
commandLoop(String mdxCmd,
boolean interactive)
|
protected void |
debug(String msg)
|
String |
execute(String queryString)
Executes a query and returns the result as a string. |
protected String |
executeCube(String mdxCmd)
|
void |
executeCubeCommand(String cubename,
String command,
StringBuilder buf)
|
protected String |
executeEcho(String mdxCmd)
|
protected String |
executeError(String mdxCmd)
|
protected String |
executeExpr(String mdxCmd)
|
protected String |
executeFile(String mdxCmd)
|
protected String |
executeFunc(String mdxCmd)
|
protected static String |
executeHelp(String mdxCmd)
|
protected String |
executeList(String mdxCmd)
|
protected String |
executeLog(String mdxCmd)
|
protected String |
executeMdxCmd(String mdxCmd)
|
protected String |
executeParam(String mdxCmd)
|
protected String |
executeSet(String mdxCmd)
|
protected static String |
getCatalogURLProperty()
|
Connection |
getConnection()
Gets a connection to Mondrian. |
Connection |
getConnection(boolean fresh)
Gets a Mondrian connection, creating a new one if fresh is true. |
String |
getConnectString()
|
String |
getConnectString(boolean fresh)
|
protected static String |
getConnectStringProperty()
|
Cube |
getCube(String name)
|
Cube[] |
getCubes()
|
protected static String |
getJdbcDriversProperty()
|
protected static String |
getJdbcPasswordProperty()
|
protected static String |
getJdbcURLProperty()
|
protected static String |
getJdbcUserProperty()
|
protected static int |
getLine(Reader reader,
StringBuilder line)
Read the next line of input. |
long |
getQueryTime()
|
boolean |
getTimeQueries()
|
long |
getTotalQueryTime()
|
String |
highCardToString(Result result)
Converts a Result object to a string printing to standard
output directly, without buffering. |
static boolean |
isParam(String name)
|
static boolean |
isProperty(String propertyName)
|
void |
listCubeAttribues(String name,
StringBuilder buf)
|
void |
listCubeName(StringBuilder buf)
|
static void |
listParam(String name,
StringBuilder buf)
|
static void |
listParameterNameValues(StringBuilder buf)
|
static void |
listPropertiesAll(StringBuilder buf)
|
static void |
listProperty(String propertyName,
StringBuilder buf)
|
static void |
listPropertyNames(StringBuilder buf)
|
void |
loadParameter(Query query,
Parameter param)
|
void |
loadParameters(Query query)
|
protected static void |
loadPropertiesFromFile(String propFile)
|
static void |
main(String[] args)
|
void |
makeConnectString()
|
void |
noCubeCaching()
|
mondrian.tui.CmdRunner.Expr |
parseParameter(String value)
|
protected void |
printQueryTime()
|
protected void |
printResults(String resultString)
|
protected void |
processSoapXmla(File file,
int validateXmlaResponse)
This is called to process a file containing XMLA as the contents of SOAP xml. |
protected void |
processXmla(File file,
int validateXmlaResponce)
This is called to process a file containing XMLA xml. |
protected static int |
readBlock(Reader reader,
StringBuilder line,
int offset,
String startDelim,
String endDelim,
boolean allowEscape,
boolean addToBuf,
StringBuilder buf,
int i)
Start of a delimted block, read all of it even if it spans more than one line adding each line's |
protected static String |
readLine(Reader reader,
boolean inMdxCmd)
Gather up a line ending in '\n' or EOF. |
protected static int |
readString(Reader reader,
StringBuilder line,
int offset,
StringBuilder buf,
int i)
Start of a string, read all of it even if it spans more than one line adding each line's |
protected String |
reExecuteMdxCmd()
|
Result |
runQuery(String queryString,
boolean loadParams)
Executes a query and returns the result. |
void |
setCubeAttribute(String cubename,
String name,
String value,
StringBuilder buf)
|
(package private) void |
setError(String s)
|
(package private) void |
setError(Throwable t)
|
static void |
setParameter(String name,
String value)
|
static boolean |
setProperty(String name,
String value)
|
void |
setTimeQueries(boolean timeQueries)
|
String |
toString(Result result)
Converts a Result object to a string |
protected static void |
usage(String msg,
PrintStream out)
Prints a usage message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static NumberFormat nf
Constructor Detail |
---|
public CmdRunner(CmdRunner.Options options, PrintWriter out)
CmdRunner
.
options
- Option set, or null to use default optionsout
- Output writer, or null to use System.out
.Method Detail |
---|
public void setTimeQueries(boolean timeQueries)
public boolean getTimeQueries()
public long getQueryTime()
public long getTotalQueryTime()
public void noCubeCaching()
void setError(String s)
void setError(Throwable t)
void clearError()
public static void listPropertyNames(StringBuilder buf)
public static void listPropertiesAll(StringBuilder buf)
public static void listProperty(String propertyName, StringBuilder buf)
public static boolean isProperty(String propertyName)
public static boolean setProperty(String name, String value)
public void loadParameters(Query query)
public void loadParameter(Query query, Parameter param)
public mondrian.tui.CmdRunner.Expr parseParameter(String value)
public static void listParameterNameValues(StringBuilder buf)
public static void listParam(String name, StringBuilder buf)
public static boolean isParam(String name)
public static void setParameter(String name, String value)
public Cube[] getCubes()
public Cube getCube(String name)
public void listCubeName(StringBuilder buf)
public void listCubeAttribues(String name, StringBuilder buf)
public void executeCubeCommand(String cubename, String command, StringBuilder buf)
public void setCubeAttribute(String cubename, String name, String value, StringBuilder buf)
public String execute(String queryString)
queryString
- MDX query text
public Result runQuery(String queryString, boolean loadParams)
queryString
- MDX query text
Result
objectpublic String toString(Result result)
Result
object to a string
public String highCardToString(Result result)
Result
object to a string printing to standard
output directly, without buffering.
public void makeConnectString()
public Connection getConnection()
Connection
public Connection getConnection(boolean fresh)
public String getConnectString()
public String getConnectString(boolean fresh)
protected void debug(String msg)
protected static String getConnectStringProperty()
protected static String getJdbcURLProperty()
protected static String getJdbcUserProperty()
protected static String getJdbcPasswordProperty()
protected static String getCatalogURLProperty()
protected static String getJdbcDriversProperty()
protected void commandLoop(boolean interactive) throws IOException
IOException
protected void commandLoop(File file) throws IOException
IOException
protected void commandLoop(String mdxCmd, boolean interactive) throws IOException
IOException
protected void commandLoop(Reader in, boolean interactive)
in
- Input reader (preferably buffered)interactive
- Whether the session is interactiveprotected void printResults(String resultString)
protected void printQueryTime()
protected static String readLine(Reader reader, boolean inMdxCmd) throws IOException
IOException
protected static int getLine(Reader reader, StringBuilder line) throws IOException
IOException
protected static int readString(Reader reader, StringBuilder line, int offset, StringBuilder buf, int i) throws IOException
IOException
protected static int readBlock(Reader reader, StringBuilder line, int offset, String startDelim, String endDelim, boolean allowEscape, boolean addToBuf, StringBuilder buf, int i) throws IOException
IOException
protected void processSoapXmla(File file, int validateXmlaResponse) throws Exception
Exception
protected void processXmla(File file, int validateXmlaResponce) throws Exception
Exception
protected static String executeHelp(String mdxCmd)
protected static void appendIndent(StringBuilder buf, int i)
protected static void appendSet(StringBuilder buf)
protected String executeSet(String mdxCmd)
protected static void appendLog(StringBuilder buf)
protected String executeLog(String mdxCmd)
protected static void appendFile(StringBuilder buf)
protected String executeFile(String mdxCmd)
protected static void appendList(StringBuilder buf)
protected String executeList(String mdxCmd)
protected static void appendFunc(StringBuilder buf)
protected String executeFunc(String mdxCmd)
protected static void appendParam(StringBuilder buf)
protected String executeParam(String mdxCmd)
protected static void appendCube(StringBuilder buf)
protected String executeCube(String mdxCmd)
protected static void appendError(StringBuilder buf)
protected String executeError(String mdxCmd)
protected static void appendEcho(StringBuilder buf)
protected String executeEcho(String mdxCmd)
protected static void appendExpr(StringBuilder buf)
protected String executeExpr(String mdxCmd)
protected static void appendExit(StringBuilder buf)
protected String reExecuteMdxCmd()
protected String executeMdxCmd(String mdxCmd)
protected static void loadPropertiesFromFile(String propFile) throws IOException
IOException
protected static void usage(String msg, PrintStream out)
msg
- Prefix to the messageout
- Output streampublic static void main(String[] args) throws Exception
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |