All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fabric8.kubernetes.client.extension.ResourceAdapter Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2015 Red Hat, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.fabric8.kubernetes.client.extension;

import io.fabric8.kubernetes.api.builder.Visitor;
import io.fabric8.kubernetes.api.model.DeletionPropagation;
import io.fabric8.kubernetes.api.model.ListOptions;
import io.fabric8.kubernetes.api.model.StatusDetails;
import io.fabric8.kubernetes.api.model.autoscaling.v1.Scale;
import io.fabric8.kubernetes.client.GracePeriodConfigurable;
import io.fabric8.kubernetes.client.PropagationPolicyConfigurable;
import io.fabric8.kubernetes.client.ResourceNotFoundException;
import io.fabric8.kubernetes.client.Watch;
import io.fabric8.kubernetes.client.Watcher;
import io.fabric8.kubernetes.client.dsl.Deletable;
import io.fabric8.kubernetes.client.dsl.EditReplacePatchable;
import io.fabric8.kubernetes.client.dsl.Gettable;
import io.fabric8.kubernetes.client.dsl.Informable;
import io.fabric8.kubernetes.client.dsl.NonDeletingOperation;
import io.fabric8.kubernetes.client.dsl.ReplaceDeletable;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.kubernetes.client.dsl.ServerSideApplicable;
import io.fabric8.kubernetes.client.dsl.Watchable;
import io.fabric8.kubernetes.client.dsl.WritableOperation;
import io.fabric8.kubernetes.client.dsl.base.PatchContext;
import io.fabric8.kubernetes.client.informers.ResourceEventHandler;
import io.fabric8.kubernetes.client.informers.SharedIndexInformer;

import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;

/**
 * Base for overriding a Resource
 *
 * @param  the resource type
 */
public class ResourceAdapter implements Resource {

  Resource resource;

  public ResourceAdapter() {

  }

  public ResourceAdapter(Resource resource) {
    this.resource = resource;
  }

  public Resource getResource() {
    return resource;
  }

  @Override
  public List delete() {
    return resource.delete();
  }

  @Override
  public boolean isReady() {
    return resource.isReady();
  }

  @Override
  public T get() {
    return resource.get();
  }

  @Override
  public ReplaceDeletable lockResourceVersion(String resourceVersion) {
    return resource.lockResourceVersion(resourceVersion);
  }

  @Override
  public WritableOperation dryRun() {
    return resource.dryRun();
  }

  @Override
  public Watchable withResourceVersion(String resourceVersion) {
    return resource.withResourceVersion(resourceVersion);
  }

  @Override
  public Gettable fromServer() {
    return resource.fromServer();
  }

  @Override
  public T replaceStatus() {
    return resource.replaceStatus();
  }

  @Override
  public T create() {
    return resource.create();
  }

  @Override
  public PropagationPolicyConfigurable withGracePeriod(long gracePeriodSeconds) {
    return resource.withGracePeriod(gracePeriodSeconds);
  }

  @Override
  public T createOrReplace() {
    return resource.createOrReplace();
  }

  @Override
  public T editStatus(UnaryOperator function) {
    return resource.editStatus(function);
  }

  @Override
  public T require() throws ResourceNotFoundException {
    return resource.require();
  }

  @Override
  public GracePeriodConfigurable withPropagationPolicy(DeletionPropagation propagationPolicy) {
    return resource.withPropagationPolicy(propagationPolicy);
  }

  @Override
  public Watch watch(Watcher watcher) {
    return resource.watch(watcher);
  }

  @Override
  @Deprecated
  public T patch(T item) {
    return resource.patch(item);
  }

  @Override
  public T patchStatus(T item) {
    return resource.patchStatus(item);
  }

  @Override
  public T edit(UnaryOperator function) {
    return resource.edit(function);
  }

  @Override
  public T waitUntilReady(long amount, TimeUnit timeUnit) {
    return resource.waitUntilReady(amount, timeUnit);
  }

  @Override
  public Watch watch(ListOptions options, Watcher watcher) {
    return resource.watch(options, watcher);
  }

  @Override
  public T waitUntilCondition(Predicate condition, long amount, TimeUnit timeUnit) {
    return resource.waitUntilCondition(condition, amount, timeUnit);
  }

