public class OpenStackRequest<R> extends Object
| Constructor and Description |
|---|
OpenStackRequest() |
OpenStackRequest(OpenStackClient client,
HttpMethod method,
CharSequence path,
Entity<?> entity,
Class<R> returnType) |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
buildPath(String... elements) |
String |
endpoint() |
OpenStackRequest<R> |
endpoint(String endpoint) |
Entity<?> |
entity() |
<T> Entity<T> |
entity(T entity,
String contentType) |
R |
execute()
Executes the request that has been constructed
|
OpenStackClient |
getOpenStackClient() |
OpenStackRequest<R> |
header(String name,
Object value) |
Map<String,List<Object>> |
headers() |
<T> Entity<T> |
json(T entity) |
HttpMethod |
method() |
OpenStackRequest<R> |
method(HttpMethod method) |
String |
path() |
OpenStackRequest<R> |
path(String path) |
OpenStackRequest<R> |
queryParam(String key,
Object value) |
Map<String,List<Object>> |
queryParams() |
OpenStackRequest<R> |
queryString(String queryString)
This method will parse the query string which is a collection of name value pairs and put then in queryParam hash
map
|
OpenStackResponse |
request() |
Class<R> |
returnType() |
void |
returnType(Class<R> returnType) |
String |
toString() |
public OpenStackRequest()
public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity<?> entity, Class<R> returnType)
public OpenStackRequest<R> endpoint(String endpoint)
public OpenStackClient getOpenStackClient()
public String endpoint()
public OpenStackRequest<R> method(HttpMethod method)
public HttpMethod method()
public OpenStackRequest<R> path(String path)
public String path()
public OpenStackRequest<R> header(String name, Object value)
public Entity<?> entity()
public <T> Entity<T> json(T entity)
public R execute() throws OpenStackConnectException, OpenStackResponseException
OpenStackConnectException - If the connection to the provider cannot be established. This exception indicates that the provider
is not reachable, or that some failure occurred attempting to open the connection to the provider.OpenStackResponseException - If the provider responds with some form of error regarding the request, such as unauthorized. This is
an indication that there is a problem with the request itself, not the connection.public OpenStackResponse request() throws OpenStackConnectException, OpenStackResponseException
OpenStackConnectException - If the connection to the provider cannot be established. This exception indicates that the provider
is not reachable, or that some failure occurred attempting to open the connection to the provider.OpenStackResponseException - If the provider responds with some form of error regarding the request, such as unauthorized. This is
an indication that there is a problem with the request itself, not the connection. @see
com.woorea.openstack
.base.client.OpenStackClientConnector#request(com.woorea.openstack.base.client.OpenStackRequest)public OpenStackRequest<R> queryParam(String key, Object value)
public OpenStackRequest<R> queryString(String queryString)
queryString - The query string to be parsedCopyright © 2012–2017. All rights reserved.