org.basex.core.cmd
Class Open

java.lang.Object
  extended by org.basex.core.Proc
      extended by org.basex.core.Command
          extended by org.basex.core.cmd.Open

public final class Open
extends Command

Evaluates the 'open' command and opens a database.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.core.Command
args, context, in, mprop, out, perf, prop
 
Fields inherited from class org.basex.core.Proc
listen, updating
 
Constructor Summary
Open(java.lang.String name)
          Default constructor.
 
Method Summary
 void databases(LockResult lr)
          Adds the names of the databases that may be touched by the process.
 boolean newData(Context ctx)
          Closes an open data reference and returns true if this command will change the Context.data reference.
static Data open(java.lang.String name, Context ctx)
          Opens the specified database.
protected  boolean run()
          Executes the command and serializes the result (internal call).
 
Methods inherited from class org.basex.core.Command
build, close, databases, error, execute, execute, getOption, getOption, info, info, result, run, run, setInput, setInput, stoppable, supportsProg, toString, updated, updating
 
Methods inherited from class org.basex.core.Proc
abort, checkStop, det, detail, listen, proc, prog, progress, registered, registered, startTimeout, stop, stopTimeout, tit, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Open

public Open(java.lang.String name)
Default constructor.

Parameters:
name - name of database
Method Detail

run

protected boolean run()
Description copied from class: Command
Executes the command and serializes the result (internal call).

Specified by:
run in class Command
Returns:
success of operation

databases

public void databases(LockResult lr)
Description copied from class: Proc
Adds the names of the databases that may be touched by the process.

Overrides:
databases in class Proc
Parameters:
lr - Container for lock result to pass around

newData

public boolean newData(Context ctx)
Description copied from class: Command
Closes an open data reference and returns true if this command will change the Context.data reference. This method is required by the progress dialog in the frontend.

Overrides:
newData in class Command
Parameters:
ctx - database context
Returns:
result of check

open

public static Data open(java.lang.String name,
                        Context ctx)
                 throws java.io.IOException
Opens the specified database.

Parameters:
name - name of database
ctx - database context
Returns:
data reference
Throws:
java.io.IOException - I/O exception