org.syrup.sql
Class UpdateFunctions

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

public class UpdateFunctions
extends Functions

Utility functions to update Syrup Objects using JDBC.

Author:
Robbert van Dalen

Constructor Summary
UpdateFunctions(SQLImpl sqlImpl)
          Constructor for the UpdateFunctions object
 
Method Summary
protected  void checkAndUpdateDone(java.lang.String key, SyrupConnection con)
          Checks and updates the done state of a PTask by executing SQL statements over a Connection.
protected  void checkAndUpdateInExecutable(java.lang.String to, boolean to_port, SyrupConnection con)
          Checks and updates the execution state of an ingoing PTask by executing SQL statements over a Connection.
protected  void checkAndUpdateOutExecutable(java.lang.String from, boolean from_port, SyrupConnection con)
          Checks and updates the execution state of an outgoing PTask by executing SQL statements over a Connection.
protected  void checkAndUpdateTargetExecutable(java.lang.String statement, java.lang.String key, boolean port, SyrupConnection con)
          Checks and updates the execution state of an ingoing/outgoing PTask by executing SQL statements over a Connection.
protected  void checkAndUpdateTargetExecutable(java.lang.String key, SyrupConnection con)
          Checks and updates the execution state of a PTask by executing SQL statements over a Connection.
protected  void rewireInLink(java.lang.String old_task, boolean old_port, InPort ip, java.util.Hashtable map, SyrupConnection con)
          Rewires the input Link from one PTask to another by executing SQL statements over a Connection.
protected  void rewireLink(java.lang.String statement, java.lang.String old_task, boolean old_port, Port p, java.util.Hashtable map, SyrupConnection con)
          Rewires the input/output Link from one PTask to another PTask by executing SQL statements over a Connection.
protected  void rewireOutLink(java.lang.String old_task, boolean old_port, OutPort op, java.util.Hashtable map, SyrupConnection con)
          Rewires the output Link from one PTask to another by executing SQL statements over a Connection.
protected  void updateInLink(java.lang.String to, boolean to_port, Data data, SyrupConnection con)
          Updates the ingoing Link of an PTask with Data by executing SQL statements over a Connection.
protected  void updateLink(java.lang.String statement, java.lang.String task, boolean port, Data data, SyrupConnection con)
          Utility function that updates the Link of an PTask with Data by executing SQL statements over a Connection.
protected  void updateOutLink(java.lang.String from, boolean from_port, Data data, SyrupConnection con)
          Updates the outgoing Link of an PTask with Data by executing SQL statements over a SyrupConnection.
 
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

UpdateFunctions

public UpdateFunctions(SQLImpl sqlImpl)
Constructor for the UpdateFunctions object

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

updateOutLink

protected void updateOutLink(java.lang.String from,
                             boolean from_port,
                             Data data,
                             SyrupConnection con)
                      throws java.lang.Exception
Updates the outgoing Link of an PTask with Data by executing SQL statements over a SyrupConnection.

Parameters:
from - The Ptask identifier of the outgoing Link.
from_port - The out Port of the PTask's outgoing Link.
data - The Data that the Link is updated with.
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

updateInLink

protected void updateInLink(java.lang.String to,
                            boolean to_port,
                            Data data,
                            SyrupConnection con)
                     throws java.lang.Exception
Updates the ingoing Link of an PTask with Data by executing SQL statements over a Connection.

Parameters:
to - The Ptask identifier of the ingoing Link.
to_port - The in Port of the PTask's oingoing Link.
data - The Data that the Link is updated with.
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

updateLink

protected void updateLink(java.lang.String statement,
                          java.lang.String task,
                          boolean port,
                          Data data,
                          SyrupConnection con)
                   throws java.lang.Exception
Utility function that updates the Link of an PTask with Data by executing SQL statements over a Connection.

Parameters:
statement - The SQL statement that can update a Link.
task - The Ptask identifier of the Link.
port - The out Port of the PTask's Link.
data - The Data that the Link is updated with.
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

checkAndUpdateInExecutable

protected void checkAndUpdateInExecutable(java.lang.String to,
                                          boolean to_port,
                                          SyrupConnection con)
                                   throws java.lang.Exception
Checks and updates the execution state of an ingoing PTask by executing SQL statements over a Connection.

Parameters:
to - The base Ptask identifier.
to_port - The in Port of the PTask.
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

checkAndUpdateOutExecutable

protected void checkAndUpdateOutExecutable(java.lang.String from,
                                           boolean from_port,
                                           SyrupConnection con)
                                    throws java.lang.Exception
Checks and updates the execution state of an outgoing PTask by executing SQL statements over a Connection.

Parameters:
from - The base Ptask identifier.
from_port - The out Port of the PTask.
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

checkAndUpdateTargetExecutable

protected void checkAndUpdateTargetExecutable(java.lang.String statement,
                                              java.lang.String key,
                                              boolean port,
                                              SyrupConnection con)
                                       throws java.lang.Exception
Checks and updates the execution state of an ingoing/outgoing PTask by executing SQL statements over a Connection.

Parameters:
statement - The SQL statement to update the ingoing/outgoing PTask.
key - The base Ptask identifier.
port - The in/out Port of the PTask.
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

checkAndUpdateDone

protected void checkAndUpdateDone(java.lang.String key,
                                  SyrupConnection con)
                           throws java.lang.Exception
Checks and updates the done state of a PTask by executing SQL statements over a Connection.

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

checkAndUpdateTargetExecutable

protected void checkAndUpdateTargetExecutable(java.lang.String key,
                                              SyrupConnection con)
                                       throws java.lang.Exception
Checks and updates the execution state of a PTask by executing SQL statements over a Connection.

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

rewireInLink

protected void rewireInLink(java.lang.String old_task,
                            boolean old_port,
                            InPort ip,
                            java.util.Hashtable map,
                            SyrupConnection con)
                     throws java.lang.Exception
Rewires the input Link from one PTask to another by executing SQL statements over a Connection.

Parameters:
old_task - The PTask identifier to be rewired from.
old_port - The PTask's Port to be rewired from.
ip - The InPort of the PTask to be rewired to.
map - The Map with entries [Task -> Task-key]
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

rewireOutLink

protected void rewireOutLink(java.lang.String old_task,
                             boolean old_port,
                             OutPort op,
                             java.util.Hashtable map,
                             SyrupConnection con)
                      throws java.lang.Exception
Rewires the output Link from one PTask to another by executing SQL statements over a Connection.

Parameters:
old_task - The PTask identifier to be rewired from.
old_port - The PTask's Port to be rewired from.
op - The OutPort of the PTask to be rewired to.
map - The Map with entries [Task -> Task-key]
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

rewireLink

protected void rewireLink(java.lang.String statement,
                          java.lang.String old_task,
                          boolean old_port,
                          Port p,
                          java.util.Hashtable map,
                          SyrupConnection con)
                   throws java.lang.Exception
Rewires the input/output Link from one PTask to another PTask by executing SQL statements over a Connection.

Parameters:
statement - The SQL statement to update the rewired input/output Link.
old_task - The PTask identifier to be rewired from.
old_port - The PTask's Port to be rewired from.
p - The Port of the PTask to be rewired to.
map - The Map with entries [Task -> Task-key]
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception