|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.mediation.initializer.persistence.AbstractStore<T>
T - public abstract class AbstractStore<T>
The abstract class which can be used to access a persistence storage of a specific type of mediation configuration elements. Implementations of this abstract class should ideally be parameterized to prevent it from handling more than one type of objects. This abstract class provides supports basic persistence activities of save and delete. Registry persistence activities can also be handled by this implementation if required.
| Field Summary | |
|---|---|
protected String |
configPath
|
protected org.apache.commons.logging.Log |
log
|
protected AbstractRegistryStore |
registryStore
|
protected org.apache.synapse.config.xml.MultiXMLConfigurationSerializer |
serializer
|
| Constructor Summary | |
|---|---|
AbstractStore(String configPath)
|
|
| Method Summary | |
|---|---|
void |
delete(String name,
String fileName,
org.apache.synapse.config.SynapseConfiguration config)
|
protected abstract void |
deleteFile(String fileName,
org.apache.synapse.config.SynapseConfiguration config)
Delete the specified file from the persistence store. |
protected void |
deleteFromRegistry(String name)
|
void |
deleteItemFromRegistry(String name)
|
protected abstract String |
getFileName(T obj)
Inspect the given object and find the file name to which it should be serialized to |
protected abstract T |
getObjectToPersist(String name,
org.apache.synapse.config.SynapseConfiguration config)
Find the specified object from the SynaspeConfiguration to be saved to the persistence store |
protected void |
handleException(String msg,
Exception e)
|
void |
save(String name,
org.apache.synapse.config.SynapseConfiguration config)
|
void |
saveItemToRegistry(String name,
org.apache.synapse.config.SynapseConfiguration config)
|
protected abstract org.apache.axiom.om.OMElement |
saveToFile(T obj,
org.apache.synapse.config.SynapseConfiguration synapseConfig)
Serialize and save the given object to the local file system |
protected void |
saveToRegistry(String name,
org.apache.axiom.om.OMElement element,
String fileName)
|
protected abstract org.apache.axiom.om.OMElement |
serialize(T obj)
Serialize the given object into XML |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.commons.logging.Log log
protected String configPath
protected AbstractRegistryStore registryStore
protected org.apache.synapse.config.xml.MultiXMLConfigurationSerializer serializer
| Constructor Detail |
|---|
public AbstractStore(String configPath)
| Method Detail |
|---|
public void save(String name,
org.apache.synapse.config.SynapseConfiguration config)
public void delete(String name,
String fileName,
org.apache.synapse.config.SynapseConfiguration config)
protected abstract org.apache.axiom.om.OMElement saveToFile(T obj,
org.apache.synapse.config.SynapseConfiguration synapseConfig)
obj - Object to be savedsynapseConfig - synapse configuration
protected abstract void deleteFile(String fileName,
org.apache.synapse.config.SynapseConfiguration config)
fileName - Name of the file to be deletedconfig - synapse configuration
protected abstract T getObjectToPersist(String name,
org.apache.synapse.config.SynapseConfiguration config)
name - Name or unique ID of the objectconfig - Current SynapseConfiguration
protected abstract String getFileName(T obj)
obj - The object to be inspected
protected abstract org.apache.axiom.om.OMElement serialize(T obj)
obj - The object to be serialized
public void saveItemToRegistry(String name,
org.apache.synapse.config.SynapseConfiguration config)
public void deleteItemFromRegistry(String name)
protected void saveToRegistry(String name,
org.apache.axiom.om.OMElement element,
String fileName)
protected void deleteFromRegistry(String name)
protected void handleException(String msg,
Exception e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||