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

java.lang.Object
  extended by org.apache.ws.jaxme.pm.impl.PMImpl
      extended by org.apache.ws.jaxme.pm.impl.PMIdImpl
          extended by org.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/interfaces 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()
          Returns the qualified element name of the root element.
 java.lang.String getIdTag()
          Returns the qualified attribute name of the ID attribute.
protected  java.lang.String getInsertQuery(Element pElement)
          Returns a query suited for inserting the element.
protected  java.lang.String getPassword()
           
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.
protected  java.lang.String getUser()
           
 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)
          Sets the qualified element name of the root element.
 void setIdTag(java.lang.String pIdTag)
          Returns the qualified attribute name of the ID attribute.
 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

getUser

protected java.lang.String getUser()

getPassword

protected java.lang.String getPassword()

getElementTag

public java.lang.String getElementTag()
Returns the qualified element name of the root element. This is used in delete or select queries for creation of an XPath query.


setElementTag

public void setElementTag(java.lang.String pElementTag)
Sets the qualified element name of the root element. This is used in delete or select queries for creation of an XQL statement.


getIdTag

public java.lang.String getIdTag()
Returns the qualified attribute name of the ID attribute. This is used in delete or update queries for creation of an XQL statement.


setIdTag

public void setIdTag(java.lang.String pIdTag)
Returns the qualified attribute name of the ID attribute. This is used in delete or update queries for creation of an XQL statement.


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
Parameters:
pManager - The manager being queried for configuration details.
Throws:
JAXBException

getDeleteQuery

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

Returns a query suited for deleting the element.

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

getUpdateQuery

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

Returns a query suited for updating the element.

Throws:
JAXBException
java.io.UnsupportedEncodingException

getInsertQuery

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

Returns a query suited for inserting the element.

Throws:
JAXBException
java.io.UnsupportedEncodingException

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 JAXBException
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:
JAXBException

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