org.apache.ws.jaxme.pm.ino
Class InoManager

java.lang.Object
  extended byorg.apache.ws.jaxme.pm.impl.PMImpl
      extended byorg.apache.ws.jaxme.pm.impl.PMIdImpl
          extended byorg.apache.ws.jaxme.pm.ino.InoManager
All Implemented Interfaces:
PM

public class InoManager
extends PMIdImpl

An implementation of a JMManager for a Tamino database.

Author:
Jochen Wiedmanns

Nested Class Summary
 
Nested classes inherited from class org.apache.ws.jaxme.pm.impl.PMImpl
PMImpl.ListObserver
 
Constructor Summary
InoManager()
           
 
Method Summary
 void delete(Element pElement)
          Deletes the given document from the database.
protected  java.lang.String getDeleteQuery(Element pElement)
          Returns a query suited for deleting the element.
 java.lang.String getElementTag()
           
 java.lang.String getIdTag()
           
protected  java.lang.String getInsertQuery(Element 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(Element pElement)
          Returns a query suited for updating the element.
 void init(JMManager pManager)
          Initializes the PM.
 void insert(Element pElement)
          Inserts the given document into the database.
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, PMParams pPlaceHolderArgs)
          Reads documents matching the given query.
 void setElementTag(java.lang.String pElementTag)
           
 void setIdTag(java.lang.String pIdTag)
           
 void update(Element pElement)
          Updates the given document in the database.
 
Methods inherited from class org.apache.ws.jaxme.pm.impl.PMIdImpl
getGetIdMethodName, getId, setGetIdMethodName
 
Methods inherited from class org.apache.ws.jaxme.pm.impl.PMImpl
create, getManager, parseQuery, select, select, select
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InoManager

public InoManager()
Method Detail

getElementTag

public java.lang.String getElementTag()

setElementTag

public void setElementTag(java.lang.String pElementTag)

getIdTag

public java.lang.String getIdTag()

setIdTag

public void setIdTag(java.lang.String pIdTag)

init

public void init(JMManager pManager)
          throws JAXBException
Description copied from interface: PM

Initializes the PM. Called from the JAXBContextImpl upon initialization.

Specified by:
init in interface PM
Overrides:
init in class PMIdImpl
Throws:
JAXBException

getDeleteQuery

protected java.lang.String getDeleteQuery(Element pElement)
                                   throws JAXBException,
                                          java.lang.reflect.InvocationTargetException,
                                          java.lang.IllegalAccessException,
                                          java.lang.NoSuchMethodException

Returns a query suited for deleting the element.

Throws:
JAXBException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException

getUpdateQuery

protected java.lang.String getUpdateQuery(Element pElement)
                                   throws JAXBException

Returns a query suited for updating the element.

Throws:
JAXBException

getInsertQuery

protected java.lang.String getInsertQuery(Element pElement)
                                   throws JAXBException

Returns a query suited for inserting the element.

Throws:
JAXBException

getResponse

protected java.net.HttpURLConnection getResponse(java.lang.String pQuery)
                                          throws org.xml.sax.SAXException

Performs a single database query.

Throws:
org.xml.sax.SAXException

performQuery

protected InoResponseHandler performQuery(java.lang.String pQuery,
                                          java.util.List pList)
                                   throws org.xml.sax.SAXException

Performs a single database query.

Throws:
org.xml.sax.SAXException

performQuery

protected void performQuery(java.lang.String pQuery,
                            InoResponseHandler pHandler)
                     throws org.xml.sax.SAXException

Parses a single INO response document.

Throws:
org.xml.sax.SAXException

select

public void select(Observer pObserver,
                   java.lang.String pQuery,
                   PMParams pPlaceHolderArgs)
            throws PMException
Description copied from interface: 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));
 

Parameters:
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.
Throws:
PMException

insert

public void insert(Element pElement)
            throws PMException
Description copied from interface: PM

Inserts the given document into the database.

Throws:
PMException

update

public void update(Element pElement)
            throws PMException
Description copied from interface: PM

Updates the given document in the database.

Throws:
PMException

delete

public void delete(Element pElement)
            throws PMException
Description copied from interface: PM

Deletes the given document from the database.

Throws:
PMException