Package org.dspace.identifier.ezid
Class EZIDRequest
java.lang.Object
org.dspace.identifier.ezid.EZIDRequest
A request to EZID concerning a given (or expected) identifier.
- Author:
- Mark H. Wood
-
Method Summary
Modifier and TypeMethodDescriptionCreate an identifier with a given name.Destroy a reserved identifier.Fetch the metadata bound to an identifier.Ask EZID to create a unique identifier and return its name.Alter the metadata bound to an identifier.Remove a public identifier from view.Remove a public identifier from view, with a reason.
-
Method Details
-
lookup
Fetch the metadata bound to an identifier.- Parameters:
name- identifier name- Returns:
- Decoded response data evoked by a request made to EZID.
- Throws:
IdentifierException- if the response is error or body malformed.IOException- if the HTTP request fails.URISyntaxException- if host or authority is bad.
-
create
public EZIDResponse create(String name, Map<String, String> metadata) throws IOException, IdentifierException, URISyntaxExceptionCreate an identifier with a given name. The name is the end of the request path. Note: to "reserve" a given identifier, include "_status = reserved" inmetadata.- Parameters:
name- identifier namemetadata- ANVL-encoded key/value pairs.- Returns:
- Decoded response data evoked by a request made to EZID.
- Throws:
IdentifierException- if the response is error or body malformed.IOException- if the HTTP request fails.URISyntaxException- if host or authority is bad.
-
mint
public EZIDResponse mint(Map<String, String> metadata) throws IOException, IdentifierException, URISyntaxExceptionAsk EZID to create a unique identifier and return its name. NOTE: to "reserve" a unique identifier, include "_status = reserved" inmetadata.- Parameters:
metadata- ANVL-encoded key/value pairs.- Returns:
- Decoded response data evoked by a request made to EZID.
- Throws:
IdentifierException- if the response is error or body malformed.IOException- if the HTTP request fails.URISyntaxException- if host or authority is bad.
-
modify
public EZIDResponse modify(String name, Map<String, String> metadata) throws IOException, IdentifierException, URISyntaxExceptionAlter the metadata bound to an identifier.- Parameters:
name- identifier namemetadata- metadata fields to be altered. Leave the value of a field's empty to delete the field.- Returns:
- Decoded response data evoked by a request made to EZID.
- Throws:
IdentifierException- if the response is error or body malformed.IOException- if the HTTP request fails.URISyntaxException- if host or authority is bad.
-
delete
Destroy a reserved identifier. Fails if ID was ever public.- Parameters:
name- identifier name- Returns:
- Decoded response data evoked by a request made to EZID.
- Throws:
IdentifierException- if the response is error or body malformed.IOException- if the HTTP request fails.URISyntaxException- if host or authority is bad.
-
withdraw
public EZIDResponse withdraw(String name) throws IOException, IdentifierException, URISyntaxException Remove a public identifier from view.- Parameters:
name- identifier name- Returns:
- Decoded response data evoked by a request made to EZID.
- Throws:
IdentifierException- if the response is error or body malformed.IOException- if the HTTP request fails.URISyntaxException- if host or authority is bad.
-
withdraw
public EZIDResponse withdraw(String name, String reason) throws IOException, IdentifierException, URISyntaxException Remove a public identifier from view, with a reason.- Parameters:
name- identifier namereason- annotation for the item's unavailability.- Returns:
- Decoded response data evoked by a request made to EZID.
- Throws:
IdentifierException- if the response is error or body malformed.IOException- if the HTTP request fails.URISyntaxException- if host or authority is bad.
-