Package com.redwood.scheduler.api.r2w
Interface R2WRequest
-
public interface R2WRequest
Interface for making SOAP, REST and content requests to R2W.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStream
getResponseBody()
Get the response content.int
getResponseCode()
Get the HTTP response code.String
getResponseHeader(String header)
Get the value of a response header.Map<String,List<String>>
getResponseHeaders()
Get all the response headers, as a Map<String, List<String>> where keys are header names and the lists are values.String
getResponsePhrase()
Get the HTTP response phrase (as defined in RFC 2616 Sec 6.1.1.String
getResponseVersion()
Get the HTTP response version.void
send()
Send the request.void
setRequestBody(String in)
Set the value of the body (may be null).void
setRequestHeader(String header, String value)
Set the value of a HTTP header.void
setRequestMethod(String in)
Set the request method (GET, POST, ...).void
setRequestTimeout(int milliseconds)
Set the timeout in milliseconds, 0 for no timeout.
-
-
-
Method Detail
-
setRequestHeader
void setRequestHeader(String header, String value)
Set the value of a HTTP header.- Parameters:
header
- the header.value
- the value.
-
setRequestBody
void setRequestBody(String in)
Set the value of the body (may be null).- Parameters:
in
- the body.
-
setRequestMethod
void setRequestMethod(String in)
Set the request method (GET, POST, ...).- Parameters:
in
- the request method.
-
setRequestTimeout
void setRequestTimeout(int milliseconds)
Set the timeout in milliseconds, 0 for no timeout.- Parameters:
milliseconds
- number of milliseconds
-
send
void send() throws IOException
Send the request.- Throws:
IOException
- if a network issue occurs.
-
getResponseVersion
String getResponseVersion()
Get the HTTP response version.- Returns:
- the HTTP response version.
-
getResponseCode
int getResponseCode()
Get the HTTP response code.- Returns:
- the HTTP response code.
-
getResponsePhrase
String getResponsePhrase()
Get the HTTP response phrase (as defined in RFC 2616 Sec 6.1.1.- Returns:
- the HTTP response phrase.
-
getResponseHeaders
Map<String,List<String>> getResponseHeaders()
Get all the response headers, as a Map<String, List<String>> where keys are header names and the lists are values.- Returns:
- response headers.
-
getResponseHeader
String getResponseHeader(String header)
Get the value of a response header.- Parameters:
header
- the name of the response header.- Returns:
- the value or null if there is no value.
-
getResponseBody
InputStream getResponseBody() throws IOException
Get the response content.- Returns:
- the response content.
- Throws:
IOException
- if an error occurs.
-
-