org.syrup.sql
Class GenericFunctions

java.lang.Object
  extended byorg.syrup.sql.Functions
      extended byorg.syrup.sql.GenericFunctions

public class GenericFunctions
extends Functions

Utility to implement generic WorkSpace functions using JDBC.

Author:
Robbert van Dalen

Constructor Summary
GenericFunctions(SQLImpl sqlImpl)
          Constructor for the GenericFunctions object
 
Method Summary
 void close(java.sql.ResultSet result)
          Utility method that resets the ResultSet.
 void close(SyrupConnection con)
          Utility method that closes the Connection.
 Data get_out_1(SyrupConnection con)
          Returns the first output by executing SQL statements over a Connection..
 Data get_out_2(SyrupConnection con)
          Returns the second output by executing SQL statements over a Connection..
 Context[] get(PTaskTemplate t, SyrupConnection con)
          Get the Contexts of PTasks that match the PTaskTemplate.
 LogEntry[] match(LogEntryTemplate template, SyrupConnection con)
          Get LogEntries matching the LogEntryTemplate.
 PTask[] match(PTaskTemplate template, SyrupConnection con)
          Get PTasks matching the PTaskTemplate.
 void reset(SyrupConnection con)
          Resets the WorkSpace to the initial state.
 void set_in_1(Data data, SyrupConnection con)
          Sets the first input by executing SQL statements over a Connection..
 void set_in_2(Data data, SyrupConnection con)
          Sets the second input by executing SQL statements over a Connection..
 PTask stop(PTask task, SyrupConnection con)
          Stop non-progressing executions of a PTask.
 
Methods inherited from class org.syrup.sql.Functions
sqlImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericFunctions

public GenericFunctions(SQLImpl sqlImpl)
Constructor for the GenericFunctions object

Parameters:
sqlImpl - The SQLImpl that is held by the Function instance.
Method Detail

set_in_1

public void set_in_1(Data data,
                     SyrupConnection con)
              throws java.lang.Exception
Sets the first input by executing SQL statements over a Connection..

Parameters:
data - The Data that is set on the first input.
con - The SyrupConnection over which SQL statements are executed
Throws:
java.lang.Exception

set_in_2

public void set_in_2(Data data,
                     SyrupConnection con)
              throws java.lang.Exception
Sets the second input by executing SQL statements over a Connection..

Parameters:
data - The Data that is set on the second input.
con - The SyrupConnection over which SQL statements are executed
Throws:
java.lang.Exception

get_out_1

public Data get_out_1(SyrupConnection con)
               throws java.lang.Exception
Returns the first output by executing SQL statements over a Connection..

Parameters:
con - The SyrupConnection over which SQL statements are executed
Returns:
The Data removed from the first output.
Throws:
java.lang.Exception

get_out_2

public Data get_out_2(SyrupConnection con)
               throws java.lang.Exception
Returns the second output by executing SQL statements over a Connection..

Parameters:
con - The SyrupConnection over which SQL statements are executed
Returns:
The Data removed from the second output.
Throws:
java.lang.Exception

match

public PTask[] match(PTaskTemplate template,
                     SyrupConnection con)
              throws java.lang.Exception
Get PTasks matching the PTaskTemplate.

Parameters:
template - The PTaskTemplate to be matched.
con - The SyrupConnection over which SQL statements are executed
Returns:
An array of PTasks that match the PTaskTemplate.
Throws:
java.lang.Exception

match

public LogEntry[] match(LogEntryTemplate template,
                        SyrupConnection con)
                 throws java.lang.Exception
Get LogEntries matching the LogEntryTemplate.

Parameters:
template - The LogEntryTemplate to be matched.
con - The SyrupConnection over which SQL statements are executed
Returns:
An array of LogEntries that match the LogEntryTemplate.
Throws:
java.lang.Exception

get

public Context[] get(PTaskTemplate t,
                     SyrupConnection con)
              throws java.lang.Exception
Get the Contexts of PTasks that match the PTaskTemplate.

Parameters:
t - The PTaskTemplate to be matched.
con - The SyrupConnection over which SQL statements are executed
Returns:
An array of Contexts surrounding the PTasks that match the PTaskTemplate.
Throws:
java.lang.Exception

reset

public void reset(SyrupConnection con)
           throws java.lang.Exception
Resets the WorkSpace to the initial state.

Parameters:
con - The SyrupConnection over which SQL statements are executed
Throws:
java.lang.Exception

stop

public PTask stop(PTask task,
                  SyrupConnection con)
           throws java.lang.Exception
Stop non-progressing executions of a PTask.

Parameters:
task - The PTask to be stopped.
con - The SyrupConnection over which SQL statements are executed
Returns:
The stopped PTask.
Throws:
java.lang.Exception

close

public final void close(SyrupConnection con)
                 throws java.lang.Exception
Utility method that closes the Connection.

Parameters:
con - The SyrupConnection to be closed.
Throws:
java.lang.Exception

close

public final void close(java.sql.ResultSet result)
                 throws java.lang.Exception
Utility method that resets the ResultSet.

Parameters:
result - The ResultSet to be resetted.
Throws:
java.lang.Exception