|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.JMManagerImpl de.ispsoft.jaxme.tamino.InoManager
An implementation of a JMManager for a Tamino database.
Nested Class Summary |
Nested classes inherited from class de.ispsoft.jaxme.JMManagerImpl |
JMManagerImpl.MyObserver |
Field Summary | |
static java.lang.String |
CONFIGURATION_NODE_NAME
Name of our private configuration node (InoManager in namespace JMManagerFactoryImpl.NAMESPACE_URI ) |
static java.lang.String |
DBURL_NODE_NAME
Name of the database URL node, including the collection name. |
static java.lang.String |
METHOD_NODE_NAME
Name of the property for forcing an HTTP GET. |
static java.lang.String |
PASSWORD_NODE_NAME
Name of the Password node |
static java.lang.String |
USER_NODE_NAME
Name of the User node |
Fields inherited from class de.ispsoft.jaxme.JMManagerImpl |
ELEMENT_CLASS_NAME, HANDLER_CLASS_NAME, jmAnyElementClass, jmContentHandlerClass |
Fields inherited from interface de.ispsoft.jaxme.JMManager |
BIGINT, BIT, BLOB, BOOLEAN, CLOB, DECIMAL, DOUBLE, FLOAT, INTEGER, SMALLINT, TIMESTAMP, TINYINT, VARBINARY, VARCHAR |
Constructor Summary | |
InoManager()
Creates a new instance of InoManager |
Method Summary | |
void |
define(java.lang.String pSchema)
Defines the given schema in the database. |
void |
delete(JMAnyElement pElement)
Deletes the given document from the database. |
protected java.lang.String |
getDeleteQuery(JMAnyElement pElement)
Returns a query suited for deleting the element. |
protected java.lang.String |
getElementId(JMAnyElement pElement)
Returns the element ID. |
protected java.lang.String |
getInsertQuery(JMAnyElement pElement)
Returns a query suited for inserting the element. |
protected java.net.HttpURLConnection |
getResponse(java.lang.String pQuery)
Performs a single database query. |
protected java.lang.String |
getUpdateQuery(JMAnyElement pElement)
Returns a query suited for updating the element. |
void |
insert(JMAnyElement pElement)
Inserts the given document into the database. |
void |
parseConfiguration(org.w3c.dom.Element pElement)
Parses a configuration element. |
protected void |
performQuery(java.lang.String pQuery,
InoResponseHandler pHandler)
Parses a single INO response document. |
protected InoResponseHandler |
performQuery(java.lang.String pQuery,
java.util.List pList)
Performs a single database query. |
void |
select(Observer pObserver,
java.lang.String pQuery,
java.lang.Object[] pPlaceHolderArgs,
int pStart,
int pMax)
Reads documents matching the given query. |
protected void |
setElementId(JMAnyElement pElement,
java.lang.String pId)
After an insert, sets the elements ID. |
void |
update(JMAnyElement pElement)
Updates the given document in the database. |
Methods inherited from class de.ispsoft.jaxme.JMManagerImpl |
create, getJMAnyElementClass, getJMContentHandler, getLocalName, getNamespaceSupport, getNamespaceURI, init, select, select, select, select, select, select, select, toSAX, toWriter, toXML |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONFIGURATION_NODE_NAME
Name of our private configuration node (InoManager in
namespace JMManagerFactoryImpl.NAMESPACE_URI
)
public static final java.lang.String DBURL_NODE_NAME
Name of the database URL node, including the collection name.
public static final java.lang.String USER_NODE_NAME
Name of the User node
public static final java.lang.String PASSWORD_NODE_NAME
Name of the Password node
public static final java.lang.String METHOD_NODE_NAME
Name of the property for forcing an HTTP GET. By default a HTTP POST is used.
Constructor Detail |
public InoManager()
Method Detail |
protected java.lang.String getElementId(JMAnyElement pElement) throws org.xml.sax.SAXException
Returns the element ID. The default implementation
returns
getAttribute(InoResponseHandler.INO_RESPONSE2_URI, "id")
.
If you use another element as the ID, change this.
org.xml.sax.SAXException
protected void setElementId(JMAnyElement pElement, java.lang.String pId) throws org.xml.sax.SAXException
After an insert, sets the elements ID. The default
implementation performs
setAttribute(InoResponseHandler.INO_RESPONSE2_URI, "id", pId)
.
If you use another element as the ID, change this. You probably need
to read the inserted document by using the supplied ino:id.
org.xml.sax.SAXException
protected java.lang.String getDeleteQuery(JMAnyElement pElement) throws org.xml.sax.SAXException
Returns a query suited for deleting the element.
org.xml.sax.SAXException
protected java.lang.String getUpdateQuery(JMAnyElement pElement) throws org.xml.sax.SAXException
Returns a query suited for updating the element.
org.xml.sax.SAXException
protected java.lang.String getInsertQuery(JMAnyElement pElement) throws org.xml.sax.SAXException
Returns a query suited for inserting the element.
org.xml.sax.SAXException
public void parseConfiguration(org.w3c.dom.Element pElement)
Parses a configuration element. This method is called twice: Once for the default configuration and once for the specific configuration.
parseConfiguration
in class JMManagerImpl
public void delete(JMAnyElement pElement) throws org.xml.sax.SAXException
Deletes the given document from the database.
delete
in interface JMManager
delete
in class JMManagerImpl
org.xml.sax.SAXException
public void insert(JMAnyElement pElement) throws org.xml.sax.SAXException
Inserts the given document into the database.
insert
in interface JMManager
insert
in class JMManagerImpl
org.xml.sax.SAXException
public void update(JMAnyElement pElement) throws org.xml.sax.SAXException
Updates the given document in the database.
update
in interface JMManager
update
in class JMManagerImpl
org.xml.sax.SAXException
public void define(java.lang.String pSchema) throws org.xml.sax.SAXException
Defines the given schema in the database.
org.xml.sax.SAXException
protected java.net.HttpURLConnection getResponse(java.lang.String pQuery) throws org.xml.sax.SAXException
Performs a single database query.
org.xml.sax.SAXException
protected InoResponseHandler performQuery(java.lang.String pQuery, java.util.List pList) throws org.xml.sax.SAXException
Performs a single database query.
org.xml.sax.SAXException
protected void performQuery(java.lang.String pQuery, InoResponseHandler pHandler) throws org.xml.sax.SAXException
Parses a single INO response document.
org.xml.sax.SAXException
public void select(Observer pObserver, java.lang.String pQuery, java.lang.Object[] pPlaceHolderArgs, int pStart, int pMax) throws org.xml.sax.SAXException
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 object array with two elements per placeholder: An Integer with a java.sql.Types type and the actual placeholder value. Example:
manager.select("Name = ? and Id = ?", new Object[]{JMManager.VARCHAR, "Someone", JMManager.INTEGER, 4}, 0, 0);
select
in interface JMManager
select
in class JMManagerImpl
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.pStart
- Ignore the given number of result documents at the
beginning. A value of zero will return all documents.pMax
- Return at most the given number of documents. A value
of zero will return all documents.
org.xml.sax.SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |