fr.gouv.culture.oai
Class OAIRequestImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by fr.gouv.culture.oai.OAIObjectImpl
                  extended by fr.gouv.culture.oai.OAIRequestImpl
All Implemented Interfaces:
OAIObject, OAIRequest, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer, org.apache.excalibur.xml.sax.XMLConsumer, org.apache.excalibur.xml.sax.XMLizable, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler

public class OAIRequestImpl
extends OAIObjectImpl
implements OAIRequest


Nested Class Summary
 
Nested classes/interfaces inherited from interface fr.gouv.culture.oai.OAIObject
OAIObject.Node
 
Field Summary
protected  org.apache.cocoon.environment.Request cocoonRequest
          The request object from cocoon
protected  java.lang.String from
          Request param
protected  java.lang.String granularity
          Request param, default granularity is second
protected  java.lang.String identifier
          Request param
protected  java.lang.String metadataPrefix
          Request param
protected  java.lang.String repoURL
          The repository's url
protected  java.lang.String requestURL
          The full request url
protected  java.lang.String resumptionToken
          Request param
protected  java.lang.String setIdentifier
          Request param
protected  java.lang.String until
          Request param
protected  boolean useLastHarvestDate
          Request param
protected  int verb
          The int verb action representation
protected  java.lang.String verbString
          The String verb action representation
 
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.OAIRequest
PARAM_NAME_GRANULARITY, PARAM_NAME_USE_OAI_LAST_HARVEST_DATE, URL_CHARACTER_AMPERSAND, URL_CHARACTER_EQUALS, URL_CHARACTER_QUESTION_MARK, URL_PARAM_NAME_FROM, URL_PARAM_NAME_IDENTIFIER, URL_PARAM_NAME_METADATA_PREFIX, URL_PARAM_NAME_RESUMPTION_TOKEN, URL_PARAM_NAME_SET, URL_PARAM_NAME_UNTIL, URL_PARAM_NAME_VERB, VERB_GET_RECORD, VERB_IDENTIFY, VERB_LIST_IDENTIFIERS, VERB_LIST_METADATA_FORMATS, VERB_LIST_RECORDS, VERB_LIST_SETS, VERB_STRING_GET_RECORD, VERB_STRING_IDENTIFY, VERB_STRING_LIST_IDENTIFIERS, VERB_STRING_LIST_METADATA_FORMATS, VERB_STRING_LIST_RECORDS, VERB_STRING_LIST_SETS, VERB_UNKNOWN
 
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
OAIRequestImpl()
           
 
Method Summary
 java.lang.String getFrom()
          Retrieves the request param
 java.lang.String getGranularity()
          Gets the parameter of the request
 java.lang.String getIdentifier()
          Retrieves the request param
 java.lang.String getMetadataPrefix()
          Retrieves the request param
protected  org.apache.avalon.framework.parameters.Parameters getParameters()
          Returns the request parameters in a populated Avalon Parameters object
 java.lang.String getRepositoryURL()
          Retrieves the repository url
 org.apache.cocoon.environment.Request getRequest()
          Retrives the underlying cocoon request object
 java.lang.String getRequestURL()
          Retrieves the request url
 java.lang.String getResumptionToken()
          Retrieves the request param
 java.lang.String getSetIdentifier()
          Retrieves the request param
 java.lang.String getUntil()
          Retrieves the request param
 boolean getUseLastHarvestDate()
          Gets the parameter of the request
 int getVerb()
          Retrieves the int representation of the "verb" request paraameter
 java.lang.String getVerbId()
          Retrieves the request param
 java.lang.String getVerbString()
          Retrieves the String representation of the "verb" request paraameter
 void setFrom(java.lang.String fromDate)
          Establishes the request param
 void setGranularity(java.lang.String granularity)
          Sets the parameter of the request
 void setIdentifier(java.lang.String identifier)
          Establishes the request param
 void setMetadataPrefix(java.lang.String metadataPrefix)
          Establishes the request param
protected  void setParameters()
          Sets the request parameter class fields from the cocoon request object
 void setRepositoryURL(java.lang.String url)
          Establishes the repository url
 void setRequest(org.apache.cocoon.environment.Request coocoonRequest)
          Establishes the underlying cocoon request object
 void setRequestURL(java.lang.String requestURL)
          Establishes the request url
 void setResumptionToken(java.lang.String resumptionToken)
          Establishes the request param
 void setSetIdentifier(java.lang.String setIdentifier)
          Establishes the request param
 void setUntil(java.lang.String until)
          Establishes the request param
 void setUseLastHarvestDate(boolean useLastHarvestDate)
          Sets the parameter of the request
 void setVerb(int verb)
          Establishes the int representation of the "verb" request parameter
 void setVerbId(java.lang.String verbId)
          Establishes the request param
 void setVerbString(java.lang.String verbString)
          Establishes the String representation of the "verb" request paraameter
 void toSAX(org.xml.sax.ContentHandler contentHandler)
           
 void toSAX(org.xml.sax.ContentHandler handler, boolean sendRequestParams)
          Sends the appropriate SAX event reprensentation of the request for an oai response to the provide handler
 
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 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
 

Field Detail

requestURL

protected java.lang.String requestURL
The full request url


repoURL

protected java.lang.String repoURL
The repository's url


verb

protected int verb
The int verb action representation


verbString

protected java.lang.String verbString
The String verb action representation


identifier

protected java.lang.String identifier
Request param


metadataPrefix

protected java.lang.String metadataPrefix
Request param


useLastHarvestDate

protected boolean useLastHarvestDate
Request param


