|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.source.impl.XMLDBSource
This class implements the xmldb:// pseudo-protocol and allows to get XML content from an XML:DB enabled XML database.
Nested Class Summary | |
class |
XMLDBSource.XMLDBOutputStream
|
Field Summary | |
protected static String |
CDATA
|
protected static String |
COLLECTION
Element <collection> |
protected static String |
COLLECTION_BASE_ATTR
|
protected static String |
COLLECTION_COUNT_ATTR
Attribute collections on the root element indicates count of collections in the collection |
protected static String |
COLLECTIONS
Root element <collections> |
protected Context |
context
The Avalon context |
protected ServiceManager |
manager
ServiceManager |
protected static String |
NAME_ATTR
Attribute name on the collection/resource element |
protected XMLDBSource.XMLDBOutputStream |
os
XMLDBOutputStream for writing to Modifiable resource |
protected String |
password
The supplied password |
static String |
PREFIX
Source prefix |
protected static String |
QCOLLECTION
Element <xmldb:collection> (raw name) |
protected static String |
QCOLLECTIONS
Root element <xmldb:collections> (raw name) |
protected static String |
QRESOURCE
Element <resource> (raw name) |
protected static String |
QRESULT
Element <xmldb:result> (raw name) |
protected static String |
QRESULTSET
Root element <xmldb:results> (raw name) |
protected String |
query
The part of URL after # sign |
protected static String |
QUERY_ATTR
|
protected static String |
RESOURCE
Element <resource> |
protected static String |
RESOURCE_COUNT_ATTR
Attribute resources on the root element indicates count of resources in the collection |
protected static String |
RESULT
Element <result> |
protected static String |
RESULT_DOCID_ATTR
|
protected static String |
RESULT_ID_ATTR
|
protected static String |
RESULTS_COUNT_ATTR
|
protected static String |
RESULTSET
Root element <results> |
protected String |
systemId
The System ID |
static String |
URI
Source namespace |
protected String |
url
The requested URL |
protected String |
user
The supplied user |
Constructor Summary | |
XMLDBSource(Logger logger,
SourceCredential credential,
String url,
ServiceManager manager,
Context context)
The constructor. |
Method Summary | |
boolean |
canCancel(OutputStream stream)
Can the data sent to an OutputStream returned by
getOutputStream() be cancelled ? |
void |
cancel(OutputStream stream)
Cancel the data sent to an OutputStream returned by
getOutputStream() .
|
void |
delete()
Delete the source |
boolean |
exists()
|
long |
getContentLength()
|
InputStream |
getInputStream()
Get an InputSource for the given URL. |
long |
getLastModified()
|
String |
getMimeType()
|
OutputStream |
getOutputStream()
Return an XMLDBSource.XMLDBOutputStream to write to. |
String |
getScheme()
|
String |
getURI()
|
SourceValidity |
getValidity()
|
void |
recycle()
|
void |
refresh()
|
void |
toSAX(ContentHandler handler)
Stream SAX events to a given ContentHandler. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String URI
public static final String PREFIX
protected static final String COLLECTIONS
<collections>
protected static final String QCOLLECTIONS
<xmldb:collections>
(raw name)
protected static final String RESOURCE_COUNT_ATTR
resources
on the root element indicates count of resources in the collection
protected static final String COLLECTION_COUNT_ATTR
collections
on the root element indicates count of collections in the collection
protected static final String COLLECTION_BASE_ATTR
protected static final String COLLECTION
<collection>
protected static final String QCOLLECTION
<xmldb:collection>
(raw name)
protected static final String RESOURCE
<resource>
protected static final String QRESOURCE
<resource>
(raw name)
protected static final String NAME_ATTR
name
on the collection/resource element
protected static final String RESULTSET
<results>
protected static final String QRESULTSET
<xmldb:results>
(raw name)
protected static final String QUERY_ATTR
protected static final String RESULTS_COUNT_ATTR
protected static final String RESULT
<result>
protected static final String QRESULT
<xmldb:result>
(raw name)
protected static final String RESULT_DOCID_ATTR
protected static final String RESULT_ID_ATTR
protected static final String CDATA
protected String url
protected String user
protected String password
protected String query
protected String systemId
protected final ServiceManager manager
protected XMLDBSource.XMLDBOutputStream os
protected final Context context
Constructor Detail |
public XMLDBSource(Logger logger, SourceCredential credential, String url, ServiceManager manager, Context context)
logger
- the Logger instance.credential
- username and passwordurl
- the URL being queried.manager
- component managerMethod Detail |
public void toSAX(ContentHandler handler) throws SAXException
toSAX
in interface XMLizable
SAXException
public void recycle()
public String getURI()
getURI
in interface Source
public long getContentLength()
getContentLength
in interface Source
public long getLastModified()
getLastModified
in interface Source
public boolean exists()
exists
in interface Source
public String getMimeType()
getMimeType
in interface Source
public String getScheme()
getScheme
in interface Source
public SourceValidity getValidity()
getValidity
in interface Source
public void refresh()
refresh
in interface Source
public InputStream getInputStream() throws IOException
getInputStream
in interface Source
IOException
public OutputStream getOutputStream() throws IOException, MalformedURLException
XMLDBSource.XMLDBOutputStream
to write to.
getOutputStream
in interface ModifiableSource
IOException
MalformedURLException
public void delete() throws SourceException
delete
in interface ModifiableSource
SourceException
public boolean canCancel(OutputStream stream)
OutputStream
returned by
getOutputStream()
be cancelled ?
canCancel
in interface ModifiableSource
public void cancel(OutputStream stream) throws IOException
OutputStream
returned by
getOutputStream()
.
After cancelling, the stream should no longer be used.
cancel
in interface ModifiableSource
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |