|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.backsource.amsterdam.service.HandlerSupport
org.backsource.amsterdam.service.filter.ServiceFilterSupport
org.backsource.xindice.AmsterdamXindiceBase
A base class for Xindice Amsterdam components.
This base class may be used to create filters and publishers that work agains the Xindice XML DB.It should be configured with a base xindice uri, pointing to a base collection and either a specifyed collection to work agains or an xpath to be used to get the collection names from the message.
Here is a possible configuration for filter with a preconfigured collection:
<filter-conf>
<url>xmldb:xindice:///db/test</url>
<collection>senasteNytt</collection>
</filter-conf>
And here is for publisher with an xpath selecting collections:
<publisher className="org.backsource.xindice.AmsterdamXindicePublisher">
<url>xmldb:xindice:///db/test</url>
<collection-xpath>//Subject[@Scheme="EdrumCategory"]/@FormalName</collection-xpath>
</publisher>
| Field Summary | |
protected java.lang.String |
col
|
protected java.util.HashSet |
existingCollections
|
protected XindicePool |
pool
|
protected java.lang.String |
url
|
protected java.lang.String |
xpath
|
| Fields inherited from class org.backsource.amsterdam.service.HandlerSupport |
name, objectName, service, useBean |
| Constructor Summary | |
AmsterdamXindiceBase()
|
|
| Method Summary | |
protected java.lang.String |
getCollectionName(java.lang.String colName)
Template method to use in sublclasses that wants to map incomming collection name to another, this version just returns the name. |
protected java.lang.String[] |
getCollections(org.w3c.dom.Document doc,
boolean create)
Get the collection(s) connected to this configuration. |
protected org.w3c.dom.Document |
getDocument(org.backsource.amsterdam.service.ServiceMessage message,
boolean isFilter)
Return a DOM document from message, if isFilter is true, guarantee that message still contains a message. |
void |
importXml(org.w3c.dom.Element element)
|
void |
start()
Start the component, get a list of all existing child collections. |
void |
stop()
Stop component. |
java.lang.String |
toString()
|
protected void |
updateExistingCollections()
Moved here to make it possible to update the existing collections. |
protected boolean |
validateCollection(java.lang.String colName,
boolean create)
Validate that the collection exists, if create is true try create one. |
| Methods inherited from class org.backsource.amsterdam.service.filter.ServiceFilterSupport |
getFilterName, getFilterObjectName, getNext, getObjectNameProperty, setFilterName, setFilterObjectName, setNext |
| Methods inherited from class org.backsource.amsterdam.service.HandlerSupport |
constructObjectName, destroy, getName, getObjectName, getService, handleMessage, init, isUseBean, setName, setObjectName, setService |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.backsource.amsterdam.service.HandlerSupportMBean |
getName, getObjectName, isUseBean |
| Methods inherited from interface org.backsource.amsterdam.service.Handler |
getService, handleMessage, setService |
| Methods inherited from interface org.backsource.amsterdam.service.Servable |
destroy, init |
| Field Detail |
protected XindicePool pool
protected java.util.HashSet existingCollections
protected java.lang.String url
protected java.lang.String col
protected java.lang.String xpath
| Constructor Detail |
public AmsterdamXindiceBase()
| Method Detail |
public void start()
throws java.lang.Exception
start in interface org.backsource.amsterdam.service.Servablejava.lang.Exception
protected void updateExistingCollections()
throws XindiceException
XindiceException
public void stop()
throws java.lang.Exception
stop in interface org.backsource.amsterdam.service.Servablejava.lang.Exceptionpublic java.lang.String toString()
protected org.w3c.dom.Document getDocument(org.backsource.amsterdam.service.ServiceMessage message,
boolean isFilter)
throws org.backsource.amsterdam.service.ServiceException
org.backsource.amsterdam.service.ServiceException
protected java.lang.String[] getCollections(org.w3c.dom.Document doc,
boolean create)
throws XindiceException,
org.backsource.utils.xml.XmlException
if col is set, that will be used, if xpath i set, the names of the
collections will fetched from the document. getCollectionName(java.lang.String) will be used
to get any mapped name for the collection and validateCollection(java.lang.String, boolean) will be used to validate the colection. Both these are typically overridden in subclasses to provide needed behaviuor.
doc - document to save.
XindiceException - if collection is not correct
org.backsource.utils.xml.XmlException - if getting of collection with xpath failes.
protected java.lang.String getCollectionName(java.lang.String colName)
throws XindiceException
XindiceException
protected boolean validateCollection(java.lang.String colName,
boolean create)
throws XindiceException
The dafult impl just checks if the collections exist,and returns true if is does and false otherwise.
colName - the collection to check.create - create collection if it does not exists if set to true.
XindiceException - if collection did not exist and create was false or if creation did not work.
public void importXml(org.w3c.dom.Element element)
throws org.backsource.amsterdam.deployment.DeploymentException
importXml in interface org.backsource.amsterdam.metadata.XmlConfigurableorg.backsource.amsterdam.deployment.DeploymentException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||