org.apache.jackrabbit.core.util.db
Class CheckSchemaOperation

java.lang.Object
  extended by org.apache.jackrabbit.core.util.db.CheckSchemaOperation

public class CheckSchemaOperation
extends Object

An operation which synchronously checks the DB schema in the run() method. The addVariableReplacement(String, String) method return the instance to enable method chaining.


Field Summary
static String SCHEMA_OBJECT_PREFIX_VARIABLE
           
static String TABLE_SPACE_VARIABLE
           
 
Constructor Summary
CheckSchemaOperation(ConnectionHelper connectionhelper, InputStream ddlStream, String tableName)
           
 
Method Summary
 CheckSchemaOperation addVariableReplacement(String var, String replacement)
          Adds a variable replacement mapping.
 void run()
          Checks if the required schema objects exist and creates them if they don't exist yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_OBJECT_PREFIX_VARIABLE

public static final String SCHEMA_OBJECT_PREFIX_VARIABLE
See Also:
Constant Field Values

TABLE_SPACE_VARIABLE

public static final String TABLE_SPACE_VARIABLE
See Also:
Constant Field Values
Constructor Detail

CheckSchemaOperation

public CheckSchemaOperation(ConnectionHelper connectionhelper,
                            InputStream ddlStream,
                            String tableName)
Parameters:
connectionhelper - the connection helper
ddlStream - the stream of the DDL to use to create the schema if necessary (closed by the run() method)
tableName - the name of the table to use for the schema-existence-check
Method Detail

addVariableReplacement

public CheckSchemaOperation addVariableReplacement(String var,
                                                   String replacement)
Adds a variable replacement mapping.

Parameters:
var - the variable
replacement - the replacement value
Returns:
this

run

public void run()
         throws SQLException,
                IOException
Checks if the required schema objects exist and creates them if they don't exist yet.

Throws:
SQLException - if an error occurs
IOException - if an error occurs


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.