001/* 002 * VM-Operator 003 * Copyright (C) 2024 Michael N. Lipp 004 * 005 * This program is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU Affero General Public License as 007 * published by the Free Software Foundation, either version 3 of the 008 * License, or (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU Affero General Public License for more details. 014 * 015 * You should have received a copy of the GNU Affero General Public License 016 * along with this program. If not, see <https://www.gnu.org/licenses/>. 017 */ 018 019package org.jdrupes.vmoperator.common; 020 021import io.kubernetes.client.Discovery.APIResource; 022 023/** 024 * A stub for namespaced custom objects. It uses a dynamic model 025 * (see {@link K8sDynamicModel}) for representing the object's 026 * state and can therefore be used for any kind of object, especially 027 * custom objects. 028 */ 029public abstract class K8sDynamicStubBase<O extends K8sDynamicModel, 030 L extends K8sDynamicModelsBase<O>> extends K8sGenericStub<O, L> { 031 032 /** 033 * Instantiates a new dynamic stub. 034 * 035 * @param objectClass the object class 036 * @param objectListClass the object list class 037 * @param client the client 038 * @param context the context 039 * @param namespace the namespace 040 * @param name the name 041 */ 042 public K8sDynamicStubBase(Class<O> objectClass, 043 Class<L> objectListClass, DynamicTypeAdapterFactory<O, L> taf, 044 K8sClient client, APIResource context, String namespace, 045 String name) { 046 super(objectClass, objectListClass, client, context, namespace, name); 047 taf.register(client); 048 } 049}