org.apache.ws.jaxme.pm.xmldb
public class XmlDbPM extends PMIdImpl
PMImpl.ListObserver
Constructor and Description |
---|
XmlDbPM()
Creates a new instance of
XmlDbPM . |
Modifier and Type | Method and Description |
---|---|
void |
delete(Element pElement)
Deletes the given document from the database.
|
java.lang.String |
getCollection()
Returns the collection name.
|
java.lang.Class |
getDriverClass()
Returns the driver class.
|
java.lang.String |
getPassword()
Returns the password.
|
java.lang.String |
getUser()
Returns the users name.
|
protected Collection |
getXmlDbCollection()
Returns the database collection by invoking
DatabaseManager#getCollection(String) . |
java.lang.String |
getXPathQueryService()
Returns the name of the XPathQueryService.
|
java.lang.String |
getXPathQueryServiceVersion()
Returns the version of the XPathQueryService.
|
void |
init(JMManager pManager)
Initializes the PM.
|
void |
insert(Element pElement)
Inserts the given document into the database.
|
void |
select(Observer pObserver,
java.lang.String pQuery,
PMParams pPlaceHolderArgs)
Reads documents matching the given query.
|
void |
setCollection(java.lang.String pCollection)
Sets the collection name.
|
void |
setDriverClass(java.lang.Class pDriverClass)
Sets the driver class.
|
void |
setPassword(java.lang.String pPassword)
Sets the password.
|
void |
setUser(java.lang.String pUser)
Sets the users name.
|
void |
setXPathQueryService(java.lang.String pXpathQueryService)
Sets the name of the XPathQueryService.
|
void |
setXPathQueryServiceVersion(java.lang.String pXpathQueryServiceVersion)
Sets the version of the XPathQueryService.
|
void |
update(Element pElement)
Updates the given document in the database.
|
getGetIdMethodName, getId, setGetIdMethodName
create, getManager, parseQuery, select, select, select
public void init(JMManager pManager) throws JAXBException
PM
Initializes the PM. Called from the
JAXBContextImpl
upon initialization.
init
in interface PM
init
in class PMIdImpl
pManager
- The manager being queried for configuration details.JAXBException
public java.lang.String getCollection()
public void setCollection(java.lang.String pCollection)
public java.lang.Class getDriverClass()
public void setDriverClass(java.lang.Class pDriverClass)
public java.lang.String getPassword()
public void setPassword(java.lang.String pPassword)
public java.lang.String getUser()
public void setUser(java.lang.String pUser)
public java.lang.String getXPathQueryService()
public void setXPathQueryService(java.lang.String pXpathQueryService)
public java.lang.String getXPathQueryServiceVersion()
public void setXPathQueryServiceVersion(java.lang.String pXpathQueryServiceVersion)
protected Collection getXmlDbCollection() throws XMLDBException, java.lang.IllegalAccessException, java.lang.InstantiationException
DatabaseManager#getCollection(String)
.XMLDBException
java.lang.IllegalAccessException
java.lang.InstantiationException
public void select(Observer pObserver, java.lang.String pQuery, PMParams pPlaceHolderArgs) throws JAXBException
PM
Reads documents matching the given query. For any document matching, the Observer's notify method is executed with the matching document as an argument.
The query may contain placeholders. If it does, you have
to supply an instance of PMParams
with the placeholder
values. Example:
manager.select("Name = ? and Id = ?", new PMParams().addString("Someone").addInt(4));
pObserver
- This Observer is notified for any matching document.
The document is added as an argument.pQuery
- The query to perform. May contain placeholders.pPlaceHolderArgs
- An array of objects or null, if the
query doesn't contain any placeholders.JAXBException
public void insert(Element pElement) throws PMException
PM
Inserts the given document into the database.
PMException
public void update(Element pElement) throws PMException
PM
Updates the given document in the database.
PMException
public void delete(Element pElement) throws PMException
PM
Deletes the given document from the database.
PMException