Class HarvestClient
java.lang.Object
org.javastro.ivoa.registry.harvesting.HarvestClient
A registry client that will directly return Registry objects.
Also deals with continuation tokens seamlessly.
TODO it would be a good idea to have an asynchronous streaming style client too for really big harvests.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHarvestClient(String url, boolean doXMLValidation, int harvestChunkSize) Create a new harvest client for the given registry OAI-PMH URL. -
Method Summary
Modifier and TypeMethodDescriptionList<org.javastro.ivoa.entities.oai.oaipmh.HeaderType>getIdentifiers(Instant from, Instant until) List<org.javastro.ivoa.entities.oai.oaipmh.HeaderType>getIdentifiers(Instant from, Instant until, String set) org.javastro.ivoa.entities.resource.ResourceList<org.javastro.ivoa.entities.oai.oaipmh.RecordType>getRecords(Instant from, Instant until) List<org.javastro.ivoa.entities.oai.oaipmh.RecordType>getRecords(Instant from, Instant until, String set) booleanorg.javastro.ivoa.entities.resource.Resourceidentify()The registry entry for the registry being harvested.voidbooleanvalidate()check that the registry is set up to be harvestable
-
Field Details
-
METADATA_PREFIX
- See Also:
-
IVO_MANAGED_SET
- See Also:
-
-
Constructor Details
-
HarvestClient
Create a new harvest client for the given registry OAI-PMH URL. The client creates objects for the responses and will do XML validation if required. Note, however, that failed validation will fail the operations. Otherwise it is somewhat lax in its parsing. OAI-PMH services are able to chunk their responses - the client will automatically handle the continuation. It is possible to limit the number of records returned in a single call to getRecords, which may be useful for very large harvests.- Parameters:
url- The oai-pmh endpoint of the registry to harvest.doXMLValidation- if true do XML validation of the responses.harvestChunkSize- the maximum number of records to return in a single call to getRecords - 0 means return whatever the registry gives in a single response.
-
-
Method Details
-
resetCursor
public void resetCursor() -
hasMoreRecords
public boolean hasMoreRecords() -
validate
public boolean validate()check that the registry is set up to be harvestable- Returns:
- true if OK
-
identify
public org.javastro.ivoa.entities.resource.Resource identify()The registry entry for the registry being harvested.- Returns:
- the resource describing the registry.
-
getRecord
-
getIdentifiers
-
getIdentifiers
-
getRecords
-
getRecords
-