public class Pipeline2HttpClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static DateFormat |
iso8601 |
| Constructor and Description |
|---|
Pipeline2HttpClient() |
| Modifier and Type | Method and Description |
|---|---|
static WSResponse |
delete(String endpoint,
String path,
String username,
String secret,
Map<String,String> parameters)
Send a DELETE request.
|
static WSResponse |
get(String endpoint,
String path,
String username,
String secret,
Map<String,String> parameters)
Send a GET request.
|
static WSResponse |
postMultipart(String endpoint,
String path,
String username,
String secret,
Map<String,File> parts)
POST a multipart request.
|
static WSResponse |
postXml(String endpoint,
String path,
String username,
String secret,
Document xml)
POST an XML document.
|
static String |
url(String endpoint,
String path,
String username,
String secret,
Map<String,String> parameters)
Sign a URL for communication with a Pipeline 2 Web Service running in authenticated mode.
|
public static DateFormat iso8601
public static WSResponse get(String endpoint, String path, String username, String secret, Map<String,String> parameters) throws Pipeline2Exception
endpoint - WS endpoint, for instance "http://localhost:8182/ws".path - Path to resource, for instance "/scripts".username - Robot username. Can be null. If null, then the URL will not be signed.secret - Robot secret. Can be null.parameters - URL query string parametersPipeline2Exception - thrown if an error occurspublic static WSResponse delete(String endpoint, String path, String username, String secret, Map<String,String> parameters) throws Pipeline2Exception
endpoint - WS endpoint, for instance "http://localhost:8182/ws".path - Path to resource, for instance "/scripts".username - Robot username. Can be null. If null, then the URL will not be signed.secret - Robot secret. Can be null.parameters - URL query string parametersPipeline2Exception - thrown if an error occurspublic static WSResponse postXml(String endpoint, String path, String username, String secret, Document xml) throws Pipeline2Exception
endpoint - WS endpoint, for instance "http://localhost:8182/ws".path - Path to resource, for instance "/scripts".username - Robot username. Can be null. If null, then the URL will not be signed.secret - Robot secret. Can be null.xml - The XML document to post.Pipeline2Exception - thrown if an error occurspublic static WSResponse postMultipart(String endpoint, String path, String username, String secret, Map<String,File> parts) throws Pipeline2Exception
endpoint - WS endpoint, for instance "http://localhost:8182/ws".path - Path to resource, for instance "/scripts".username - Robot username. Can be null. If null, then the URL will not be signed.secret - Robot secret. Can be null.parts - A map of all the parts.Pipeline2Exception - thrown if an error occurspublic static String url(String endpoint, String path, String username, String secret, Map<String,String> parameters) throws Pipeline2Exception
endpoint - the Pipeline 2 endpointpath - the URL path componentusername - the usernamesecret - the secretparameters - a map of parameters to encode in the URLPipeline2Exception - thrown if an error occursCopyright © 2012–2022 The DAISY Consortium. All rights reserved.