Class ExtensibleResourceAdapter<T>
- java.lang.Object
-
- io.fabric8.kubernetes.client.extension.ResourceAdapter<T>
-
- io.fabric8.kubernetes.client.extension.ExtensibleResourceAdapter<T>
-
- Type Parameters:
T
- the resource type
- All Implemented Interfaces:
CreateOrReplaceable<T>
,Deletable
,DeletableWithOptions
,DryRunable<WritableOperation<T>>
,EditReplacePatchable<T>
,FieldValidateable<NonDeletingOperation<T>>
,Gettable<T>
,Informable<T>
,ItemReplacable<T>
,ItemWritableOperation<T>
,NonDeletingOperation<T>
,Replaceable<T>
,ReplaceDeletable<T>
,Resource<T>
,Scalable<T>
,ServerSideApplicable<T>
,Timeoutable
,TimeoutableScalable<T>
,Updatable<T>
,Waitable<T,T>
,Watchable<T>
,WatchAndWaitable<T>
,WritableOperation<T>
,ExtensibleResource<T>
,FromServerGettable<T>
,GracePeriodConfigurable<PropagationPolicyConfigurable<? extends Deletable>>
,PropagationPolicyConfigurable<GracePeriodConfigurable<? extends Deletable>>
public abstract class ExtensibleResourceAdapter<T> extends ResourceAdapter<T> implements ExtensibleResource<T>
To be used as a base for overriding or adding Resource methods
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.fabric8.kubernetes.client.dsl.FieldValidateable
FieldValidateable.Validation
-
-
Field Summary
Fields Modifier and Type Field Description protected Client
client
protected ExtensibleResource<T>
resource
-
Constructor Summary
Constructors Constructor Description ExtensibleResourceAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ExtensibleResource<T>
dryRun(boolean isDryRun)
Indicates whether modifications should not be persisted or not.ExtensibleResource<T>
fieldManager(String manager)
FieldManager is a name associated with the actor or entity that is making these changes.ExtensibleResource<T>
fieldValidation(FieldValidateable.Validation fieldValidation)
Instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled.ExtensibleResource<T>
forceConflicts()
Force this request / fieldManager to take ownership over conflicting fields.ExtensibleResource<T>
fromServer()
T
getItem()
Return the current item, which may be null if the resource was created usingNameable.withName(String)
ExtensibleResourceAdapter<T>
init(ExtensibleResource<T> resource, Client client)
<C extends Client>
CinWriteContext(Class<C> clazz)
Should be used to obtain a client in the same write context as the given resource - dryRun, DeletionPropagation, etc.ExtensibleResource<T>
lockResourceVersion()
ExtensibleResource<T>
lockResourceVersion(String resourceVersion)
abstract ExtensibleResourceAdapter<T>
newInstance()
ExtensibleResource<T>
subresource(String subresource)
Provides edit, patch, and replace methods for the given subresourceExtensibleResource<T>
unlock()
Removes the resource version from the current item.ExtensibleResource<T>
withGracePeriod(long gracePeriodSeconds)
The duration in seconds before the object should be deleted.ExtensibleResource<T>
withIndexers(Map<String,Function<T,List<String>>> indexers)
The indexers to add toSharedIndexInformer
s created by subsequent inform calls;ExtensibleResource<T>
withLimit(Long limit)
Set the limit to the number of resources to list at one time.ExtensibleResource<T>
withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
Whether and how garbage collection will be performed.ExtensibleResource<T>
withResourceVersion(String resourceVersion)
ExtensibleResource<T>
withTimeout(long timeout, TimeUnit unit)
Perform the delete operation as blocking, waiting for finalizers, for up to the given timeoutExtensibleResource<T>
withTimeoutInMillis(long timeoutInMillis)
Perform the delete operation as blocking, waiting for finalizers, for up to the given timeout-
Methods inherited from class io.fabric8.kubernetes.client.extension.ResourceAdapter
accept, create, create, createOr, createOrReplace, createOrReplace, delete, delete, dryRun, edit, edit, edit, editStatus, get, getResource, inform, inform, inform, informOnCondition, isReady, item, patch, patch, patch, patch, patch, patch, patchStatus, patchStatus, replace, replace, replaceStatus, replaceStatus, require, runnableInformer, scale, scale, scale, scale, serverSideApply, update, updateStatus, updateStatus, waitUntilCondition, waitUntilReady, watch, watch, watch
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.CreateOrReplaceable
create, createOrReplace
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.DryRunable
dryRun
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.EditReplacePatchable
accept, edit, edit, edit, patch, patch, patch, patch, patch, patch
-
Methods inherited from interface io.fabric8.kubernetes.client.extension.ExtensibleResource
scale
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.Informable
inform, inform, inform, informOnCondition, runnableInformer
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.ItemReplacable
replace, replaceStatus
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.ItemWritableOperation
create, createOrReplace, delete, patchStatus, updateStatus
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.NonDeletingOperation
createOr, editStatus, patchStatus
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.Replaceable
replaceStatus, updateStatus
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.Resource
cascading, isReady, item, require
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.ServerSideApplicable
serverSideApply
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.Waitable
waitUntilCondition, waitUntilReady
-
-
-
-
Field Detail
-
resource
protected ExtensibleResource<T> resource
-
client
protected Client client
-
-
Method Detail
-
newInstance
public abstract ExtensibleResourceAdapter<T> newInstance()
-
init
public ExtensibleResourceAdapter<T> init(ExtensibleResource<T> resource, Client client)
-
lockResourceVersion
public ExtensibleResource<T> lockResourceVersion(String resourceVersion)
- Specified by:
lockResourceVersion
in interfaceExtensibleResource<T>
- Specified by:
lockResourceVersion
in interfaceResource<T>
- Overrides:
lockResourceVersion
in classResourceAdapter<T>
-
withResourceVersion
public ExtensibleResource<T> withResourceVersion(String resourceVersion)
- Specified by:
withResourceVersion
in interfaceExtensibleResource<T>
- Specified by:
withResourceVersion
in interfaceWatchAndWaitable<T>
- Overrides:
withResourceVersion
in classResourceAdapter<T>
-
fromServer
public ExtensibleResource<T> fromServer()
- Specified by:
fromServer
in interfaceExtensibleResource<T>
- Specified by:
fromServer
in interfaceFromServerGettable<T>
- Overrides:
fromServer
in classResourceAdapter<T>
-
withGracePeriod
public ExtensibleResource<T> withGracePeriod(long gracePeriodSeconds)
Description copied from interface:GracePeriodConfigurable
The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.- Specified by:
withGracePeriod
in interfaceExtensibleResource<T>
- Specified by:
withGracePeriod
in interfaceGracePeriodConfigurable<T>
- Overrides:
withGracePeriod
in classResourceAdapter<T>
- Parameters:
gracePeriodSeconds
- grace period integer value in seconds- Returns:
- the object for which grace period is configured
-
withPropagationPolicy
public ExtensibleResource<T> withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
Description copied from interface:PropagationPolicyConfigurable
Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both.The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
Acceptable values are:
'Orphan' - orphan the dependents;
'Background' - allow the garbage collector to delete the dependents in the background;
'Foreground' - a cascading policy that deletes all dependents in the foreground.- Specified by:
withPropagationPolicy
in interfaceExtensibleResource<T>
- Specified by:
withPropagationPolicy
in interfacePropagationPolicyConfigurable<T>
- Overrides:
withPropagationPolicy
in classResourceAdapter<T>
- Parameters:
propagationPolicy
- propagation policy in form of stringDeletionPropagation
- Returns:
- resource
-
withIndexers
public ExtensibleResource<T> withIndexers(Map<String,Function<T,List<String>>> indexers)
Description copied from interface:Informable
The indexers to add toSharedIndexInformer
s created by subsequent inform calls;- Specified by:
withIndexers
in interfaceExtensibleResource<T>
- Specified by:
withIndexers
in interfaceInformable<T>
- Overrides:
withIndexers
in classResourceAdapter<T>
- Parameters:
indexers
- to customize the indexing- Returns:
- the current
Informable
-
dryRun
public ExtensibleResource<T> dryRun(boolean isDryRun)
Description copied from interface:DryRunable
Indicates whether modifications should not be persisted or not. If enabled, All dry run stages will be processed. the request is still processed as typical request: the fields are defaulted, the object is validated, it goes through the validation admission chain, and through the mutating admission chain, and then the final object is returned to the user as it normally would, without being persisted.- Specified by:
dryRun
in interfaceDryRunable<T>
- Specified by:
dryRun
in interfaceExtensibleResource<T>
- Overrides:
dryRun
in classResourceAdapter<T>
- Parameters:
isDryRun
- whether dry run is enabled or disabled- Returns:
- write operations which are applicable for dry run
-
withLimit
public ExtensibleResource<T> withLimit(Long limit)
Description copied from interface:Informable
Set the limit to the number of resources to list at one time. This means that longer lists will take multiple requests to fetch.If the list fails to complete it will be re-attempted with this limit, rather than falling back to the full list. You should ensure that your handlers are either async or fast acting to prevent long delays in list processing that may cause results to expire before reaching the end of the list.
WARNING As noted in the go client: "paginated lists are always served directly from etcd, which is significantly less efficient and may lead to serious performance and scalability problems."
- Specified by:
withLimit
in interfaceExtensibleResource<T>
- Specified by:
withLimit
in interfaceInformable<T>
- Overrides:
withLimit
in classResourceAdapter<T>
- Parameters:
limit
- of a items in a list fetch- Returns:
- the current
Informable
-
inWriteContext
public <C extends Client> C inWriteContext(Class<C> clazz)
Description copied from interface:ExtensibleResource
Should be used to obtain a client in the same write context as the given resource - dryRun, DeletionPropagation, etc.- Specified by:
inWriteContext
in interfaceExtensibleResource<T>
- Parameters:
clazz
- client type- Returns:
- the client in the write context
-
lockResourceVersion
public ExtensibleResource<T> lockResourceVersion()
- Specified by:
lockResourceVersion
in interfaceExtensibleResource<T>
- Specified by:
lockResourceVersion
in interfaceResource<T>
- Overrides:
lockResourceVersion
in classResourceAdapter<T>
-
getItem
public T getItem()
Description copied from interface:ExtensibleResource
Return the current item, which may be null if the resource was created usingNameable.withName(String)
- Specified by:
getItem
in interfaceExtensibleResource<T>
- Returns:
- the item
-
fieldValidation
public ExtensibleResource<T> fieldValidation(FieldValidateable.Validation fieldValidation)
Description copied from interface:FieldValidateable
Instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled.- Specified by:
fieldValidation
in interfaceExtensibleResource<T>
- Specified by:
fieldValidation
in interfaceFieldValidateable<T>
- Overrides:
fieldValidation
in classResourceAdapter<T>
- Returns:
- write operations where field validation is applicable.
-
fieldManager
public ExtensibleResource<T> fieldManager(String manager)
Description copied from interface:ServerSideApplicable
FieldManager is a name associated with the actor or entity that is making these changes.The value must be less than or 128 characters long, and only contain printable characters
the default value is "fabric8"
- Specified by:
fieldManager
in interfaceExtensibleResource<T>
- Specified by:
fieldManager
in interfaceServerSideApplicable<T>
- Overrides:
fieldManager
in classResourceAdapter<T>
- Returns:
ServerSideApplicable
for continued operations
-
forceConflicts
public ExtensibleResource<T> forceConflicts()
Description copied from interface:ServerSideApplicable
Force this request / fieldManager to take ownership over conflicting fields.- Specified by:
forceConflicts
in interfaceExtensibleResource<T>
- Specified by:
forceConflicts
in interfaceServerSideApplicable<T>
- Overrides:
forceConflicts
in classResourceAdapter<T>
- Returns:
ServerSideApplicable
for continued operations
-
withTimeout
public ExtensibleResource<T> withTimeout(long timeout, TimeUnit unit)
Description copied from interface:Deletable
Perform the delete operation as blocking, waiting for finalizers, for up to the given timeout- Specified by:
withTimeout
in interfaceDeletable
- Specified by:
withTimeout
in interfaceExtensibleResource<T>
- Specified by:
withTimeout
in interfaceTimeoutable
- Specified by:
withTimeout
in interfaceTimeoutableScalable<T>
- Overrides:
withTimeout
in classResourceAdapter<T>
- Parameters:
timeout
- 0 indicates no wait
-
withTimeoutInMillis
public ExtensibleResource<T> withTimeoutInMillis(long timeoutInMillis)
Description copied from interface:Deletable
Perform the delete operation as blocking, waiting for finalizers, for up to the given timeout- Specified by:
withTimeoutInMillis
in interfaceDeletable
- Specified by:
withTimeoutInMillis
in interfaceExtensibleResource<T>
- Specified by:
withTimeoutInMillis
in interfaceTimeoutable
- Specified by:
withTimeoutInMillis
in interfaceTimeoutableScalable<T>
- Overrides:
withTimeoutInMillis
in classResourceAdapter<T>
- Parameters:
timeoutInMillis
- 0 indicates no wait
-
unlock
public ExtensibleResource<T> unlock()
Description copied from interface:NonDeletingOperation
Removes the resource version from the current item. If the operation context was created by name, and without an item, this will fetch the item from the api server first.- Specified by:
unlock
in interfaceExtensibleResource<T>
- Specified by:
unlock
in interfaceNonDeletingOperation<T>
- Overrides:
unlock
in classResourceAdapter<T>
- Returns:
- NonDeletingOperation that may act on the unlocked item
-
subresource
public ExtensibleResource<T> subresource(String subresource)
Description copied from interface:NonDeletingOperation
Provides edit, patch, and replace methods for the given subresource- Specified by:
subresource
in interfaceExtensibleResource<T>
- Specified by:
subresource
in interfaceNonDeletingOperation<T>
- Overrides:
subresource
in classResourceAdapter<T>
-
-