public class ModelMapper extends Object
Modifier and Type | Field and Description |
---|---|
static Duration |
DEFAULT_DISCOVERY_REFRESH_INTERVAL |
Constructor and Description |
---|
ModelMapper() |
Modifier and Type | Method and Description |
---|---|
static void |
addModelMap(String apiGroupVersion,
String kind,
Class<?> clazz)
Deprecated.
|
static void |
addModelMap(String group,
String version,
String kind,
Class<?> clazz)
Deprecated.
|
static void |
addModelMap(String group,
String version,
String kind,
String resourceNamePlural,
Boolean isNamespacedResource,
Class<?> clazz)
Registering concrete model classes by its group, version, kind and isNamespaced (e.g.
|
static void |
addModelMap(String group,
String version,
String kind,
String resourceNamePlural,
Class<?> clazz)
Registering concrete model classes by its group, version and kind (e.g.
|
static Class<?> |
getApiTypeClass(String apiGroupVersion,
String kind)
Gets the model classes by given apiGroupVersion (e.g.
|
static Class<?> |
getApiTypeClass(String group,
String version,
String kind)
Gets the model classes by given group, version and kind (e.g.
|
static GroupVersionKind |
getGroupVersionKindByClass(Class<?> clazz)
Gets the GVK by the given model class.
|
static GroupVersionResource |
getGroupVersionResourceByClass(Class<?> clazz)
Gets the GVK by the given model class.
|
static boolean |
isApiDiscoveryRefreshed() |
static Boolean |
isNamespaced(Class<?> clazz)
Checks whether the class is connected with a namespaced kubernetes resource.
|
static Class<?> |
preBuiltGetApiTypeClass(String group,
String version,
String kind) |
static GroupVersionKind |
preBuiltGetGroupVersionKindByClass(Class<?> clazz) |
static Set<Discovery.APIResource> |
refresh(Discovery discovery)
Refreshes the model mapping by syncing up w/the api discovery info from the kubernetes
apiserver.
|
static Set<Discovery.APIResource> |
refresh(Discovery discovery,
Duration refreshInterval)
Refreshes the model mapping by syncing up w/the api discovery info from the kubernetes
apiserver.
|
public static final Duration DEFAULT_DISCOVERY_REFRESH_INTERVAL
@Deprecated public static void addModelMap(String apiGroupVersion, String kind, Class<?> clazz)
Note that the the so-called apiGroupVersion equals to the "apiVersion" in the kubenretes resource yamls.
@Deprecated public static void addModelMap(String group, String version, String kind, Class<?> clazz)
group
- the groupversion
- the versionkind
- the kindclazz
- the clazzpublic static void addModelMap(String group, String version, String kind, String resourceNamePlural, Class<?> clazz)
group
- the groupversion
- the versionkind
- the kindresourceNamePlural
- the resource name pluralclazz
- the clazzpublic static void addModelMap(String group, String version, String kind, String resourceNamePlural, Boolean isNamespacedResource, Class<?> clazz)
group
- the groupversion
- the versionkind
- the kindresourceNamePlural
- the resource name pluralisNamespacedResource
- the is namespaced resourceclazz
- the clazzpublic static Class<?> getApiTypeClass(String apiGroupVersion, String kind)
apiGroupVersion
- the api versionkind
- the kindpublic static Class<?> getApiTypeClass(String group, String version, String kind)
group
- the groupversion
- the versionkind
- the kindpublic static GroupVersionKind getGroupVersionKindByClass(Class<?> clazz)
clazz
- the clazzpublic static GroupVersionResource getGroupVersionResourceByClass(Class<?> clazz)
clazz
- the clazzpublic static Set<Discovery.APIResource> refresh(Discovery discovery) throws io.kubernetes.client.openapi.ApiException
DEFAULT_DISCOVERY_REFRESH_INTERVAL
.discovery
- the discoveryio.kubernetes.client.openapi.ApiException
- the api exceptionpublic static Set<Discovery.APIResource> refresh(Discovery discovery, Duration refreshInterval) throws io.kubernetes.client.openapi.ApiException
Note: if model mappings can be incomplete if this method is never called.
discovery
- the discoveryio.kubernetes.client.openapi.ApiException
- the api exceptionpublic static boolean isApiDiscoveryRefreshed()
public static Class<?> preBuiltGetApiTypeClass(String group, String version, String kind)
public static GroupVersionKind preBuiltGetGroupVersionKindByClass(Class<?> clazz)
Copyright © 2021. All rights reserved.