|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.xml.AbstractXMLPipe fr.gouv.culture.oai.OAIObjectImpl fr.gouv.culture.oai.AbstractOAIRepository
public abstract class AbstractOAIRepository
This class represents an OAI repository.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface fr.gouv.culture.oai.OAIObject |
---|
OAIObject.Node |
Field Summary | |
---|---|
protected java.lang.String[] |
adminEmails
Email address of the administrator of this OAI Repository |
protected java.lang.String |
baseURL
The base url of this repository |
protected java.lang.String |
compression
Compression supported by this OAI repository - optional as per OAI spec |
protected java.lang.String |
deletedRecord
String value of yes/no indicating if deleted records are supported deletedRecord : the manner in which the repository supports the notion of deleted records . |
protected org.apache.excalibur.source.impl.FileSource |
description
Description of this repository - optional as per OAI spec |
protected java.lang.String |
earliestDatestamp
String value indicating the earliest _datestamp of this repository |
protected java.lang.String |
granularity
The granularity of datestamps supported by this repository |
protected java.util.Hashtable |
metadataFormats
Hashtable containing supported OAIMetadataFormat objects |
protected java.lang.String |
protocolVersion
String value of the version number of the oai protocol supported in this |
protected java.lang.String |
repositoryName
A human readable name for this repository |
Fields inherited from class fr.gouv.culture.oai.OAIObjectImpl |
---|
_context, logger |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface fr.gouv.culture.oai.OAIObject |
---|
HTTP_HEADER_NAME_FROM, HTTP_HEADER_NAME_USER_AGENT, NUMBER_RECORDS_PER_RESPONSE, STRING_DATEFORMAT_GRANULARITY_DAY, STRING_DATEFORMAT_GRANULARITY_SECOND |
Constructor Summary | |
---|---|
AbstractOAIRepository()
|
Method Summary | |
---|---|
protected void |
endVerbEvent(OAIRequest request)
Sends the end event corresponding to the verb of the request |
java.lang.String[] |
getAdminEmails()
Required element within a response from a repository queried with the "Identify" verb |
java.lang.String |
getBaseURL()
|
java.lang.String |
getCompression()
|
java.lang.String |
getDeletedRecord()
|
void |
getDescription(org.xml.sax.ContentHandler handler)
Send's the description file to the current consumer |
java.lang.String |
getEarliestDatestamp()
|
java.lang.String |
getGranularity()
|
static java.lang.String |
getGranularity(java.lang.String paramVal)
Return the granularity of a date in a OAI request. |
java.lang.String |
getProtocolVersion()
|
java.lang.String |
getRepositoryName()
|
void |
identify(OAIRequest request)
Sends SAX events for the OAI-PMH "identify" request |
protected void |
sendNoSetHierarchyError()
Sends the oai error specifying that a set hierarchy is NOT supported by this oai repository |
void |
sendResumptionToken(java.lang.String resumptionToken)
Sends the resumption token element to the consumer |
void |
sendResumptionToken(java.lang.String resumptionToken,
java.lang.String cursor)
Sends the resumption token element to the consumer |
void |
sendResumptionToken(java.lang.String resumptionToken,
java.lang.String cursor,
java.lang.String completeListSize)
Sends the resumption token element to the consumer |
protected void |
sendResumptionTokensNotSupportedError()
Sends the oai error specifying that resumptionTokens are NOT supported by this oai repository |
protected void |
startVerbEvent(OAIRequest request)
Sends the start event corresponding to the verb of the request |
void |
toSAX(org.xml.sax.ContentHandler contentHandler)
Calls the identify method and sends the SAX flow to the provided content handler |
boolean |
verifyGranularity(java.lang.String paramVal)
Verifies the granularity of a date in a OAI request. |
boolean |
verifyParameters(OAIRequest request)
Verifies the request parameters. |
Methods inherited from class fr.gouv.culture.oai.OAIObjectImpl |
---|
contextualize, enableLogging, endElement, getContext, sendElement, sendElementContent, startElement |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
---|
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
recycle, setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.gouv.culture.oai.OAIRepository |
---|
addDeletedRecord, getRecord, getResumptionToken, listIdentifiers, listMetadataFormats, listRecords, listSets, purgeDeletedRecords, removeDeletedRecord |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
---|
enableLogging |
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable |
---|
contextualize |
Methods inherited from interface org.xml.sax.ContentHandler |
---|
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
---|
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable |
---|
configure |
Field Detail |
---|
protected java.lang.String[] adminEmails
protected java.lang.String protocolVersion
protected java.lang.String repositoryName
protected java.lang.String baseURL
protected java.lang.String granularity
protected java.lang.String deletedRecord
protected java.lang.String earliestDatestamp
protected java.lang.String compression
protected org.apache.excalibur.source.impl.FileSource description
protected java.util.Hashtable metadataFormats
Constructor Detail |
---|
public AbstractOAIRepository()
Method Detail |
---|
public void identify(OAIRequest request) throws org.xml.sax.SAXException
identify
in interface OAIRepository
request
- The request
org.xml.sax.SAXException
public java.lang.String getDeletedRecord()
getDeletedRecord
in interface OAIRepository
public java.lang.String getGranularity()
getGranularity
in interface OAIRepository
public java.lang.String getRepositoryName()
getRepositoryName
in interface OAIRepository
public java.lang.String getEarliestDatestamp()
getEarliestDatestamp
in interface OAIRepository
public java.lang.String getProtocolVersion()
getProtocolVersion
in interface OAIRepository
public java.lang.String getBaseURL()
getBaseURL
in interface OAIRepository
public java.lang.String[] getAdminEmails()
OAIRepository
getAdminEmails
in interface OAIRepository
public java.lang.String getCompression()
getCompression
in interface OAIRepository
public void getDescription(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException
getDescription
in interface OAIRepository
handler
-
org.xml.sax.SAXException
public boolean verifyParameters(OAIRequest request) throws org.xml.sax.SAXException
Verifies the request parameters respective of the verb provided in the request and the repository's level of support for certain optional features like "resumptionToken"s and "set"s.
Note this method should return SAX events to any XMLConsumer set if errors exist within the request parameters.
verifyParameters
in interface OAIRepository
request
- The request object
true
or false
.
org.xml.sax.SAXException
public boolean verifyGranularity(java.lang.String paramVal)
The date must be formated according the ISO-8601 format : YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DD.
paramVal
- The date as a String.
true
if the date is well formated as a complete date or complete date plus hours, minutes and seconds.getGranularity(java.lang.String)
public static java.lang.String getGranularity(java.lang.String paramVal)
The date must be formated according the ISO-8601 format : YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DD.
paramVal
- The date as a String
YYYY-MM-DD
or
YYYY-MM-DDThh:mm:ssZ
if the date is well
formated as a complete date or complete date plus hours, minutes and seconds.OAIObject.Node.Value.STRING_GRANULARITY_DAY
,
OAIObject.Node.Value.STRING_GRANULARITY_SECOND
protected void sendNoSetHierarchyError() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void sendResumptionTokensNotSupportedError() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void startVerbEvent(OAIRequest request) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void endVerbEvent(OAIRequest request) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void toSAX(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException
toSAX
in interface org.apache.excalibur.xml.sax.XMLizable
contentHandler
- The event receiver
org.xml.sax.SAXException
identify(fr.gouv.culture.oai.OAIRequest)
public void sendResumptionToken(java.lang.String resumptionToken) throws org.xml.sax.SAXException
resumptionToken
- The resumption token
org.xml.sax.SAXException
public void sendResumptionToken(java.lang.String resumptionToken, java.lang.String cursor) throws org.xml.sax.SAXException
resumptionToken
- The resumption tokencursor
- The cursor position
org.xml.sax.SAXException
public void sendResumptionToken(java.lang.String resumptionToken, java.lang.String cursor, java.lang.String completeListSize) throws org.xml.sax.SAXException
resumptionToken
- The resumption tokencursor
- The cursor positioncompleteListSize
- The size of the complete list
org.xml.sax.SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |