|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectproai.driver.impl.OAIDriverImpl
public class OAIDriverImpl
An simple OAIDriver for testing/demonstration purposes. The directory should contain the following files: identity.xml records/ item1-oai_dc-2005-01-01T08-50-44.xml sets/ abovetwo.xml abovetwo-even.xml abovetwo-odd.xml prime.xml formats/ oai_dc.txt line1: ns line2: loc
| Field Summary | |
|---|---|
static java.lang.String |
BASE_DIR_PROPERTY
|
static java.lang.String |
FORMATS_DIRNAME
|
static java.lang.String |
IDENTITY_FILENAME
|
static java.lang.String |
RECORDS_DIRNAME
|
static java.lang.String |
SETS_DIRNAME
|
| Constructor Summary | |
|---|---|
OAIDriverImpl()
|
|
OAIDriverImpl(java.io.File dir)
|
|
| Method Summary | |
|---|---|
void |
close()
Release any resources held by the driver. |
java.util.Date |
getLatestDate()
Get the latest date that something changed in the remote repository. |
void |
init(java.util.Properties props)
Initialize from properties. |
RemoteIterator<MetadataFormat> |
listMetadataFormats()
Get an iterator over a list of MetadataFormat objects representing all OAI metadata formats currently supported by the repository. |
RemoteIterator<Record> |
listRecords(java.util.Date from,
java.util.Date until,
java.lang.String mdPrefix)
Get an iterator of Record objects representing all records
in the format indicated by mdPrefix, which have changed in the given date
range. |
RemoteIterator<SetInfo> |
listSetInfo()
Get an iterator over a list of SetInfo objects representing all OAI sets currently supported by the repository. |
void |
write(java.io.PrintWriter out)
Write information about the repository to the given PrintWriter. |
static void |
writeFromFile(java.io.File file,
java.io.PrintWriter out)
|
void |
writeRecordXML(java.lang.String itemID,
java.lang.String mdPrefix,
java.lang.String sourceInfo,
java.io.PrintWriter writer)
Write the XML of the record whose source info is given. |
| 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 BASE_DIR_PROPERTY
public static final java.lang.String IDENTITY_FILENAME
public static final java.lang.String RECORDS_DIRNAME
public static final java.lang.String SETS_DIRNAME
public static final java.lang.String FORMATS_DIRNAME
| Constructor Detail |
|---|
public OAIDriverImpl()
public OAIDriverImpl(java.io.File dir)
throws RepositoryException
RepositoryException| Method Detail |
|---|
public void init(java.util.Properties props)
throws RepositoryException
OAIDriver
init in interface OAIDriverprops - the implementation-specific initialization properties.
RepositoryException - if required properties are missing/bad,
or initialization failed for any reason.
public void write(java.io.PrintWriter out)
throws RepositoryException
OAIDriver
This will be a well-formed XML chunk beginning with an
Identify element, as described in
section
4.2 of the OAI-PMH 2.0 specification.
write in interface OAIDriverwrite in interface WritableRepositoryException - if there is a problem reading from the repository.public java.util.Date getLatestDate()
OAIDriverIf this is greater than the previously-aquired latestDate, the formats, setInfos, and identity will be retrieved again, and it will be used as the "until" date for the next record query.
getLatestDate in interface OAIDriverpublic RemoteIterator<MetadataFormat> listMetadataFormats()
OAIDriver
listMetadataFormats in interface OAIDriverMetadataFormatpublic RemoteIterator<SetInfo> listSetInfo()
OAIDriver
The content will be a well-formed XML chunk beginning with a
set element, as described in
section
4.6 of the OAI-PMH 2.0 specification.
listSetInfo in interface OAIDriverSetInfo
public RemoteIterator<Record> listRecords(java.util.Date from,
java.util.Date until,
java.lang.String mdPrefix)
OAIDriverRecord objects representing all records
in the format indicated by mdPrefix, which have changed in the given date
range.
Regarding dates: If from is not null, the date is greater than (non-inclusive) Until must be specified, and it is less than or equal to (inclusive).
listRecords in interface OAIDriverRecord
public void writeRecordXML(java.lang.String itemID,
java.lang.String mdPrefix,
java.lang.String sourceInfo,
java.io.PrintWriter writer)
throws RepositoryException
OAIDriverrecord element, as described in
section
4.1 of the OAI-PMH 2.0 specification.
writeRecordXML in interface OAIDriverRepositoryExceptionpublic void close()
OAIDriver
close in interface OAIDriver
public static void writeFromFile(java.io.File file,
java.io.PrintWriter out)
throws RepositoryException
RepositoryException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||