public class OperationSupport extends Object
| Modifier and Type | Field and Description |
|---|---|
protected com.squareup.okhttp.OkHttpClient |
client |
protected Config |
config |
static com.squareup.okhttp.MediaType |
JSON |
protected static com.fasterxml.jackson.databind.ObjectMapper |
JSON_MAPPER |
protected String |
name |
protected String |
namespace |
protected String |
resourceT |
protected static com.fasterxml.jackson.databind.ObjectMapper |
YAML_MAPPER |
| Constructor and Description |
|---|
OperationSupport() |
OperationSupport(com.squareup.okhttp.OkHttpClient client,
Config config,
String resourceT,
String namespace,
String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertResponseCode(com.squareup.okhttp.Request request,
com.squareup.okhttp.Response response,
int expectedStatusCode)
Checks if the response status code is the expected and throws the appropriate KubernetesClientException if not.
|
protected <T> String |
checkName(T item) |
protected <T> String |
checkNamespace(T item) |
Config |
getConfig() |
String |
getName() |
String |
getNamespace() |
URL |
getNamespacedUrl() |
URL |
getNamespacedUrl(String namespace) |
String |
getResourceT() |
URL |
getResourceUrl() |
URL |
getResourceUrl(String namespace,
String name) |
URL |
getRootUrl() |
protected <T,I> T |
handleCreate(I resource,
Class<T> outputType) |
protected <T> void |
handleDelete(T resource) |
protected void |
handleDelete(URL requestUrl) |
protected <T> T |
handleGet(URL resourceUrl,
Class<T> type) |
protected <T> T |
handleReplace(T updated,
Class<T> type) |
protected <T> T |
handleResponse(com.squareup.okhttp.Request.Builder requestBuilder,
int successStatusCode,
Class<T> type) |
boolean |
isNamespaceRequired() |
protected <T> T |
unmarshal(InputStream is,
Class<T> type) |
protected static final com.fasterxml.jackson.databind.ObjectMapper JSON_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper YAML_MAPPER
public static final com.squareup.okhttp.MediaType JSON
protected final com.squareup.okhttp.OkHttpClient client
protected final Config config
protected final String resourceT
protected final String namespace
protected final String name
public String getResourceT()
public String getNamespace()
public String getName()
public boolean isNamespaceRequired()
public URL getRootUrl()
public URL getNamespacedUrl(String namespace) throws MalformedURLException
MalformedURLExceptionpublic URL getNamespacedUrl() throws MalformedURLException
MalformedURLExceptionpublic URL getResourceUrl(String namespace, String name) throws MalformedURLException
MalformedURLExceptionpublic URL getResourceUrl() throws MalformedURLException
MalformedURLExceptionprotected <T> String checkNamespace(T item)
protected <T> String checkName(T item)
protected <T> void handleDelete(T resource)
throws ExecutionException,
InterruptedException,
KubernetesClientException,
IOException
protected void handleDelete(URL requestUrl) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T,I> T handleCreate(I resource,
Class<T> outputType)
throws ExecutionException,
InterruptedException,
KubernetesClientException,
IOException
protected <T> T handleReplace(T updated,
Class<T> type)
throws ExecutionException,
InterruptedException,
KubernetesClientException,
IOException
protected <T> T handleGet(URL resourceUrl, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T> T handleResponse(com.squareup.okhttp.Request.Builder requestBuilder,
int successStatusCode,
Class<T> type)
throws ExecutionException,
InterruptedException,
KubernetesClientException,
IOException
protected void assertResponseCode(com.squareup.okhttp.Request request,
com.squareup.okhttp.Response response,
int expectedStatusCode)
request - The {#link Request} object.response - The Response object.expectedStatusCode - The expected status code.KubernetesClientException - When the response code is not the expected.protected <T> T unmarshal(InputStream is, Class<T> type) throws KubernetesClientException
KubernetesClientExceptionpublic Config getConfig()
Copyright © 2015 Red Hat. All rights reserved.