  @Override
  public Informable withIndexers(Map>> indexers) {
    return resource.withIndexers(indexers);
  }

  @Override
  public WritableOperation dryRun(boolean isDryRun) {
    return resource.dryRun(isDryRun);
  }

  @Override
  public T edit(Visitor... visitors) {
    return resource.edit(visitors);
  }

  @Override
  public T patch(PatchContext patchContext, T item) {
    return resource.patch(patchContext, item);
  }

  @Override
  public Informable withLimit(Long limit) {
    return resource.withLimit(limit);
  }

  @Override
  public  T edit(Class visitorType, Visitor visitor) {
    return resource.edit(visitorType, visitor);
  }

  @Override
  public Watch watch(String resourceVersion, Watcher watcher) {
    return resource.watch(resourceVersion, watcher);
  }

  @Override
  public T accept(Consumer function) {
    return resource.accept(function);
  }

  @Override
  public SharedIndexInformer inform() {
    return resource.inform();
  }

  @Override
  public T patch(String patch) {
    return resource.patch(patch);
  }

  @Override
  public T patch(PatchContext patchContext, String patch) {
    return resource.patch(patchContext, patch);
  }

  @Override
  public SharedIndexInformer inform(ResourceEventHandler handler) {
    return resource.inform(handler);
  }

  @Override
  public SharedIndexInformer inform(ResourceEventHandler handler, long resync) {
    return resource.inform(handler, resync);
  }

  @Override
  public SharedIndexInformer runnableInformer(long resync) {
    return resource.runnableInformer(resync);
  }

  @Override
  public CompletableFuture> informOnCondition(Predicate> condition) {
    return resource.informOnCondition(condition);
  }

  @Override
  public T replace() {
    return resource.replace();
  }

  @Override
  public T create(T item) {
    return resource.create(item);
  }

  @Override
  public T replace(T item) {
    return resource.replace(item);
  }

  @Override
  public T createOrReplace(T item) {
    return resource.createOrReplace(item);
  }

  @Override
  public T replaceStatus(T item) {
    return resource.replaceStatus(item);
  }

  @Override
  public List delete(T item) {
    return resource.delete(item);
  }

  @Override
  public T updateStatus(T item) {
    return resource.updateStatus(item);
  }

  @Override
  public ReplaceDeletable lockResourceVersion() {
    return resource.lockResourceVersion();
  }

  @Override
  public T patchStatus() {
    return resource.patchStatus();
  }

  @Override
  public T patch() {
    return resource.patch();
  }

  @Override
  public T patch(PatchContext patchContext) {
    return resource.patch(patchContext);
  }

  @Override
  public NonDeletingOperation fieldValidation(Validation fieldValidation) {
    return resource.fieldValidation(fieldValidation);
  }

  @Override
  public ServerSideApplicable fieldManager(String manager) {
    return resource.fieldManager(manager);
  }

  @Override
  public ServerSideApplicable forceConflicts() {
    return resource.forceConflicts();
  }

  @Override
  public T serverSideApply() {
    return resource.serverSideApply();
  }

  @Override
  public T item() {
    return resource.item();
  }

  @Override
  public Deletable withTimeout(long timeout, TimeUnit unit) {
    return resource.withTimeout(timeout, unit);
  }

  @Override
  public Deletable withTimeoutInMillis(long timeoutInMillis) {
    return withTimeout(timeoutInMillis, TimeUnit.MILLISECONDS);
  }

  @Override
  public T update() {
    return resource.update();
  }

  @Override
  public T updateStatus() {
    return resource.updateStatus();
  }

  @Override
  public Scale scale() {
    return resource.scale();
  }

  @Override
  public T scale(int count) {
    return resource.scale(count);
  }

  @Override
  public T scale(int count, boolean wait) {
    return resource.scale(count, wait);
  }

  @Override
  public Scale scale(Scale scale) {
    return resource.scale(scale);
  }

  @Override
  public T createOr(Function, T> conflictAction) {
    return resource.createOr(conflictAction);
  }

  @Override
  public NonDeletingOperation unlock() {
    return resource.unlock();
  }

  @Override
  public EditReplacePatchable subresource(String subresource) {
    return resource.subresource(subresource);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy