org.ow2.petals.system.persistence
Interface PersistenceService

All Known Implementing Classes:
PersistenceServiceImpl

public interface PersistenceService

The Persistent Service.

Since:
3.1
Author:
rnaudin

Field Summary
static long DEFAULT_DURATION
          Default Persistence duration
static int DEFAULT_FETCHSIZE
          Default Persistence SQL request fetch size
static java.lang.String DEFAULT_PASSWORD
          The default Password configuration
static java.lang.String DEFAULT_URL_PREFIX
          The default URL configuration (File database)
static java.lang.String DEFAULT_URL_SUFFIX
           
static java.lang.String DEFAULT_USER
          The default User configuration
static java.lang.String HSQLDB_DRIVER
          The HSQLDB driver
static java.lang.String MYSQL_DRIVER
          The MYSQL driver
static java.lang.String ORACLE_DRIVER
          The ORACLE driver
 
Method Summary
 void addMessageExchange(org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl exchange, boolean storeExchange, java.lang.Boolean isSent)
          Add a Message Exchange to the persistence service.
 void clearExchangeStorage()
          Clear the exchange storage.
 void deleteMessageExchange(java.lang.String exchangeId)
          Delete the exchange.
 long getExchangeStorageDuration()
          Get the exchange storage duration.
 org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl getMessageExchange(java.lang.String exchangeId)
          Retrieve a Message Exchange from the persistence.
 java.util.Map<java.lang.String,java.lang.Long> getMessageExchangeHistory(java.lang.String exchangeId)
          Get the Message Exchange sent/received history from the persistence.
 java.util.List<java.lang.String> getMessageExchangeIds(javax.xml.namespace.QName interfaceName, javax.xml.namespace.QName serviceName, java.lang.String endpointName, javax.xml.namespace.QName operationName, long startDate, long endDate)
          Retrieve a list of Message Exchange Ids from the persistence matching the given criteria and the exchange persistence duration
 java.util.List<java.lang.String> getMessageExchangeIds(java.lang.String propertyKey, java.lang.String propertyValue)
          Retrieve a list of Message Exchange Ids from the persistence matching the given the given exchange property and the exchange persistence duration
 int getMessageExchanges(javax.xml.namespace.QName interfaceName, javax.xml.namespace.QName serviceName, java.lang.String endpointName, javax.xml.namespace.QName operationName, long startDate, long endDate)
          Count the number of processed exchanges matching the given criteria.
 void setExchangeStorageDuration(long duration)
          Set the exchange storage duration.
 void updateMessageExchange(org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl exchange, boolean storeExchange, java.lang.Boolean isSent)
          Update a Message Exchange in the persistence service.
 

Field Detail

DEFAULT_DURATION

static final long DEFAULT_DURATION
Default Persistence duration

See Also:
Constant Field Values

DEFAULT_FETCHSIZE

static final int DEFAULT_FETCHSIZE
Default Persistence SQL request fetch size

See Also:
Constant Field Values

DEFAULT_PASSWORD

static final java.lang.String DEFAULT_PASSWORD
The default Password configuration

See Also:
Constant Field Values

DEFAULT_URL_PREFIX

static final java.lang.String DEFAULT_URL_PREFIX
The default URL configuration (File database)

See Also:
Constant Field Values

DEFAULT_URL_SUFFIX

static final java.lang.String DEFAULT_URL_SUFFIX
See Also:
Constant Field Values

DEFAULT_USER

static final java.lang.String DEFAULT_USER
The default User configuration

See Also:
Constant Field Values

HSQLDB_DRIVER

static final java.lang.String HSQLDB_DRIVER
The HSQLDB driver

See Also:
Constant Field Values

ORACLE_DRIVER

static final java.lang.String ORACLE_DRIVER
The ORACLE driver

See Also:
Constant Field Values

MYSQL_DRIVER

static final java.lang.String MYSQL_DRIVER
The MYSQL driver

See Also:
Constant Field Values
Method Detail

addMessageExchange

void addMessageExchange(org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl exchange,
                        boolean storeExchange,
                        java.lang.Boolean isSent)
                        throws java.sql.SQLException,
                               java.io.IOException
