@Deprecated public abstract class AbstractFilePersistenceManager extends Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.axis2.engine.AxisConfiguration |
axisConfig
Deprecated.
|
protected org.apache.axiom.om.OMFactory |
omFactory
Deprecated.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractFilePersistenceManager(org.apache.axis2.engine.AxisConfiguration axisConfig)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
beginTransaction(String resourceId)
Deprecated.
|
void |
commitTransaction(String resourceId)
Deprecated.
|
boolean |
delete(String resourceId,
String xpathStr)
Deprecated.
|
boolean |
deleteAll(String resourceId,
String xpathStr)
Deprecated.
|
boolean |
elementExists(String resourceId,
String elementXpathStr)
Deprecated.
|
boolean |
fileExists(String resourceId)
Deprecated.
|
abstract org.apache.axiom.om.OMElement |
get(String resourceId)
Deprecated.
Returns the root resource's element
This simply calls #get(String resourceId, String xpathStr)
with xpathStr = Resources.ServiceGroupProperties.ROOT_XPATH or "/module[1]" as relevant
|
org.apache.axiom.om.OMNode |
get(String resourceId,
String xpathStr)
Deprecated.
Use this to retrieve a matched OMNode.
|
List |
getAll(String resourceId,
String xpathStr)
Deprecated.
|
org.apache.axiom.om.OMAttribute |
getAttribute(String resourceId,
String xpathStr)
Deprecated.
Use this if you are retrieving an attribute using an xpath.
|
protected String |
getFilePathFromResourceId(String resourceId)
Deprecated.
with commons-io 2.2, you may simply replace this with FileUtils#getFile()
|
protected void |
handleException(String msg)
Deprecated.
|
protected void |
handleException(String msg,
Throwable e)
Deprecated.
|
protected void |
handleExceptionWithRollback(String resourceId,
String msg,
Throwable e)
Deprecated.
Handles exception and rollbacks an already started transaction.
|
void |
init()
Deprecated.
|
protected boolean |
isMetaFileModification(String resourceId)
Deprecated.
|
boolean |
isTransactionStarted(String resourceId)
Deprecated.
Checks whether a transaction is already started on the given module.
|
boolean |
isUserModification(String name)
Deprecated.
|
void |
put(String resourceName,
org.apache.axiom.om.OMAttribute attr,
String xpathOfElement)
Deprecated.
Puts an attribute
|
void |
put(String resourceName,
org.apache.axiom.om.OMElement content,
String xpathOfParent)
Deprecated.
|
void |
rollbackTransaction(String resourceId)
Deprecated.
|
void |
setMetaFileModification(String resourceId)
Deprecated.
|
boolean |
setUserModification(String name)
Deprecated.
|
protected org.apache.axis2.engine.AxisConfiguration axisConfig
protected org.apache.axiom.om.OMFactory omFactory
protected AbstractFilePersistenceManager(org.apache.axis2.engine.AxisConfiguration axisConfig)
public abstract void beginTransaction(String resourceId) throws IOException, XMLStreamException, PersistenceException
public void commitTransaction(String resourceId) throws PersistenceException
PersistenceException
protected String getFilePathFromResourceId(String resourceId)
resourceId
- resource idpublic void rollbackTransaction(String resourceId)
resourceId
- service group name of module namepublic abstract org.apache.axiom.om.OMElement get(String resourceId) throws PersistenceDataNotFoundException
resourceId
- module name or service group name as applicablePersistenceDataNotFoundException
- if the file don't have a root elementget(String, String)
public org.apache.axiom.om.OMNode get(String resourceId, String xpathStr) throws PersistenceDataNotFoundException
resourceId
- module name or service group name as applicablexpathStr
- The path in the xml file where the said xml content can be foundPersistenceDataNotFoundException
- if no data found for the given xpathString or syntax errorgetAttribute(String, String)
public org.apache.axiom.om.OMAttribute getAttribute(String resourceId, String xpathStr) throws PersistenceDataNotFoundException
resourceId
- module name or service group name as applicablexpathStr
- The path in the xml file where the said xml content can be foundPersistenceDataNotFoundException
- if no data found for the given xpathString or syntax errorget(String, String)
public void put(String resourceName, org.apache.axiom.om.OMElement content, String xpathOfParent) throws PersistenceDataNotFoundException
resourceName
- service group name / module namecontent
- the OMElement to be added as a child to the location of xpathOfParentxpathOfParent
- The parent path in the xml file where the said xml content should be added.PersistenceDataNotFoundException
- if parent is null or xpath syntax errorpublic void put(String resourceName, org.apache.axiom.om.OMAttribute attr, String xpathOfElement) throws PersistenceDataNotFoundException
resourceName
- The service group ID or module idattr
- Content to be addedxpathOfElement
- The Xpath of the OMElement where this attribute should be addedPersistenceDataNotFoundException
- if parent is null or xpath syntax errorpublic boolean fileExists(String resourceId)
public List getAll(String resourceId, String xpathStr) throws PersistenceDataNotFoundException
PersistenceDataNotFoundException
public boolean delete(String resourceId, String xpathStr)
resourceId
- module name or service group name as applicablexpathStr
- xpath to the element which needs to be deletedpublic boolean deleteAll(String resourceId, String xpathStr)
resourceId
- module name or service group name as applicablexpathStr
- xpath to the element which needs to be deletedprotected void handleExceptionWithRollback(String resourceId, String msg, Throwable e) throws PersistenceException
resourceId
- The id/name of resourcemsg
- - Message to loge
- - original exceptionPersistenceException
- after rollbacking the transaction, this metho throws this exceptionprotected void handleException(String msg, Throwable e) throws PersistenceException
PersistenceException
protected void handleException(String msg) throws PersistenceException
PersistenceException
public boolean isTransactionStarted(String resourceId)
resourceId
- resourceIdpublic void init()
public boolean isUserModification(String name)
public boolean setUserModification(String name)
protected boolean isMetaFileModification(String resourceId)
public void setMetaFileModification(String resourceId)
Copyright © 2016 WSO2 Inc. All rights reserved.