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 Clientclientprotected 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()TgetItem()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 toSharedIndexInformers 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:
lockResourceVersionin interfaceExtensibleResource<T>- Specified by:
lockResourceVersionin interfaceResource<T>- Overrides:
lockResourceVersionin classResourceAdapter<T>
-
withResourceVersion
public ExtensibleResource<T> withResourceVersion(String resourceVersion)
- Specified by:
withResourceVersionin interfaceExtensibleResource<T>- Specified by:
withResourceVersionin interfaceWatchAndWaitable<T>- Overrides:
withResourceVersionin classResourceAdapter<T>
-
fromServer
public ExtensibleResource<T> fromServer()
- Specified by:
fromServerin interfaceExtensibleResource<T>- Specified by:
fromServerin interfaceFromServerGettable<T>- Overrides:
fromServerin classResourceAdapter<T>
-
withGracePeriod
public ExtensibleResource<T> withGracePeriod(long gracePeriodSeconds)
Description copied from interface:GracePeriodConfigurableThe 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:
withGracePeriodin interfaceExtensibleResource<T>- Specified by:
withGracePeriodin interfaceGracePeriodConfigurable<T>- Overrides:
withGracePeriodin 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:PropagationPolicyConfigurableWhether 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:
withPropagationPolicyin interfaceExtensibleResource<T>- Specified by:
withPropagationPolicyin interfacePropagationPolicyConfigurable<T>- Overrides:
withPropagationPolicyin 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:InformableThe indexers to add toSharedIndexInformers created by subsequent inform calls;- Specified by:
withIndexersin interfaceExtensibleResource<T>- Specified by:
withIndexersin interfaceInformable<T>- Overrides:
withIndexersin classResourceAdapter<T>- Parameters:
indexers- to customize the indexing- Returns:
- the current
Informable
-
dryRun
public ExtensibleResource<T> dryRun(boolean isDryRun)
Description copied from interface:DryRunableIndicates 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:
dryRunin interfaceDryRunable<T>- Specified by:
dryRunin interfaceExtensibleResource<T>- Overrides:
dryRunin 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:InformableSet 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:
withLimitin interfaceExtensibleResource<T>- Specified by:
withLimitin interfaceInformable<T>- Overrides:
withLimitin 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:ExtensibleResourceShould be used to obtain a client in the same write context as the given resource - dryRun, DeletionPropagation, etc.- Specified by:
inWriteContextin interfaceExtensibleResource<T>- Parameters:
clazz- client type- Returns:
- the client in the write context
-
lockResourceVersion
public ExtensibleResource<T> lockResourceVersion()
- Specified by:
lockResourceVersionin interfaceExtensibleResource<T>- Specified by:
lockResourceVersionin interfaceResource<T>- Overrides:
lockResourceVersionin classResourceAdapter<T>
-
getItem
public T getItem()
Description copied from interface:ExtensibleResourceReturn the current item, which may be null if the resource was created usingNameable.withName(String)- Specified by:
getItemin interfaceExtensibleResource<T>- Returns:
- the item
-
fieldValidation
public ExtensibleResource<T> fieldValidation(FieldValidateable.Validation fieldValidation)
Description copied from interface:FieldValidateableInstructs 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:
fieldValidationin interfaceExtensibleResource<T>- Specified by:
fieldValidationin interfaceFieldValidateable<T>- Overrides:
fieldValidationin classResourceAdapter<T>- Returns:
- write operations where field validation is applicable.
-
fieldManager
public ExtensibleResource<T> fieldManager(String manager)
Description copied from interface:ServerSideApplicableFieldManager 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:
fieldManagerin interfaceExtensibleResource<T>- Specified by:
fieldManagerin interfaceServerSideApplicable<T>- Overrides:
fieldManagerin classResourceAdapter<T>- Returns:
ServerSideApplicablefor continued operations
-
forceConflicts
public ExtensibleResource<T> forceConflicts()
Description copied from interface:ServerSideApplicableForce this request / fieldManager to take ownership over conflicting fields.- Specified by:
forceConflictsin interfaceExtensibleResource<T>- Specified by:
forceConflictsin interfaceServerSideApplicable<T>- Overrides:
forceConflictsin classResourceAdapter<T>- Returns:
ServerSideApplicablefor continued operations
-
withTimeout
public ExtensibleResource<T> withTimeout(long timeout, TimeUnit unit)
Description copied from interface:DeletablePerform the delete operation as blocking, waiting for finalizers, for up to the given timeout- Specified by:
withTimeoutin interfaceDeletable- Specified by:
withTimeoutin interfaceExtensibleResource<T>- Specified by:
withTimeoutin interfaceTimeoutable- Specified by:
withTimeoutin interfaceTimeoutableScalable<T>- Overrides:
withTimeoutin classResourceAdapter<T>- Parameters:
timeout- 0 indicates no wait
-
withTimeoutInMillis
public ExtensibleResource<T> withTimeoutInMillis(long timeoutInMillis)
Description copied from interface:DeletablePerform the delete operation as blocking, waiting for finalizers, for up to the given timeout- Specified by:
withTimeoutInMillisin interfaceDeletable- Specified by:
withTimeoutInMillisin interfaceExtensibleResource<T>- Specified by:
withTimeoutInMillisin interfaceTimeoutable- Specified by:
withTimeoutInMillisin interfaceTimeoutableScalable<T>- Overrides:
withTimeoutInMillisin classResourceAdapter<T>- Parameters:
timeoutInMillis- 0 indicates no wait
-
unlock
public ExtensibleResource<T> unlock()
Description copied from interface:NonDeletingOperationRemoves 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:
unlockin interfaceExtensibleResource<T>- Specified by:
unlockin interfaceNonDeletingOperation<T>- Overrides:
unlockin classResourceAdapter<T>- Returns:
- NonDeletingOperation that may act on the unlocked item
-
subresource
public ExtensibleResource<T> subresource(String subresource)
Description copied from interface:NonDeletingOperationProvides edit, patch, and replace methods for the given subresource- Specified by:
subresourcein interfaceExtensibleResource<T>- Specified by:
subresourcein interfaceNonDeletingOperation<T>- Overrides:
subresourcein classResourceAdapter<T>
-
-