org.basex.core
Class Process

java.lang.Object
  extended by org.basex.core.Progress
      extended by org.basex.core.AbstractProcess
          extended by org.basex.core.Process
Direct Known Subclasses:
Check, Close, Copy, CreateDB, CreateFS, CreateIndex, CreateMAB, Cs, Delete, DropDB, DropIndex, Exit, Export, Find, Fs, GetInfo, GetResult, Help, Info, InfoDB, InfoIndex, InfoTable, Insert, List, Open, Optimize, Ping, Prompt, Set, Update, XMark, XPath, XPathMV, XQEnv, XQuery

public abstract class Process
extends AbstractProcess

This class provides the architecture for all internal command implementations. It evaluates queries that are sent by the GUI, the client or the standalone version.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Field Summary
 java.lang.String[] args
          Command arguments.
 
Constructor Summary
Process(int p, java.lang.String... a)
          Constructor.
 
Method Summary
 java.lang.String args()
          Returns the list of arguments.
 boolean data()
          Returns if the current command needs a data reference for processing.
 boolean error(java.lang.String msg, java.lang.Object... ext)
          Adds the error message to the message buffer info.
 boolean execute(Context ctx)
          Executes a command.
 void execute(Context ctx, PrintOutput out)
          Executes the process and serializes the results.
 java.lang.String info()
          Returns the query information as a string.
 void info(PrintOutput out)
          Returns process info.
 boolean info(java.lang.String str, java.lang.Object... ext)
          Adds information on the process execution.
 java.lang.String name()
          Returns the class name.
 void output(PrintOutput out)
          Serializes the textual results of a command.
 boolean printing()
          Returns if the current command yields some output.
 Result result()
          Returns the result set, generated by the last query.
 java.lang.String toString()
           
 boolean updating()
          Returns if the current command generates updates in the data structure.
 
Methods inherited from class org.basex.core.Progress
checkStop, det, detail, prog, progress, progress, stop, title
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

args

public java.lang.String[] args
Command arguments.

Constructor Detail

Process

public Process(int p,
               java.lang.String... a)
Constructor.

Parameters:
p - properties
a - arguments
Method Detail

execute

public void execute(Context ctx,
                    PrintOutput out)
             throws java.lang.Exception
Executes the process and serializes the results. If an error happens, an exception is thrown.

Parameters:
ctx - query context
out - output stream
Throws:
java.lang.Exception - execution exception

execute

public final boolean execute(Context ctx)
Description copied from class: AbstractProcess
Executes a command.

Specified by:
execute in class AbstractProcess
Parameters:
ctx - context reference
Returns:
success of operation

output

public final void output(PrintOutput out)
                  throws java.io.IOException
Description copied from class: AbstractProcess
Serializes the textual results of a command.

Specified by:
output in class AbstractProcess
Parameters:
out - output stream
Throws:
java.io.IOException - I/O exception

info

public final void info(PrintOutput out)
                throws java.io.IOException
Description copied from class: AbstractProcess
Returns process info.

Specified by:
info in class AbstractProcess
Parameters:
out - output stream
Throws:
java.io.IOException - I/O exception

error

public final boolean error(java.lang.String msg,
                           java.lang.Object... ext)
Adds the error message to the message buffer info.

Parameters:
msg - error message
ext - error extension
Returns:
false

info

public final boolean info(java.lang.String str,
                          java.lang.Object... ext)
Adds information on the process execution.

Parameters:
str - information to be added
ext - extended info
Returns:
true

info

public final java.lang.String info()
Returns the query information as a string.

Returns:
info string

result

public final Result result()
Returns the result set, generated by the last query.

Returns:
result set

printing

public final boolean printing()
Returns if the current command yields some output.

Returns:
result of check

data

public final boolean data()
Returns if the current command needs a data reference for processing.

Returns:
result of check

updating

public final boolean updating()
Returns if the current command generates updates in the data structure.

Returns:
result of check

args

public final java.lang.String args()
Returns the list of arguments.

Returns:
arguments

name

public final java.lang.String name()
Returns the class name.

Returns:
class name

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object