Package org.dspace.identifier.ezid
Class EZIDRequest
- java.lang.Object
-
- org.dspace.identifier.ezid.EZIDRequest
-
public class EZIDRequest extends Object
A request to EZID concerning a given (or expected) identifier.- Author:
- Mark H. Wood
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EZIDResponsecreate(String name, Map<String,String> metadata)Create an identifier with a given name.EZIDResponsedelete(String name)Destroy a reserved identifier.EZIDResponselookup(String name)Fetch the metadata bound to an identifier.EZIDResponsemint(Map<String,String> metadata)Ask EZID to create a unique identifier and return its name.EZIDResponsemodify(String name, Map<String,String> metadata)Alter the metadata bound to an identifier.EZIDResponsewithdraw(String name)Remove a public identifier from view.EZIDResponsewithdraw(String name, String reason)Remove a public identifier from view, with a reason.
-
-
-
Method Detail
-
lookup
public EZIDResponse lookup(String name) throws IdentifierException, IOException, URISyntaxException
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, URISyntaxException
Create 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, URISyntaxException
Ask 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, URISyntaxException
Alter 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
public EZIDResponse delete(String name) throws IOException, IdentifierException, URISyntaxException
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.
-
-