public class HttpPidMinter extends BasePidMinter
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.client.HttpClient |
client |
protected String |
method |
protected String |
password |
protected String |
url |
protected String |
username |
| Constructor and Description |
|---|
HttpPidMinter(String url,
String method,
String username,
String password,
String regex,
String xpath)
Create a new HttpPidMinter.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.client.HttpClient |
buildClient()
Setup authentication in httpclient.
|
String |
mintPid()
Mint a unique identifier using an external HTTP API.
|
protected String |
responseToPid(String responseText)
Remove unwanted text from the minter service response to produce the desired identifer.
|
makePidprotected final String url
protected final String method
protected final String username
protected final String password
protected org.apache.http.client.HttpClient client
public HttpPidMinter(String url, String method, String username, String password, String regex, String xpath)
url - The URL for the minter service. This is the only required argument -- all
other parameters can be blank.method - The HTTP method (POST, PUT or GET) used to generate a new PID (POST will
be used if the method is blank.username - If not blank, use this username to connect to the minter service.password - If not blank, use this password used to connect to the minter service.regex - If not blank, use this regular expression used to remove unwanted text from the
minter service response. For example, if the response text is "/foo/bar:baz" and the
desired identifier is "baz", then the regex would be ".*:".xpath - If not blank, use this XPath expression used to extract the desired identifier
from an XML minter response.protected org.apache.http.client.HttpClient buildClient()
protected String responseToPid(String responseText) throws Exception
Exceptionpublic String mintPid()
Copyright © 2013–2014 DuraSpace, Inc.. All rights reserved.