org.enhydra.shark.api.internal.globalpersistence
Interface GlobalPersistenceManagerInterface


public interface GlobalPersistenceManagerInterface

Interface that has to be implemented for global persistence layer.

Version:
1.0
Author:
Sasa Bojanic

Method Summary
 void configure(CallbackUtilities cus)
          Method configure is called at Shark start up, to configure implementation of GlobalPersistenceManagerInterface.
 void delete(WMSessionHandle shandle, GlobalDataPersistenceObject var)
          Method delete
 java.util.List getAll(WMSessionHandle shandle)
          Method getAll
 java.util.List getWhere(WMSessionHandle shandle, java.lang.String sqlWhere, int startAt, int limit)
           
 void persist(WMSessionHandle shandle, GlobalDataPersistenceObject var)
          Method persist stores the global data into repository (usually database).
 boolean restore(WMSessionHandle shandle, GlobalDataPersistenceObject var)
          Method restore retrieves global data from the repository.
 

Method Detail

configure

void configure(CallbackUtilities cus)
               throws java.lang.Exception
Method configure is called at Shark start up, to configure implementation of GlobalPersistenceManagerInterface.

Parameters:
cus - an instance of CallbackUtilities used to get properties for configuring Persistent Manager in Shark.
Throws:
java.lang.Exception - Thrown if configuring doesn't succeed.

persist

void persist(WMSessionHandle shandle,
             GlobalDataPersistenceObject var)
             throws java.lang.Exception
Method persist stores the global data into repository (usually database).

Parameters:
var - GlobalDataPersistenceObject.
Throws:
java.lang.Exception - on error.

restore

boolean restore(WMSessionHandle shandle,
                GlobalDataPersistenceObject var)
                throws java.lang.Exception
Method restore retrieves global data from the repository.

Parameters:
var - GlobalDataPersistenceObject must contain dataId
Returns:
true on success, false otherwise
Throws:
java.lang.Exception - on error.

delete

void delete(WMSessionHandle shandle,
            GlobalDataPersistenceObject var)
            throws java.lang.Exception
Method delete

Parameters:
var - a GlobalDataPersistenceObject
Throws:
java.lang.Exception - on error.

getAll

java.util.List getAll(WMSessionHandle shandle)
                      throws java.lang.Exception
Method getAll

Returns:
a List
Throws:
java.lang.Exception - on error.

getWhere

java.util.List getWhere(WMSessionHandle shandle,
                        java.lang.String sqlWhere,
                        int startAt,
                        int limit)
                        throws java.lang.Exception
Parameters:
sqlWhere -
Returns:
list of process variables objects complying to sqlWhere clause
Throws:
java.lang.Exception