public abstract class GenericTransactionManager extends Object implements TransactionManager
A transaction manager will parse incoming JSON messages and inform the TransactionManagerQueueConsumer which Transformers, Subscribers, Indexing and Messaging sould occur in response.
Implementations of this Plugin are expected to execute inside the TransactionManagerQueueConsumer and should confirm to the expected message formats, as per documentation.
| Constructor and Description |
|---|
GenericTransactionManager(String id,
String name)
Constructor, standard for plugins
|
| Modifier and Type | Method and Description |
|---|---|
String |
getId()
Gets an identifier for Harvester plugin
|
JsonSimpleConfig |
getJsonConfig()
Get config file
|
String |
getName()
Get a name for Harvester plugin
|
PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin.
|
abstract void |
init()
Abstract method for Harvester plugin
|
void |
init(File jsonFile)
Initialises the plugin using the specified JSON configuration
|
void |
init(String jsonString)
Initialises the plugin using the specified JSON String
|
abstract JsonSimple |
parseMessage(JsonSimple message)
This method is expected to be overwritten by implementations.
|
Object |
parseMessage(Object message)
This wrapper implements the API and enforces the practical requirement
that the I/O Objects are appropriate JSON classes.
|
void |
shutdown()
Shuts down the plugin
|
public String getId()
public String getName()
public PluginDescription getPluginDetails()
getPluginDetails in interface Pluginpublic void init(File jsonFile) throws PluginException
init in interface PluginjsonFile - JSON configuration filePluginException - if there was an error during initialisationpublic void init(String jsonString) throws PluginException
init in interface PluginjsonFile - JSON configuration filePluginException - if there was an error during initialisationpublic abstract void init()
throws TransactionException
HarvesterException - if there was an error during initialisationTransactionExceptionpublic void shutdown()
throws PluginException
shutdown in interface PluginPluginException - if there was an error during shutdownpublic JsonSimpleConfig getJsonConfig() throws TransactionException
HarvesterException - if there was an error during retrievalTransactionExceptionpublic final Object parseMessage(Object message) throws TransactionException
This wrapper implements the API and enforces the practical requirement that the I/O Objects are appropriate JSON classes.
Implementations should overwrite the correctly typed method.
parseMessage in interface TransactionManagermessage - The message to parse, in JSONTransactionException - If an error occurred or the the message is
in a bad format or otherwise unsuitable.public abstract JsonSimple parseMessage(JsonSimple message) throws TransactionException
This method is expected to be overwritten by implementations. This is where the real processing should occur.
message - The JsonSimple message to processTransactionException - If an error occurredCopyright © 2009-2013. All Rights Reserved.