com.cloudcontrolled.api.client.support
Class CloudControlClientSupport

java.lang.Object
  extended by com.cloudcontrolled.api.client.support.AbstractCloudControlClientSupport
      extended by com.cloudcontrolled.api.client.support.CloudControlClientSupport
Direct Known Subclasses:
CloudControlClient

public class CloudControlClientSupport
extends AbstractCloudControlClientSupport

CloudControlClientSupport class.

Author:
Denis Neuling (denisneuling@gmail.com)

Field Summary
protected static String apiUrl
          Constant apiUrl="https://api.cloudcontrol.com"
protected static String ENV_API_URL_KEY
          Constant ENV_API_URL_KEY="CCTRL_API_URL"
protected  JsonDeserializer jsonDeserializer
           
protected  TokenStore tokenStore
           
 
Fields inherited from class com.cloudcontrolled.api.client.support.AbstractCloudControlClientSupport
log
 
Constructor Summary
CloudControlClientSupport()
           
 
Method Summary
protected
<T> Response<T>
deserialize(InputStream inputStream, Request<T> request)
           deserialize.
protected
<T> Response<T>
deserialize(String response, Request<T> request)
           deserialize.
protected
<T> Response<T>
deserializeError(InputStream inputStream, Request<T> request)
           deserializeError.
protected
<T> Response<T>
deserializeError(String response, Request<T> request)
           deserializeError.
static String getTargetUrl()
           getTargetUrl.
protected  org.apache.cxf.jaxrs.client.WebClient instantiateWebClient(String targetUrl)
           instantiateWebClient.
protected  org.apache.cxf.jaxrs.client.WebClient setAuthorizationBase64(org.apache.cxf.jaxrs.client.WebClient webClient, String base64)
           setAuthorizationBase64.
protected  org.apache.cxf.jaxrs.client.WebClient setAuthorizationCCAuthToken(org.apache.cxf.jaxrs.client.WebClient webClient)
           setAuthorizationCCAuthToken.
protected  String toBase64(String user, String password)
           toBase64.
 
Methods inherited from class com.cloudcontrolled.api.client.support.AbstractCloudControlClientSupport
doDelete, doGet, doPost, doPut, inquirePath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENV_API_URL_KEY

protected static final String ENV_API_URL_KEY
Constant ENV_API_URL_KEY="CCTRL_API_URL"

See Also:
Constant Field Values

apiUrl

protected static final String apiUrl
Constant apiUrl="https://api.cloudcontrol.com"

See Also:
Constant Field Values

tokenStore

protected TokenStore tokenStore

jsonDeserializer

protected JsonDeserializer jsonDeserializer
Constructor Detail

CloudControlClientSupport

public CloudControlClientSupport()
Method Detail

deserializeError

protected <T> Response<T> deserializeError(InputStream inputStream,
                                           Request<T> request)

deserializeError.

Specified by:
deserializeError in class AbstractCloudControlClientSupport
Type Parameters:
T - a T object.
Parameters:
inputStream - a InputStream object.
request - a Request object.
Returns:
a Response object.

deserializeError

protected <T> Response<T> deserializeError(String response,
                                           Request<T> request)

deserializeError.

Specified by:
deserializeError in class AbstractCloudControlClientSupport
Type Parameters:
T - a T object.
Parameters:
response - a String object.
request - a Request object.
Returns:
a Response object.

deserialize

protected <T> Response<T> deserialize(InputStream inputStream,
                                      Request<T> request)

deserialize.

Specified by:
deserialize in class AbstractCloudControlClientSupport
Type Parameters:
T - a T object.
Parameters:
inputStream - a InputStream object.
request - a Request object.
Returns:
a Response object.

deserialize

protected <T> Response<T> deserialize(String response,
                                      Request<T> request)

deserialize.

Specified by:
deserialize in class AbstractCloudControlClientSupport
Type Parameters:
T - a T object.
Parameters:
response - a String object.
request - a Request object.
Returns:
a Response object.

getTargetUrl

public static String getTargetUrl()

getTargetUrl.

Returns:
a String object.

toBase64

protected String toBase64(String user,
                          String password)

toBase64.

Parameters:
user - a String object.
password - a String object.
Returns:
a String object.

instantiateWebClient

protected org.apache.cxf.jaxrs.client.WebClient instantiateWebClient(String targetUrl)

instantiateWebClient.

Parameters:
targetUrl - a String object.
Returns:
a WebClient object.

setAuthorizationBase64

protected org.apache.cxf.jaxrs.client.WebClient setAuthorizationBase64(org.apache.cxf.jaxrs.client.WebClient webClient,
                                                                       String base64)

setAuthorizationBase64.

Parameters:
webClient - a WebClient object.
base64 - a String object.
Returns:
a WebClient object.

setAuthorizationCCAuthToken

protected org.apache.cxf.jaxrs.client.WebClient setAuthorizationCCAuthToken(org.apache.cxf.jaxrs.client.WebClient webClient)

setAuthorizationCCAuthToken.

Parameters:
webClient - a WebClient object.
Returns:
a WebClient object.


Copyright © 2012. All Rights Reserved.