public class BaseOperation<T,L extends KubernetesResourceList,D extends Doneable<T>,R extends Resource<T,D>> extends OperationSupport implements OperationInfo, MixedOperation<T,L,D,R>, Resource<T,D>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
apiVersion |
protected java.lang.Class<D> |
doneableType |
protected java.lang.Class<L> |
listType |
protected Reaper |
reaper |
protected java.lang.Class<T> |
type |
apiGroupName, apiGroupVersion, client, config, context, JSON, JSON_MAPPER, JSON_PATCH, name, namespace, resourceT, YAML_MAPPER
Modifier | Constructor and Description |
---|---|
protected |
BaseOperation(OperationContext ctx) |
Modifier and Type | Method and Description |
---|---|
EditReplacePatchDeletable<T,T,D,java.lang.Boolean> |
cascading(boolean cascading) |
T |
create(T... resources) |
D |
createNew() |
T |
createOrReplace(T... items) |
D |
createOrReplaceWithNew() |
java.lang.Boolean |
delete()
Deletes resource and all managed resources, returns null or false if not found.
|
java.lang.Boolean |
delete(java.util.List<T> items) |
java.lang.Boolean |
delete(T... items) |
D |
edit() |
OperationInfo |
forOperationType(java.lang.String type) |
Gettable<T> |
fromServer() |
T |
get() |
java.lang.String |
getApiVersion() |
protected java.lang.Class<? extends Config> |
getConfigType() |
java.lang.Class<D> |
getDoneableType() |
java.lang.String |
getFieldQueryParam() |
protected java.util.Map<java.lang.String,java.lang.String> |
getFields() |
protected java.util.Map<java.lang.String,java.lang.String[]> |
getFieldsNot() |
java.lang.Long |
getGracePeriodSeconds() |
T |
getItem() |
java.lang.String |
getKind() |
java.lang.String |
getLabelQueryParam() |
protected java.util.Map<java.lang.String,java.lang.String> |
getLabels() |
protected java.util.Map<java.lang.String,java.lang.String[]> |
getLabelsIn() |
protected java.util.Map<java.lang.String,java.lang.String[]> |
getLabelsNot() |
protected java.util.Map<java.lang.String,java.lang.String[]> |
getLabelsNotIn() |
java.lang.Class<L> |
getListType() |
T |
getMandatory() |
java.lang.String |
getOperationType() |
java.lang.Boolean |
getReloadingFromServer()
Deprecated.
|
java.lang.String |
getResourceT() |
java.lang.String |
getResourceVersion() |
RootPaths |
getRootPaths() |
java.lang.Class<T> |
getType() |
protected T |
handleCreate(T resource) |
protected T |
handleGet(java.net.URL resourceUrl) |
protected T |
handlePatch(T current,
T updated) |
protected T |
handleReplace(T updated) |
protected T |
handleResponse(okhttp3.Request.Builder requestBuilder) |
NonNamespaceOperation<T,L,D,R> |
inAnyNamespace() |
NonNamespaceOperation<T,L,D,R> |
inNamespace(java.lang.String namespace) |
boolean |
isApiGroup()
Return true if this is an API Group where the versions include a slash in them
|
java.lang.Boolean |
isCascading() |
java.lang.Boolean |
isReady() |
protected boolean |
isReaping() |
java.lang.Boolean |
isReloadingFromServer() |
boolean |
isResourceNamespaced() |
L |
list() |
L |
list(java.lang.Integer limitVal,
java.lang.String continueVal) |
R |
load(java.io.File file)
Load from a
File . |
R |
load(java.io.InputStream is)
Load from an
InputStream . |
R |
load(java.lang.String path)
Load from path.
|
R |
load(java.net.URL url)
Load from a
URL . |
Replaceable<T,T> |
lockResourceVersion(java.lang.String resourceVersion) |
BaseOperation<T,L,D,R> |
newInstance(OperationContext context) |
T |
patch(T item) |
T |
replace(T item) |
T |
require() |
protected void |
setReaping(boolean reaping) |
protected void |
updateApiVersion(HasMetadata hasMetadata)
Updates the resource if it has missing or default apiGroupVersion values and the resource is currently
using API Groups with custom version strings
|
protected void |
updateApiVersion(KubernetesResourceList list)
Updates the list items if they have missing or default apiGroupVersion values and the resource is currently
using API Groups with custom version strings
|
protected void |
updateApiVersionResource(java.lang.Object resource)
Updates the list or single item if it has a missing or incorrect apiGroupVersion
|
T |
waitUntilCondition(java.util.function.Predicate<T> condition,
long amount,
java.util.concurrent.TimeUnit timeUnit) |
protected T |
waitUntilExists(long amount,
java.util.concurrent.TimeUnit timeUnit) |
T |
waitUntilReady(long amount,
java.util.concurrent.TimeUnit timeUnit) |
Watch |
watch(java.lang.String resourceVersion,
Watcher<T> watcher) |
Watch |
watch(Watcher<T> watcher) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withField(java.lang.String key,
java.lang.String value) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withFields(java.util.Map<java.lang.String,java.lang.String> fields) |
Deletable<java.lang.Boolean> |
withGracePeriod(long gracePeriodSeconds) |
BaseOperation<T,L,D,R> |
withItem(T item) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withLabel(java.lang.String key) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withLabel(java.lang.String key,
java.lang.String value) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withLabelIn(java.lang.String key,
java.lang.String... values) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withLabelNotIn(java.lang.String key,
java.lang.String... values) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withLabels(java.util.Map<java.lang.String,java.lang.String> labels) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withLabelSelector(LabelSelector selector) |
R |
withName(java.lang.String name) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withoutField(java.lang.String key,
java.lang.String value) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withoutFields(java.util.Map<java.lang.String,java.lang.String> fields)
Deprecated.
|
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withoutLabel(java.lang.String key) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withoutLabel(java.lang.String key,
java.lang.String value) |
FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> |
withoutLabels(java.util.Map<java.lang.String,java.lang.String> labels)
Deprecated.
|
Watchable<Watch,Watcher<T>> |
withResourceVersion(java.lang.String resourceVersion) |
assertResponseCode, checkName, checkNamespace, createStatus, createStatus, getAPIGroup, getAPIVersion, getConfig, getName, getNamespace, getNamespacedUrl, getNamespacedUrl, getNamespacedUrl, getResourceUrl, getResourceUrl, getRootUrl, handleCreate, handleDelete, handleDelete, handleGet, handleGet, handlePatch, handleReplace, handleReplace, handleResponse, handleResponse, handleResponse, handleResponse, requestException, requestFailure, unmarshal, unmarshal, unmarshal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getNamespace
protected Reaper reaper
protected java.lang.String apiVersion
protected java.lang.Class<T> type
protected java.lang.Class<L extends KubernetesResourceList> listType
protected BaseOperation(OperationContext ctx)
public BaseOperation<T,L,D,R> newInstance(OperationContext context)
public T get()
public T require() throws ResourceNotFoundException
require
in interface Requirable<T>
ResourceNotFoundException
- if resource is absentpublic T getMandatory()
public RootPaths getRootPaths()
public D edit() throws KubernetesClientException
public R withName(java.lang.String name)
public Replaceable<T,T> lockResourceVersion(java.lang.String resourceVersion)
lockResourceVersion
in interface Lockable<Replaceable<T,T>>
public NonNamespaceOperation<T,L,D,R> inNamespace(java.lang.String namespace)
inNamespace
in interface Namespaceable<NonNamespaceOperation<T,L extends KubernetesResourceList,D extends Doneable<T>,R extends Resource<T,D>>>
public NonNamespaceOperation<T,L,D,R> inAnyNamespace()
inAnyNamespace
in interface AnyNamespaceable<FilterWatchListMultiDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public EditReplacePatchDeletable<T,T,D,java.lang.Boolean> cascading(boolean cascading)
public R load(java.io.InputStream is)
Loadable
InputStream
.public R load(java.lang.String path)
Loadable
public Gettable<T> fromServer()
fromServer
in interface FromServerable<Gettable<T>>
public T create(T... resources) throws KubernetesClientException
create
in interface Createable<T,T,D extends Doneable<T>>
KubernetesClientException
public D createNew() throws KubernetesClientException
createNew
in interface Createable<T,T,D extends Doneable<T>>
KubernetesClientException
public D createOrReplaceWithNew() throws KubernetesClientException
createOrReplaceWithNew
in interface CreateOrReplaceable<T,T,D extends Doneable<T>>
KubernetesClientException
public T createOrReplace(T... items)
createOrReplace
in interface CreateOrReplaceable<T,T,D extends Doneable<T>>
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withLabels(java.util.Map<java.lang.String,java.lang.String> labels)
withLabels
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withLabelSelector(LabelSelector selector)
withLabelSelector
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
@Deprecated public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withoutLabels(java.util.Map<java.lang.String,java.lang.String> labels) throws KubernetesClientException
withoutLabels
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
KubernetesClientException
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withLabelIn(java.lang.String key, java.lang.String... values) throws KubernetesClientException
withLabelIn
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
KubernetesClientException
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withLabelNotIn(java.lang.String key, java.lang.String... values) throws KubernetesClientException
withLabelNotIn
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
KubernetesClientException
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withLabel(java.lang.String key, java.lang.String value)
withLabel
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withLabel(java.lang.String key)
withLabel
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withoutLabel(java.lang.String key, java.lang.String value)
withoutLabel
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withoutLabel(java.lang.String key)
withoutLabel
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withFields(java.util.Map<java.lang.String,java.lang.String> fields)
withFields
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withField(java.lang.String key, java.lang.String value)
withField
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
@Deprecated public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withoutFields(java.util.Map<java.lang.String,java.lang.String> fields) throws KubernetesClientException
withoutFields
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
KubernetesClientException
public FilterWatchListDeletable<T,L,java.lang.Boolean,Watch,Watcher<T>> withoutField(java.lang.String key, java.lang.String value)
withoutField
in interface Filterable<FilterWatchListDeletable<T,L extends KubernetesResourceList,java.lang.Boolean,Watch,Watcher<T>>>
public java.lang.String getLabelQueryParam()
public java.lang.String getFieldQueryParam()
public L list() throws KubernetesClientException
list
in interface Listable<L extends KubernetesResourceList>
KubernetesClientException
public L list(java.lang.Integer limitVal, java.lang.String continueVal) throws KubernetesClientException
list
in interface Listable<L extends KubernetesResourceList>
KubernetesClientException
public java.lang.Boolean delete()
Deletable
public java.lang.Boolean delete(T... items)
delete
in interface MultiDeleteable<T,java.lang.Boolean>
public java.lang.Boolean delete(java.util.List<T> items)
delete
in interface MultiDeleteable<T,java.lang.Boolean>
public Watchable<Watch,Watcher<T>> withResourceVersion(java.lang.String resourceVersion)
withResourceVersion
in interface Versionable<Watchable<Watch,Watcher<T>>>
public Watch watch(Watcher<T> watcher) throws KubernetesClientException
public Watch watch(java.lang.String resourceVersion, Watcher<T> watcher) throws KubernetesClientException
public boolean isResourceNamespaced()
isResourceNamespaced
in class OperationSupport
protected T handleResponse(okhttp3.Request.Builder requestBuilder) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, KubernetesClientException, java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
KubernetesClientException
java.io.IOException
protected T handleCreate(T resource) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, KubernetesClientException, java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
KubernetesClientException
java.io.IOException
protected T handleReplace(T updated) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, KubernetesClientException, java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
KubernetesClientException
java.io.IOException
protected T handlePatch(T current, T updated) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, KubernetesClientException, java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
KubernetesClientException
java.io.IOException
protected T handleGet(java.net.URL resourceUrl) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.io.IOException
public java.lang.Boolean isCascading()
public T getItem()
public java.lang.String getResourceVersion()
@Deprecated public java.lang.Boolean getReloadingFromServer()
public java.lang.Boolean isReloadingFromServer()
public java.lang.Long getGracePeriodSeconds()
public java.lang.String getResourceT()
getResourceT
in class OperationSupport
public java.lang.Class<T> getType()
public java.lang.Class<L> getListType()
public java.lang.Class<D> getDoneableType()
protected boolean isReaping()
protected void setReaping(boolean reaping)
protected java.util.Map<java.lang.String,java.lang.String> getLabels()
protected java.util.Map<java.lang.String,java.lang.String[]> getLabelsNot()
protected java.util.Map<java.lang.String,java.lang.String[]> getLabelsIn()
protected java.util.Map<java.lang.String,java.lang.String[]> getLabelsNotIn()
protected java.util.Map<java.lang.String,java.lang.String> getFields()
protected java.util.Map<java.lang.String,java.lang.String[]> getFieldsNot()
public java.lang.String getKind()
getKind
in interface OperationInfo
public java.lang.String getOperationType()
getOperationType
in interface OperationInfo
public OperationInfo forOperationType(java.lang.String type)
forOperationType
in interface OperationInfo
public Deletable<java.lang.Boolean> withGracePeriod(long gracePeriodSeconds)
withGracePeriod
in interface GracePeriodConfigurable<Deletable<java.lang.Boolean>>
protected java.lang.Class<? extends Config> getConfigType()
protected void updateApiVersionResource(java.lang.Object resource)
resource
- resource objectprotected void updateApiVersion(KubernetesResourceList list)
list
- Kubernetes resource listprotected void updateApiVersion(HasMetadata hasMetadata)
hasMetadata
- object whose api version needs to be updatedpublic java.lang.String getApiVersion()
public boolean isApiGroup()
protected T waitUntilExists(long amount, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException
java.lang.InterruptedException
public T waitUntilReady(long amount, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException
waitUntilReady
in interface Waitable<T,T>
java.lang.InterruptedException
Copyright © 2015-2019 Red Hat. All Rights Reserved.