granularity

protected java.lang.String granularity
Request param, default granularity is second


from

protected java.lang.String from
Request param


until

protected java.lang.String until
Request param


setIdentifier

protected java.lang.String setIdentifier
Request param


resumptionToken

protected java.lang.String resumptionToken
Request param


cocoonRequest

protected org.apache.cocoon.environment.Request cocoonRequest
The request object from cocoon

Constructor Detail

OAIRequestImpl

public OAIRequestImpl()
Method Detail

getVerb

public int getVerb()
Retrieves the int representation of the "verb" request paraameter

Specified by:
getVerb in interface OAIRequest

setVerb

public void setVerb(int verb)
Establishes the int representation of the "verb" request parameter

Specified by:
setVerb in interface OAIRequest

getIdentifier

public java.lang.String getIdentifier()
Retrieves the request param

Specified by:
getIdentifier in interface OAIRequest

setIdentifier

public void setIdentifier(java.lang.String identifier)
Establishes the request param

Specified by:
setIdentifier in interface OAIRequest

getVerbId

public java.lang.String getVerbId()
Retrieves the request param

Specified by:
getVerbId in interface OAIRequest

setVerbId

public void setVerbId(java.lang.String verbId)
Establishes the request param

Specified by:
setVerbId in interface OAIRequest

getMetadataPrefix

public java.lang.String getMetadataPrefix()
Retrieves the request param

Specified by:
getMetadataPrefix in interface OAIRequest

setMetadataPrefix

public void setMetadataPrefix(java.lang.String metadataPrefix)
Establishes the request param

Specified by:
setMetadataPrefix in interface OAIRequest

getUseLastHarvestDate

public boolean getUseLastHarvestDate()
Gets the parameter of the request

Specified by:
getUseLastHarvestDate in interface OAIRequest

setUseLastHarvestDate

public void setUseLastHarvestDate(boolean useLastHarvestDate)
Sets the parameter of the request

Specified by:
setUseLastHarvestDate in interface OAIRequest

getGranularity

public java.lang.String getGranularity()
Gets the parameter of the request

Specified by:
getGranularity in interface OAIRequest

setGranularity

public void setGranularity(java.lang.String granularity)
Sets the parameter of the request

Specified by:
setGranularity in interface OAIRequest

getFrom

public java.lang.String getFrom()
Retrieves the request param

Specified by:
getFrom in interface OAIRequest

setFrom

public void setFrom(java.lang.String fromDate)
Establishes the request param

Specified by:
setFrom in interface OAIRequest

getUntil

public java.lang.String getUntil()
Retrieves the request param

Specified by:
getUntil in interface OAIRequest

setUntil

public void setUntil(java.lang.String until)
Establishes the request param

Specified by:
setUntil in interface OAIRequest

getSetIdentifier

public java.lang.String getSetIdentifier()
Retrieves the request param

Specified by:
getSetIdentifier in interface OAIRequest

setSetIdentifier

public void setSetIdentifier(java.lang.String setIdentifier)
Establishes the request param

Specified by:
setSetIdentifier in interface OAIRequest

getResumptionToken

public java.lang.String getResumptionToken()
Retrieves the request param

Specified by:
getResumptionToken in interface OAIRequest

setResumptionToken

public void setResumptionToken(java.lang.String resumptionToken)
Establishes the request param

Specified by:
setResumptionToken in interface OAIRequest

getRequestURL

public java.lang.String getRequestURL()
Retrieves the request url

Specified by:
getRequestURL in interface OAIRequest

setRequestURL

public void setRequestURL(java.lang.String requestURL)
Establishes the request url

Specified by:
setRequestURL in interface OAIRequest

getVerbString

public java.lang.String getVerbString()
Retrieves the String representation of the "verb" request paraameter

Specified by:
getVerbString in interface OAIRequest

setVerbString

public void setVerbString(java.lang.String verbString)
Establishes the String representation of the "verb" request paraameter

Specified by:
setVerbString in interface OAIRequest

getRepositoryURL

public java.lang.String getRepositoryURL()
Retrieves the repository url

Specified by:
getRepositoryURL in interface OAIRequest

setRepositoryURL

public void setRepositoryURL(java.lang.String url)
Establishes the repository url

Specified by:
setRepositoryURL in interface OAIRequest

getRequest

public org.apache.cocoon.environment.Request getRequest()
Retrives the underlying cocoon request object

Specified by:
getRequest in interface OAIRequest

setRequest

public void setRequest(org.apache.cocoon.environment.Request coocoonRequest)
Establishes the underlying cocoon request object

Specified by:
setRequest in interface OAIRequest

setParameters

protected void setParameters()
Sets the request parameter class fields from the cocoon request object


toSAX

public void toSAX(org.xml.sax.ContentHandler contentHandler)
           throws org.xml.sax.SAXException
Specified by:
toSAX in interface org.apache.excalibur.xml.sax.XMLizable
Throws:
org.xml.sax.SAXException

toSAX

public void toSAX(org.xml.sax.ContentHandler handler,
                  boolean sendRequestParams)
           throws org.xml.sax.SAXException
Sends the appropriate SAX event reprensentation of the request for an oai response to the provide handler

Specified by:
toSAX in interface OAIRequest
Parameters:
handler - The handler to feed
sendRequestParams - Whether or not the request params should be sent as attributes (according to error state)
Throws:
org.xml.sax.SAXException

getParameters

protected org.apache.avalon.framework.parameters.Parameters getParameters()
Returns the request parameters in a populated Avalon Parameters object



Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.