org.ow2.petals.microkernel.api.system.persistence
Interface PersistenceService

All Superinterfaces:
org.ow2.petals.clientserverapi.system.persistence.PersistenceService

public interface PersistenceService
extends org.ow2.petals.clientserverapi.system.persistence.PersistenceService

The Persistent Service.

Since:
3.1
Author:
Roland Naudin - EBM WebSourcing

Field Summary
static String COMPONENT_LOGGER_NAME
           
static String DEFAULT_URL_PREFIX
          The default URL configuration (File database)
static String DEFAULT_URL_SUFFIX
           
 
Fields inherited from interface org.ow2.petals.clientserverapi.system.persistence.PersistenceService
DEFAULT_DURATION, DEFAULT_FETCHSIZE, DEFAULT_PASSWORD, DEFAULT_USER, HSQLDB_DRIVER, MYSQL_DRIVER, ORACLE_DRIVER
 
Method Summary
 void addMessageExchange(org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl exchange, boolean storeExchange, Boolean isSent)
          Add a Message Exchange to the persistence service.
 void clearExchangeStorage()
          Clear the exchange storage.
 void deleteMessageExchange(String exchangeId)
          Delete the exchange.
 long getExchangeStorageDuration()
          Get the exchange storage duration.
 org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl getMessageExchange(String exchangeId)
          Retrieve a Message Exchange from the persistence.
 Map<String,Long> getMessageExchangeHistory(String exchangeId)
          Get the Message Exchange sent/received history from the persistence.
 List<String> getMessageExchangeIds(QName interfaceName, QName serviceName, String endpointName, 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
 List<String> getMessageExchangeIds(String propertyKey, 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(QName interfaceName, QName serviceName, String endpointName, 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, Boolean isSent)
          Update a Message Exchange in the persistence service.
 

Field Detail

COMPONENT_LOGGER_NAME

static final String COMPONENT_LOGGER_NAME
See Also:
Constant Field Values

DEFAULT_URL_PREFIX

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

See Also:
Constant Field Values

DEFAULT_URL_SUFFIX

static final String DEFAULT_URL_SUFFIX
See Also:
Constant Field Values
Method Detail

addMessageExchange

void addMessageExchange(org.ow2.petals.jbi.messaging.exchange.MessageExchangeImpl exchange,
                        boolean storeExchange,
                        Boolean isSent)
                        throws SQLException,
                               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:
SQLException
IOException

clearExchangeStorage

void clearExchangeStorage()
Clear the exchange storage.


deleteMessageExchange

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

Parameters:
exchangeId -
Throws:
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(String exchangeId)
                                                                             throws SQLException,
                                                                                    IOException,
                                                                                    ClassNotFoundException
Retrieve a Message Exchange from the persistence.

Parameters:
exchangeId - the Id of the exchange
Returns:
the recreated MessageExchangeImpl instance
Throws:
SQLException
IOException
ClassNotFoundException

getMessageExchangeHistory

Map<String,Long> getMessageExchangeHistory(String exchangeId)
                                           throws 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:
SQLException

getMessageExchangeIds

List<String> getMessageExchangeIds(QName interfaceName,
                                   QName serviceName,
                                   String endpointName,
                                   QName operationName,
                                   long startDate,
                                   long endDate)
                                   throws 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:
SQLException

getMessageExchangeIds

List<String> getMessageExchangeIds(String propertyKey,
                                   String propertyValue)
                                   throws SQLException,
                                          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:
SQLException
IOException

getMessageExchanges

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

Parameters:
exchangeId - the Id of the exchange
Throws:
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,
                           Boolean isSent)
                           throws SQLException,
                                  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:
SQLException
IOException


Copyright © 2005-2015 Linagora. All Rights Reserved.