|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object proai.service.Responder
public class Responder
Provides transport-neutral responses to OAI-PMH requests.
A single Responder
instance handles multiple concurrent
OAI-PMH requests and provides responses without regard to the transport
protocol.
Responses are provided via ResponseData
objects that can
write their XML to a given PrintWriter. The XML provided does not include
an XML declaration or an OAI-PMH response header -- this is the
responsibility of higher-level application code.
At this level, errors are signaled by exceptions. Serializing them for transport is the responsibility of higher-level application code.
Field Summary | |
---|---|
static java.lang.String |
ERR_BAD_FORMAT_FOR_ITEM
|
static java.lang.String |
ERR_DATE_FORMAT
|
static java.lang.String |
ERR_FROM_UNTIL
|
static java.lang.String |
ERR_ITEM_DOESNT_EXIST
|
static java.lang.String |
ERR_MISSING_IDENTIFIER
|
static java.lang.String |
ERR_MISSING_PREFIX
|
static java.lang.String |
ERR_NO_FORMATS_FOR_ITEM
|
static java.lang.String |
ERR_NO_RECORDS_MATCH
|
static java.lang.String |
ERR_NO_SET_HIERARCHY
|
static java.lang.String |
ERR_NO_SUCH_FORMAT
|
static java.lang.String |
ERR_RESUMPTION_EXCLUSIVE
|
static java.lang.String |
PROP_INCOMPLETEIDENTIFIERLISTSIZE
|
static java.lang.String |
PROP_INCOMPLETERECORDLISTSIZE
|
static java.lang.String |
PROP_INCOMPLETESETLISTSIZE
|
Constructor Summary | |
---|---|
Responder(java.util.Properties props)
|
|
Responder(RecordCache cache,
SessionManager sessionManager,
int incompleteIdentifierListSize,
int incompleteRecordListSize,
int incompleteSetListSize)
|
Method Summary | |
---|---|
void |
close()
Release any resources held by the session manager and the cache. |
ResponseData |
getRecord(java.lang.String identifier,
java.lang.String metadataPrefix)
Get the response for a GetRecord request. |
ResponseData |
identify()
Get the response for an Identify request. |
ResponseData |
listIdentifiers(java.lang.String from,
java.lang.String until,
java.lang.String metadataPrefix,
java.lang.String set,
java.lang.String resumptionToken)
Get the response for a ListIdentifiers request. |
ResponseData |
listMetadataFormats(java.lang.String identifier)
Get the response for a ListMetadataFormats request. |
ResponseData |
listRecords(java.lang.String from,
java.lang.String until,
java.lang.String metadataPrefix,
java.lang.String set,
java.lang.String resumptionToken)
Get the response for a ListRecords request. |
ResponseData |
listSets(java.lang.String resumptionToken)
Get the response for a ListSets request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROP_INCOMPLETESETLISTSIZE
public static final java.lang.String PROP_INCOMPLETERECORDLISTSIZE
public static final java.lang.String PROP_INCOMPLETEIDENTIFIERLISTSIZE
public static final java.lang.String ERR_MISSING_IDENTIFIER
public static final java.lang.String ERR_MISSING_PREFIX
public static final java.lang.String ERR_ITEM_DOESNT_EXIST
public static final java.lang.String ERR_BAD_FORMAT_FOR_ITEM
public static final java.lang.String ERR_NO_FORMATS_FOR_ITEM
public static final java.lang.String ERR_NO_SET_HIERARCHY
public static final java.lang.String ERR_RESUMPTION_EXCLUSIVE
public static final java.lang.String ERR_DATE_FORMAT
public static final java.lang.String ERR_FROM_UNTIL
public static final java.lang.String ERR_NO_SUCH_FORMAT
public static final java.lang.String ERR_NO_RECORDS_MATCH
Constructor Detail |
---|
public Responder(java.util.Properties props) throws ServerException
ServerException
public Responder(RecordCache cache, SessionManager sessionManager, int incompleteIdentifierListSize, int incompleteRecordListSize, int incompleteSetListSize) throws ServerException
ServerException
Method Detail |
---|
public ResponseData getRecord(java.lang.String identifier, java.lang.String metadataPrefix) throws BadArgumentException, CannotDisseminateFormatException, IdDoesNotExistException, ServerException
identifier
- the item identifier.metadataPrefix
- the format of the record (oai_dc, etc).
BadArgumentException
- if either of the required parameters are null.
CannotDisseminateFormatException
- if the value of the metadataPrefix
argument is not supported by the item identified by the value of the
identifier argument.
IdDoesNotExistException
- if the value of the identifier argument is
unknown or illegal in this repository.
ServerException
- if a low-level (non-protocol) error occurred.public ResponseData identify() throws ServerException
ServerException
- if a low-level (non-protocol) error occurred.public ResponseData listIdentifiers(java.lang.String from, java.lang.String until, java.lang.String metadataPrefix, java.lang.String set, java.lang.String resumptionToken) throws BadArgumentException, BadResumptionTokenException, CannotDisseminateFormatException, NoRecordsMatchException, NoSetHierarchyException, ServerException
from
- optional UTC date specifying a lower bound for
datestamp-based selective harvesting.until
- optional UTC date specifying an upper bound for
datestamp-based selective harvesting.metadataPrefix
- specifies that headers should be returned
only if the metadata format matching the supplied metadataPrefix
is available (or has been deleted).set
- optional argument with a setSpec value, which specifies
set criteria for selective harvesting.resumptionToken
- exclusive argument with a value that is the
flow control token returned by a previous ListIdentifiers
request that issued an incomplete list.
BadArgumentException
- if resumptionToken is specified with
any other parameters, or if resumptionToken is unspecified
and any required parameters are not.
BadResumptionTokenException
- if the value of the resumptionToken
argument is invalid or expired.
CannotDisseminateFormatException
- if the value of the
metadataPrefix argument is not supported by the repository.
NoRecordsMatchException
- if the combination of the values of
the from, until, and set arguments results in an empty list.
NoSetHierarchyException
- if set is specified and the repository
does not support sets.
ServerException
- if a low-level (non-protocol) error occurred.public ResponseData listMetadataFormats(java.lang.String identifier) throws IdDoesNotExistException, NoMetadataFormatsException, ServerException
identifier
- an optional argument that specifies the unique
identifier of the item for which available metadata formats
are being requested. If this argument is omitted, then the
response includes all metadata formats supported by this
repository.
IdDoesNotExistException
- if the value of the identifier
argument is unknown or illegal in this repository.
NoMetadataFormats
- there are no metadata formats available
for the specified item.
ServerException
- if a low-level (non-protocol) error occurred.
NoMetadataFormatsException
public ResponseData listRecords(java.lang.String from, java.lang.String until, java.lang.String metadataPrefix, java.lang.String set, java.lang.String resumptionToken) throws BadArgumentException, BadResumptionTokenException, CannotDisseminateFormatException, NoRecordsMatchException, NoSetHierarchyException, ServerException
from
- optional UTC date specifying a lower bound for
datestamp-based selective harvesting.until
- optional UTC date specifying an upper bound for
datestamp-based selective harvesting.metadataPrefix
- specifies that records should be returned
only if the metadata format matching the supplied metadataPrefix
is available (or has been deleted).set
- optional argument with a setSpec value, which specifies
set criteria for selective harvesting.resumptionToken
- exclusive argument with a value that is the
flow control token returned by a previous ListIdentifiers
request that issued an incomplete list.
BadArgumentException
- if resumptionToken is specified with
any other parameters, or if resumptionToken is unspecified
and any required parameters are not.
BadResumptionTokenException
- if the value of the resumptionToken
argument is invalid or expired.
CannotDisseminateFormatException
- if the value of the
metadataPrefix argument is not supported by the repository.
NoRecordsMatchException
- if the combination of the values of
the from, until, and set arguments results in an empty list.
NoSetHierarchyException
- if set is specified and the repository
does not support sets.
ServerException
- if a low-level (non-protocol) error occurred.public ResponseData listSets(java.lang.String resumptionToken) throws BadResumptionTokenException, NoSetHierarchyException, ServerException
resumptionToken
- exclusive argument with a value that is the
flow control token returned by a previous ListSets request that
issued an incomplete list.
BadResumptionTokenException
- if the value of the resumptionToken
argument is invalid or expired.
NoSetHierarchyException
- if the repository does not support sets.
ServerException
- if a low-level (non-protocol) error occurred.public void close() throws ServerException
ServerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |