| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.client.HttpClient |
client |
protected java.lang.String |
method |
protected java.lang.String |
password |
protected java.lang.String |
url |
protected java.lang.String |
username |
| Constructor and Description |
|---|
HttpPidMinter(java.lang.String url,
java.lang.String method,
java.lang.String username,
java.lang.String password,
java.lang.String regex,
java.lang.String xpath)
Create a new HttpPidMinter.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.client.HttpClient |
buildClient()
Setup authentication in httpclient.
|
java.lang.String |
mintPid()
Mint a unique identifier using an external HTTP API.
|
protected java.lang.String |
responseToPid(java.lang.String responseText)
Remove unwanted text from the minter service response to produce the desired identifer.
|
protected final java.lang.String url
protected final java.lang.String method
protected final java.lang.String username
protected final java.lang.String password
protected org.apache.http.client.HttpClient client
public HttpPidMinter(java.lang.String url,
java.lang.String method,
java.lang.String username,
java.lang.String password,
java.lang.String regex,
java.lang.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 java.lang.String responseToPid(java.lang.String responseText)
throws java.lang.Exception
java.lang.ExceptionCopyright © 2013-2014 DuraSpace, Inc.. All Rights Reserved.