public class BrooklynApi
extends java.lang.Object
Constructor and Description |
---|
BrooklynApi(java.lang.String endpoint,
org.apache.http.auth.Credentials credentials,
int maxPoolSize,
int timeOutInMillis)
Creates a BrooklynApi using an HTTP connection pool
|
BrooklynApi(java.net.URL endpoint,
ClientExecutor clientExecutor)
Creates a BrooklynApi using a custom ClientExecutor
|
Modifier and Type | Method and Description |
---|---|
AccessApi |
getAccessApi() |
ActivityApi |
getActivityApi() |
ApplicationApi |
getApplicationApi() |
CatalogApi |
getCatalogApi() |
EffectorApi |
getEffectorApi() |
static <T> T |
getEntity(javax.ws.rs.core.Response response,
<any> type)
|
static <T> T |
getEntity(javax.ws.rs.core.Response response,
java.lang.Class<T> type)
Extracts an instance of the given type from the response, including JSON strings in there.
|
EntityApi |
getEntityApi() |
EntityConfigApi |
getEntityConfigApi() |
static <T> T |
getEntityOnSuccess(javax.ws.rs.core.Response response,
<any> type)
As
#getEntity(Response, GenericType) but fails if the response is an error of any sort. |
static <T> T |
getEntityOnSuccess(javax.ws.rs.core.Response response,
java.lang.Class<T> type)
As
getEntity(Response, Class) but fails if the response is an error of any sort. |
LocationApi |
getLocationApi() |
PolicyApi |
getPolicyApi() |
PolicyConfigApi |
getPolicyConfigApi() |
ScriptApi |
getScriptApi() |
SensorApi |
getSensorApi() |
ServerApi |
getServerApi() |
UsageApi |
getUsageApi() |
static BrooklynApi |
newInstance(java.lang.String endpoint)
Creates a BrooklynApi using an HTTP connection pool
|
static BrooklynApi |
newInstance(java.lang.String endpoint,
int maxPoolSize,
int timeOutInMillis)
Creates a BrooklynApi using an HTTP connection pool
|
static BrooklynApi |
newInstance(java.lang.String endpoint,
java.lang.String username,
java.lang.String password)
Creates a BrooklynApi using an HTTP connection pool
|
static BrooklynApi |
newInstance(java.lang.String endpoint,
java.lang.String username,
java.lang.String password,
int maxPoolSize,
int timeOutInMillis)
Creates a BrooklynApi using an HTTP connection pool
|
public BrooklynApi(java.net.URL endpoint, ClientExecutor clientExecutor)
endpoint
- the Brooklyn endpointclientExecutor
- the ClientExecutorgetClientExecutor(org.apache.http.auth.Credentials)
public BrooklynApi(java.lang.String endpoint, @Nullable org.apache.http.auth.Credentials credentials, int maxPoolSize, int timeOutInMillis)
endpoint
- the Brooklyn endpointcredentials
- user credentials or nullmaxPoolSize
- maximum pool sizetimeOutInMillis
- connection timeout in millisecondspublic static BrooklynApi newInstance(java.lang.String endpoint)
endpoint
- the Brooklyn endpointpublic static BrooklynApi newInstance(java.lang.String endpoint, int maxPoolSize, int timeOutInMillis)
endpoint
- the Brooklyn endpointmaxPoolSize
- maximum connection pool sizetimeOutInMillis
- connection timeout in millisecondpublic static BrooklynApi newInstance(java.lang.String endpoint, java.lang.String username, java.lang.String password)
endpoint
- the Brooklyn endpointusername
- for authenticationpassword
- for authenticationpublic static BrooklynApi newInstance(java.lang.String endpoint, java.lang.String username, java.lang.String password, int maxPoolSize, int timeOutInMillis)
endpoint
- the Brooklyn endpointusername
- for authenticationpassword
- for authenticationmaxPoolSize
- maximum connection pool sizetimeOutInMillis
- connection timeout in millisecondpublic ActivityApi getActivityApi()
public ApplicationApi getApplicationApi()
public CatalogApi getCatalogApi()
public EffectorApi getEffectorApi()
public EntityConfigApi getEntityConfigApi()
public EntityApi getEntityApi()
public LocationApi getLocationApi()
public PolicyConfigApi getPolicyConfigApi()
public PolicyApi getPolicyApi()
public ScriptApi getScriptApi()
public SensorApi getSensorApi()
public ServerApi getServerApi()
public UsageApi getUsageApi()
public AccessApi getAccessApi()
public static <T> T getEntity(javax.ws.rs.core.Response response, java.lang.Class<T> type)
getEntityOnSuccess(Response, Class)
.
This method will coerce and empty map "{}" to a no-arg contructed instance of the target class. This method will also ignore most errors in the response.
It has changed to identify the most obvious errors.
public static <T> T getEntityOnSuccess(javax.ws.rs.core.Response response, java.lang.Class<T> type)
getEntity(Response, Class)
but fails if the response is an error of any sort.public static <T> T getEntity(javax.ws.rs.core.Response response, <any> type)
public static <T> T getEntityOnSuccess(javax.ws.rs.core.Response response, <any> type)
#getEntity(Response, GenericType)
but fails if the response is an error of any sort.