Add a Message Exchange to the persistence service.

Parameters:
exchange - the exchange
storeExchange - if true, persist the body of the exchange. If false, persist only the exchangeId and the current timestamp
isSend - if true, it is an exchange sent
if false, it is an exchange receipt if null, it is nor a send or receipt
Throws:
java.sql.SQLException
java.io.IOException

clearExchangeStorage

void clearExchangeStorage()
Clear the exchange storage.


deleteMessageExchange

void deleteMessageExchange(java.lang.String exchangeId)
                           throws java.sql.SQLException
Delete the exchange.

Parameters:
exchangeId -
Throws:
java.sql.SQLException

getExchangeStorageDuration

long getExchangeStorageDuration()
Get the exchange storage duration. When the duration is reached, the exchanges are removed from the Persistence Service.

Parameters:
duration -

getMessageExchange

org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl getMessageExchange(java.lang.String exchangeId)
                                                                             throws java.sql.SQLException,
                                                                                    java.io.IOException,
                                                                                    java.lang.ClassNotFoundException
Retrieve a Message Exchange from the persistence.

Parameters:
exchangeId - the Id of the exchange
Returns:
the recreated MessageExchangeImpl instance
Throws:
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException

getMessageExchangeHistory

java.util.Map<java.lang.String,java.lang.Long> getMessageExchangeHistory(java.lang.String exchangeId)
                                                                         throws java.sql.SQLException
Get the Message Exchange sent/received history from the persistence.

Parameters:
exchangeId - the Id of the exchange
Returns:
a map of events, the type (sent or received) as key, the timestamp in millisecond as value.
Throws:
java.sql.SQLException

getMessageExchangeIds

java.util.List<java.lang.String> getMessageExchangeIds(javax.xml.namespace.QName interfaceName,
                                                       javax.xml.namespace.QName serviceName,
                                                       java.lang.String endpointName,
                                                       javax.xml.namespace.QName operationName,
                                                       long startDate,
                                                       long endDate)
                                                       throws java.sql.SQLException
Retrieve a list of Message Exchange Ids from the persistence matching the given criteria and the exchange persistence duration

Parameters:
interfaceName - The interface name that exchange targets. Can be null
serviceName - The service name that exchange targets. Can be null
endpointName - The endpoint name that exchange targets. Can be null
operationName - The operation name that exchange targets. Can be null
startDate - the start date
endDate - the end date
Returns:
the List of Exchange Ids.
Throws:
java.sql.SQLException

getMessageExchangeIds

java.util.List<java.lang.String> getMessageExchangeIds(java.lang.String propertyKey,
                                                       java.lang.String propertyValue)
                                                       throws java.sql.SQLException,
                                                              java.io.IOException
Retrieve a list of Message Exchange Ids from the persistence matching the given the given exchange property and the exchange persistence duration

Parameters:
propertyKey - The name of the property
propertyValue - The value of the property as a String
Returns:
the list of the exchange Ids
Throws:
java.sql.SQLException
java.io.IOException

getMessageExchanges

int getMessageExchanges(javax.xml.namespace.QName interfaceName,
                        javax.xml.namespace.QName serviceName,
                        java.lang.String endpointName,
                        javax.xml.namespace.QName operationName,
                        long startDate,
                        long endDate)
                        throws java.sql.SQLException
Count the number of processed exchanges matching the given criteria.

Parameters:
exchangeId - the Id of the exchange
Throws:
java.sql.SQLException

setExchangeStorageDuration

void setExchangeStorageDuration(long duration)
Set the exchange storage duration. When the duration is reached, the exchanges are removed from the Persistence Service.

Parameters:
duration -

updateMessageExchange

void updateMessageExchange(org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl exchange,
                           boolean storeExchange,
                           java.lang.Boolean isSent)
                           throws java.sql.SQLException,
                                  java.io.IOException
Update a Message Exchange in the persistence service.

Parameters:
exchange - the exchange
storeExchange - if true, persist the body of the exchange. If false, persist only the exchangeId and the current timestamp
isSend - if true, it is an exchange sent
if false, it is an exchange receipt if null, it is nor a send or receipt
Throws:
java.sql.SQLException
java.io.IOException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.