|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gcube.common.OAIRepository
public class OAIRepository
This class represents an OAI repository.
| Field Summary | |
|---|---|
int |
STATE_IDENTIFIED
The repository has been identified. |
int |
STATE_UNIDENTIFIED
The repository is not identified yet. |
static int |
VALIDATION_LOOSE
This will attempt to continue processing even if some non-well-formed XML is encountered. |
static int |
VALIDATION_STRICT
This is the default type. |
static int |
VALIDATION_VERY_STRICT
This will cause the XML responses to be initially validated against the XML schemas, as indicated by the xsi:schemaLocation attributes. |
static String |
XMLNS_DC
namespace URIs for metadata formats |
static String |
XMLNS_EPR
|
static String |
XMLNS_EPR_1_0
|
static String |
XMLNS_ID
|
static String |
XMLNS_ID_1_0
|
static String |
XMLNS_ID_1_0_aps
some repositories don't use the correct namespaces (American Physical Society) |
static String |
XMLNS_ID_2_0
|
static String |
XMLNS_OAI
namespaces from the current (1.1) version of the protocol |
static String |
XMLNS_OAI_1_0
namespaces from the 1.0 version of the protocol |
static String |
XMLNS_OAI_2_0
namespaces from the 2.0 version of the protocol |
static String |
XMLNS_OAI_DC_2_0
|
static String |
XMLNS_OAI_MARC
|
static String |
XMLNS_OAI_MARC_1_0
|
static String |
XMLNS_RFC1807
|
| Constructor Summary | |
|---|---|
OAIRepository()
Construct an empty OAI repository. |
|
| Method Summary | |
|---|---|
protected String |
frndGetPassword()
|
protected String |
frndGetRawResponse()
|
protected String |
frndGetUser()
|
protected String |
frndMyEncode(InputStream s)
Turn a string into something that can be legally stuffed into an XML CDATA section |
protected void |
frndSetErrors(NodeList e)
|
protected void |
frndSetNamespaceNode(Element ns)
|
protected void |
frndSetRepositoryID(String id)
|
protected void |
frndSetRequest(Node u)
|
protected void |
frndSetResponseDate(String d)
|
protected HttpURLConnection |
frndTrySend(HttpURLConnection h)
Purpose: Attempt to send the request to the repository, honoring 503 Retry statuses Inputs: h the HTTP object to use for the sending NOTE: Not sure if the http object does redirects (302) or not; may have to do these manually also |
String |
getAdminEmail()
Returns the email address of the repository administrator. |
String |
getAdminEmail(int i)
Returns the email address of the repository administrator. |
int |
getAdminEmailCount()
Returns how many admin emails there are for the repository |
String |
getBaseURL()
Returns the BASE-URL of the repository. |
String |
getCompression()
Returns the compression supported by the repository. |
String |
getCompression(int i)
Returns the compression supported by the repository. |
int |
getCompressionCount()
Returns how many compressions are supported by the repository |
String |
getDeletedRecord()
Returns the type of deleted items supported by the repository |
Node |
getDescription()
Returns the first repository description returned by the Identify request as an XML node; if there is no descriptin an empty string is returned. |
Node |
getDescription(int i)
Returns one of the repository descriptions returned by the Identify request as an XML node; the index parameter indicates which description to return: 0 to DescriptionCount-1; if there is no descriptin an empty string is returned. |
int |
getDescriptionCount()
Returns the number of descriptions returned by the Identify request. |
String |
getEarliestDatestamp()
Returns how many compressions are supported by the repository |
Node |
getEPrintsDescription()
If one of the descriptions returned by the Identify request is an eprints, this method will return the eprints description as an XML node. |
String |
getFrom()
Returns the value to be used in the From field of the HTTP request header. |
String |
getGranularity()
Returns the datestamp granularity supported by the repository |
OAIError |
getLastOAIError()
Returns one of the errors returned by the repository |
OAIError |
getLastOAIError(int i)
|
int |
getLastOAIErrorCount()
Returns how many errors were returned by the repository |
int |
getMaxRetryMinutes()
Returns the maximum allowable minutes to wait for a retry without failing. |
protected Element |
getNamespaceNode()
|
Node |
getOAIIdentifierDescription()
If one of the descriptions returned by the Identify request is an oai-identifier, this method will return the oai-identifier description as an XML node. |
int |
getProtocolMajorVersion()
Returns the major version number of the protocol spec supported by the repository currently either 1 or 2. |
String |
getProtocolVersion()
Returns the version of the protocol spec supported by the repository. |
OAIRecord |
getRecord(String identifier)
Returns an OAIRecord object for the given OAI Identifier with default metadataPrefix as oai_dc. |
OAIRecord |
getRecord(String identifier,
String metadataPrefix)
Returns an OAIRecord object for the given OAI Identifier and the metadataPrefix. |
String |
getRepositoryIdentifier()
If one of the descriptions returned by the Identify request is an oai-identifier, this parameter will contain the registered identifier of the repository. |
String |
getRepositoryName()
Returns the name of the repository |
String |
getRequestBaseURL()
The Request URL returned by the most recent request. |
String |
getRequestFrom()
Returns the from query param returned by the most recent response |
String |
getRequestIdentifier()
Returns the identifier query param returned by the most recent response |
String |
getRequestMetadataPrefix()
Returns the metadataPrefix query param returned by the most recent response |
String |
getRequestResumptionToken()
Returns the resumptionToken query param returned by the most recent response |
String |
getRequestSet()
Returns the set query param returned by the most recent response |
String |
getRequestUntil()
Returns the until query param returned by the most recent response |
String |
getRequestURL()
Return the complete request url returned by the most recent response. |
String |
getRequestVerb()
Returns the verb query param returned by the most recent response |
String |
getResponseDate()
The Response Date returned by the most recent request. |
int |
getRetryLimit()
Returns the number of times to retry if given a 503 before giving up. |
String |
getSampleIdentifier()
If one of the descriptions returned by the Identify request is an oai-identifier, this parameter will contain the sample OAI identifier contained therein. |
String |
getUserAgent()
Returns the value to be used in the User-Agent field of the HTTP request header. |
int |
getValidation()
Returns the type of validation to perform on the OAI response. |
String |
identify()
Sends an Identify request to a repository with the baseURL previously set; if the Identify request is successful, the RepositoryName will be returned. |
OAIRecordList |
listIdentifiers()
Returns an OAIRecordList object containing the records returned by the repository. |
OAIRecordList |
listIdentifiers(String untild)
Returns an OAIRecordList object containing the records returned by the repository for the given untild. |
OAIRecordList |
listIdentifiers(String untild,
String fromd)
Returns an OAIRecordList object containing the records returned by the repository for the given untild and fromd. |
OAIRecordList |
listIdentifiers(String untild,
String fromd,
String setSpec)
Returns an OAIRecordList object containing the records returned by the repository for the given untild, fromd, and SetSpec. |
OAIRecordList |
listIdentifiers(String untild,
String fromd,
String setSpec,
String metadataPrefix)
Returns an OAIRecordList object containing the records returned by the repository for the given untild, fromd, and SetSpec. |
OAIMetadataFormatList |
listMetadataFormats()
Returns an OAIMetadataFormatList object containing the metadata formats supported by the repository.. |
OAIMetadataFormatList |
listMetadataFormats(String identifier)
Returns an OAIMetadataFormatList object containing the metadata formats supported by a specific record. |
OAIRecordList |
listRecords()
Returns an OAIRecordList object containing the records returned by the repository. |
OAIRecordList |
listRecords(String metadataPrefix)
Returns an OAIRecordList object containing the records returned by the repository for the given metadataPrefix. |
OAIRecordList |
listRecords(String metadataPrefix,
String untild)
Returns an OAIRecordList object containing the records returned by the repository for the given metadataPrefix and untild. |
OAIRecordList |
listRecords(String metadataPrefix,
String untild,
String fromd)
Returns an OAIRecordList object containing the records returned by the repository for the given metadataPrefix, untild, and fromd. |
OAIRecordList |
listRecords(String metadataPrefix,
String untild,
String fromd,
String setSpec)
Returns an OAIRecordList object containing the records returned by the repository for the given metadataPrefix, untild, fromd, and SetSpec. |
OAISetList |
listSets()
Returns an OAISetList object containing the sets returned by the repository. |
void |
setBaseURL(String url)
Sets the BASE-URL of the repository; must be set before most other properties or methods can be used. |
void |
setBasicAuthorization(String usr,
String pwd)
Set the user and password to use for Basic HTTP Authorization |
void |
setFrom(String f)
Sets the value to be used in the From field of the HTTP request header. |
void |
setMaxRetryMinutes(int m)
Sets the maximum allowable minutes to wait for a retry without failing. |
void |
setRetryLimit(int rl)
Sets the number of times to retry if a HTTP status of 503 is returned by the repository; defaults to 5 |
void |
setUserAgent(String ua)
Sets the value to be used in the User-Agent field of the HTTP request header. |
void |
setValidation(int v)
Sets the type of validation to perform on the OAI response. |
boolean |
usesEPrints()
Returns true if the repository uses EPrints descriptions in its Identify request; else false. |
boolean |
usesOAIIdentifier()
Returns true if the repository uses OAIIdentifier descriptions in its Identify request; else false. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final int STATE_UNIDENTIFIED
public final int STATE_IDENTIFIED
public static final int VALIDATION_STRICT
public static final int VALIDATION_VERY_STRICT
public static final int VALIDATION_LOOSE
public static String XMLNS_DC
public static String XMLNS_RFC1807
public static String XMLNS_OAI_MARC
public static String XMLNS_OAI
public static String XMLNS_ID
public static String XMLNS_EPR
public static String XMLNS_OAI_2_0
public static String XMLNS_OAI_DC_2_0
public static String XMLNS_ID_2_0
public static String XMLNS_OAI_1_0
public static String XMLNS_ID_1_0
public static String XMLNS_EPR_1_0
public static String XMLNS_OAI_MARC_1_0
public static String XMLNS_ID_1_0_aps
| Constructor Detail |
|---|
public OAIRepository()
| Method Detail |
|---|
public void setBaseURL(String url)
throws OAIException
OAIException
public String getBaseURL()
throws OAIException
OAIExceptionprotected void frndSetErrors(NodeList e)
protected void frndSetRepositoryID(String id)
protected void frndSetRequest(Node u)
protected void frndSetResponseDate(String d)
protected String frndGetRawResponse()
protected String frndGetUser()
protected String frndGetPassword()
public void setBasicAuthorization(String usr,
String pwd)
public OAIError getLastOAIError()
throws OAIException
OAIException
public OAIError getLastOAIError(int i)
throws OAIException
OAIExceptionpublic int getLastOAIErrorCount()
public String getRequestVerb()
public String getRequestIdentifier()
public String getRequestMetadataPrefix()
public String getRequestFrom()
public String getRequestUntil()
public String getRequestSet()
public String getRequestResumptionToken()
public int getAdminEmailCount()
throws OAIException
OAIException
public int getCompressionCount()
throws OAIException
OAIException
public String getEarliestDatestamp()
throws OAIException
OAIException
public String getDeletedRecord()
throws OAIException
OAIException
public String getGranularity()
throws OAIException
OAIExceptionpublic String getResponseDate()
public String getRequestBaseURL()
public int getMaxRetryMinutes()
public void setMaxRetryMinutes(int m)
protected String frndMyEncode(InputStream s)
throws OAIException
OAIExceptionprotected void frndSetNamespaceNode(Element ns)
protected Element getNamespaceNode()
public Node getDescription()
throws OAIException
OAIException
public Node getDescription(int i)
throws OAIException
OAIExceptionpublic int getDescriptionCount()
public OAIRecord getRecord(String identifier)
throws OAIException
OAIException
public OAIRecord getRecord(String identifier,
String metadataPrefix)
throws OAIException
OAIException
public String identify()
throws OAIException
OAIException
public OAIRecordList listIdentifiers()
throws OAIException
OAIException
public OAIRecordList listIdentifiers(String untild)
throws OAIException
OAIException
public OAIRecordList listIdentifiers(String untild,
String fromd)
throws OAIException
OAIException
public OAIRecordList listIdentifiers(String untild,
String fromd,
String setSpec)
throws OAIException
OAIException
public OAIRecordList listIdentifiers(String untild,
String fromd,
String setSpec,
String metadataPrefix)
throws OAIException
OAIException
public OAIRecordList listRecords()
throws OAIException
OAIException
public OAIRecordList listRecords(String metadataPrefix)
throws OAIException
OAIException
public OAIRecordList listRecords(String metadataPrefix,
String untild)
throws OAIException
OAIException
public OAIRecordList listRecords(String metadataPrefix,
String untild,
String fromd)
throws OAIException
OAIException
public OAIRecordList listRecords(String metadataPrefix,
String untild,
String fromd,
String setSpec)
throws OAIException
OAIException
public String getRepositoryIdentifier()
throws OAIException
OAIException
public Node getOAIIdentifierDescription()
throws OAIException
OAIException
public Node getEPrintsDescription()
throws OAIException
OAIExceptionpublic void setRetryLimit(int rl)
public int getRetryLimit()
public String getSampleIdentifier()
throws OAIException
OAIException
public String getRepositoryName()
throws OAIException
OAIException
public String getAdminEmail()
throws OAIException
OAIException
public String getAdminEmail(int i)
throws OAIException
OAIException
public String getCompression()
throws OAIException
OAIException
public String getCompression(int i)
throws OAIException
OAIException
public int getProtocolMajorVersion()
throws OAIException
OAIException
public String getProtocolVersion()
throws OAIException
OAIExceptionpublic String getRequestURL()
public String getUserAgent()
public void setUserAgent(String ua)
public String getFrom()
public void setFrom(String f)
protected HttpURLConnection frndTrySend(HttpURLConnection h)
throws OAIException
OAIException
public boolean usesOAIIdentifier()
throws OAIException
OAIException
public boolean usesEPrints()
throws OAIException
OAIExceptionpublic int getValidation()
public void setValidation(int v)
public OAIMetadataFormatList listMetadataFormats()
throws OAIException
OAIException
public OAIMetadataFormatList listMetadataFormats(String identifier)
throws OAIException
OAIException
public OAISetList listSets()
throws OAIException
OAIException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||