public class OpenStackClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected OpenStackClientConnector |
connector |
protected OpenStackClientConnector |
DEFAULT_CONNECTOR |
protected String |
endpoint |
protected org.slf4j.Logger |
logger |
protected Properties |
properties |
protected OpenStackTokenProvider |
tokenProvider |
| Constructor and Description |
|---|
OpenStackClient(String endpoint) |
OpenStackClient(String endpoint,
OpenStackClientConnector connector)
Constructs the client for the specified endpoint and using the provided connector
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
execute(OpenStackRequest<T> request) |
<R> OpenStackRequest<R> |
get(String path,
Class<R> returnType) |
org.slf4j.Logger |
getLogger() |
Properties |
getProperties() |
void |
property(String property,
String value) |
<T> OpenStackResponse |
request(OpenStackRequest<T> request) |
void |
setLogger(org.slf4j.Logger logger) |
void |
setTokenProvider(OpenStackTokenProvider tokenProvider) |
void |
token(String token) |
protected String endpoint
protected OpenStackTokenProvider tokenProvider
protected OpenStackClientConnector connector
protected Properties properties
protected org.slf4j.Logger logger
protected OpenStackClientConnector DEFAULT_CONNECTOR
public OpenStackClient(String endpoint)
public OpenStackClient(String endpoint, OpenStackClientConnector connector)
endpoint - The endpoint to connect toconnector - The connector to use. If null, the default connector is determined and loaded.public void setLogger(org.slf4j.Logger logger)
public org.slf4j.Logger getLogger()
public <T> OpenStackResponse request(OpenStackRequest<T> request) throws OpenStackConnectException, OpenStackResponseException
request - The request to be processedOpenStackConnectException - 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 <T> T execute(OpenStackRequest<T> request) throws OpenStackConnectException, OpenStackResponseException
request - The request to be processedOpenStackConnectException - 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 Properties getProperties()
public void setTokenProvider(OpenStackTokenProvider tokenProvider)
public void token(String token)
public <R> OpenStackRequest<R> get(String path, Class<R> returnType)
Copyright © 2012–2017. All rights reserved.