xmlBlaster 2.2.0 API

org.xmlBlaster.engine.persistence
Interface I_PersistenceDriver

All Superinterfaces:
I_Plugin
All Known Implementing Classes:
FileDriver

Deprecated. Please use I_Queue and I_Map instead

public interface I_PersistenceDriver
extends I_Plugin

This interface hides the real driver to manage the persistence of messages.

Interface for xmlBlaster to access a persistent store.
Implement this interface if you want your own persistence handling and add your driver to the $HOME/xmlBlaster.properties configuration file.
FileDriver.java is a very simple reference implementation, storing the messages to files.
TODO: Extend interface to support caching!

Author:
goetzger

Method Summary
 void erase(XmlKey xmlKey)
          Deprecated. Allows a stored message to be deleted.
 MsgUnit fetch(java.lang.String oid)
          Deprecated. Fetches one message by oid from the persistence.
 java.util.Enumeration fetchAllOids()
          Deprecated. Fetches all oid's of the messages from the persistence.
 java.lang.String getName()
          Deprecated. gives the name of the driver

 void shutdown()
          Deprecated. Closes the instance of the persistence plugin

The protocol for storing is implemented in the derived class

 void store(MsgUnitWrapper messageWrapper)
          Deprecated. Allows a message to be stored.
 void update(MsgUnitWrapper messageWrapper)
          Deprecated. Allows a stored message content to be updated.
 
Methods inherited from interface org.xmlBlaster.util.plugin.I_Plugin
getType, getVersion, init
 

Method Detail

shutdown

void shutdown()
              throws XmlBlasterException
Deprecated. 
Closes the instance of the persistence plugin

The protocol for storing is implemented in the derived class

Specified by:
shutdown in interface I_Plugin
Throws:
XmlBlasterException - if an exception occurs. The exception is handled by the RunLevelManager depending on how the plugin has been configured with the action:

<action do='STOP' onShutdownRunlevel='2' sequence='5' onFail='resource.configuration.pluginFailed'> If onFail is defined to something, the RunLevelManager will stop.


store

void store(MsgUnitWrapper messageWrapper)
           throws XmlBlasterException
Deprecated. 
Allows a message to be stored.

It only stores the xmlKey, content and qos. The other store() method is called for following messages, to store only message-content.

The protocol for storing is implemented in the derived class

Parameters:
messageWrapper - The container with all necessary message info.
Throws:
XmlBlasterException

update

void update(MsgUnitWrapper messageWrapper)
            throws XmlBlasterException
Deprecated. 
Allows a stored message content to be updated.

It only stores the content, so the other store() method needs to be called first if this message is new.

The protocol for storing is implemented in the derived class

Parameters:
xmlKey - To identify the message
content - The data to store
qos - The quality of service, may contain another publisher name
Throws:
XmlBlasterException

fetch

MsgUnit fetch(java.lang.String oid)
              throws XmlBlasterException
Deprecated. 
Fetches one message by oid from the persistence.

This method needs the RequestBroker for recovery.

Parameters:
oid - The messages name (key oid="...")
Returns:
the MsgUnit, which is persistent
Throws:
XmlBlasterException

fetchAllOids

java.util.Enumeration fetchAllOids()
                                   throws XmlBlasterException
Deprecated. 
Fetches all oid's of the messages from the persistence.

It is a helper method to invoke 'fetch(String oid)'.

Returns:
a Enumeration of oids of all persistent MsgUnits. The oid is a String-Type.
Throws:
XmlBlasterException

erase

void erase(XmlKey xmlKey)
           throws XmlBlasterException
Deprecated. 
Allows a stored message to be deleted.

The protocol for storing is implemented in the derived class

Parameters:
xmlKey - To identify the message
Throws:
XmlBlasterException

getName

java.lang.String getName()
Deprecated. 
gives the name of the driver

Returns:
the name of the driver

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.