org.yawlfoundation.yawl.resourcing.datastore.orgdata
Class jdbcImpl

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.datastore.orgdata.DataSource
      extended by org.yawlfoundation.yawl.resourcing.datastore.orgdata.jdbcImpl

public class jdbcImpl
extends DataSource

A vanilla JDBC implementation of the DataSource abstraction

Author:
Michael Adams v0.1, 28/08/2007

Field Summary
 
Fields inherited from class org.yawlfoundation.yawl.resourcing.datastore.orgdata.DataSource
_name
 
Constructor Summary
jdbcImpl()
           
 
Method Summary
 boolean authenticate(String userid, String password)
          Allows a user/password pair to be passed to an external data source for validation.
 boolean delete(Object obj)
          deletes the object from the database
 int execUpdate(String sql)
          Executes an UPDATE, INSERT or DELETE statement
 void importObj(Object obj)
          imports (persists) a new object into the datastore.
 String insert(Object obj)
          inserts the object into the database
 ResourceDataSet loadResources()
          Loads the entire contents of the org datastores into the relevant Participant, Role, Capability, Position and OrgGroup objects
 void printDump()
          Dump database connection metadata
 void update(Object obj)
          updates an existing object in the database with new values
 
Methods inherited from class org.yawlfoundation.yawl.resourcing.datastore.orgdata.DataSource
getName, getNextID, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

jdbcImpl

public jdbcImpl()
Method Detail

execUpdate

public int execUpdate(String sql)
Executes an UPDATE, INSERT or DELETE statement

Specified by:
execUpdate in class DataSource
Parameters:
sql - the statement to execute
Returns:
the number of affected rows (or -1 if not successful)

printDump

public void printDump()
Dump database connection metadata


loadResources

public ResourceDataSet loadResources()
Description copied from class: DataSource
Loads the entire contents of the org datastores into the relevant Participant, Role, Capability, Position and OrgGroup objects

Specified by:
loadResources in class DataSource
Returns:
a fully populated ResourceSet

insert

public String insert(Object obj)
inserts the object into the database

Specified by:
insert in class DataSource
Parameters:
obj - the object to insert
Returns:
a unique primary key identifier generated during the insert

importObj

public void importObj(Object obj)
Description copied from class: DataSource
imports (persists) a new object into the datastore. The difference between this method and 'insert' is that insert generates a new object id - this method does not (it assumes the object already has a valid id).

Specified by:
importObj in class DataSource
Parameters:
obj - the object to insert

update

public void update(Object obj)
updates an existing object in the database with new values

Specified by:
update in class DataSource
Parameters:
obj - the object to update

delete

public boolean delete(Object obj)
deletes the object from the database

Specified by:
delete in class DataSource
Parameters:
obj - the object to delete

authenticate

public boolean authenticate(String userid,
                            String password)
                     throws YAuthenticationException
Description copied from class: DataSource
Allows a user/password pair to be passed to an external data source for validation.

Specified by:
authenticate in class DataSource
Parameters:
userid - the userid
password - the plain-text password
Returns:
the outcome of the authentication
Throws:
YAuthenticationException


Copyright © 2004-2012 The YAWL Foundation.