@ApplicationScoped final class AllDefaultConfigMapsController extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
AllDefaultConfigMapsController.AllDefaultConfigMaps
A qualifier annotation that itself is
qualified with
KubernetesEventSelector allowing it to pair
relevant producer and observer methods so that certain ConfigMap resources can be observed. |
Modifier and Type | Field and Description |
---|---|
private static Logger |
logger
A
Logger for logging messages. |
Modifier | Constructor and Description |
---|---|
private |
AllDefaultConfigMapsController()
Creates a new
AllDefaultConfigMapsController . |
Modifier and Type | Method and Description |
---|---|
private void |
onConfigMapAddition(ConfigMap newConfigMap,
KubernetesClient client)
|
private void |
onConfigMapDeletion(ConfigMap deletedConfigMap,
KubernetesClient client)
|
private void |
onConfigMapModification(ConfigMap modifiedConfigMap,
Optional<ConfigMap> priorConfigMap,
KubernetesClient client)
A Kubernetes event observer method that will be notified
with
ConfigMap "events" that describe the modification of a ConfigMap in a Kubernetes
cluster. |
private static NonNamespaceOperation<ConfigMap,ConfigMapList,DoneableConfigMap,Resource<ConfigMap,DoneableConfigMap>> |
produceAllDefaultConfigMaps(KubernetesClient client)
A producer method which is a Kubernetes
event selector that produces a
NonNamespaceOperation
whose list() and watch(Watcher) methods will eventually
produce events that will be processed by the onConfigMapAddition(ConfigMap, KubernetesClient) Kubernetes
event observer method. |
private static Map<Object,ConfigMap> |
produceKubernetesResourceCache()
A producer method that returns an application-scoped
Map of ConfigMap s indexed by the keys that Kubernetes assigns to them. |
private AllDefaultConfigMapsController()
AllDefaultConfigMapsController
.@Produces @ApplicationScoped @AllDefaultConfigMapsController.AllDefaultConfigMaps private static final NonNamespaceOperation<ConfigMap,ConfigMapList,DoneableConfigMap,Resource<ConfigMap,DoneableConfigMap>> produceAllDefaultConfigMaps(KubernetesClient client)
NonNamespaceOperation
whose list()
and watch(Watcher)
methods will eventually
produce events that will be processed by the onConfigMapAddition(ConfigMap, KubernetesClient)
Kubernetes
event observer method.
This method never returns null
.
client
- a KubernetesClient
injected by the CDI ecosystem;
will not be null
; in this example application it is
supplied to CDI by the microBean Kubernetes Client CDI projectclient.configMaps().inNamespace("default")
; never null
KubernetesClient
,
KubernetesClient.configMaps()
,
Namespaceable.inNamespace(String)
,
onConfigMapAddition(ConfigMap, KubernetesClient)
,
onConfigMapModification(ConfigMap, Optional,
KubernetesClient)
,
onConfigMapDeletion(ConfigMap, KubernetesClient)
private final void onConfigMapAddition(@Observes @AllDefaultConfigMapsController.AllDefaultConfigMaps @Added ConfigMap newConfigMap, KubernetesClient client)
ConfigMap
"events" that
describe the addition of a ConfigMap
to a Kubernetes cluster.
The production of these events is governed and filtered by (in
this application) the recipe manifested by the produceAllDefaultConfigMaps(KubernetesClient)
producer method.
The events that result indirectly from that Kubernetes event
selector method are "linked" with this Kubernetes event observer
method by way of the AllDefaultConfigMapsController.AllDefaultConfigMaps
Kubernetes
event selector annotation.
newConfigMap
- the ConfigMap
that was added; will
not be null
client
- a KubernetesClient
that will be supplied
here by the CDI ecosystem; will not be (and must not be) null
NullPointerException
- if for some reason either newConfigMap
or client
is null
AllDefaultConfigMapsController.AllDefaultConfigMaps
,
produceAllDefaultConfigMaps(KubernetesClient)
,
Added
private final void onConfigMapModification(@Observes @AllDefaultConfigMapsController.AllDefaultConfigMaps @Modified ConfigMap modifiedConfigMap, @Prior Optional<ConfigMap> priorConfigMap, KubernetesClient client)
ConfigMap
"events" that describe the modification of a ConfigMap
in a Kubernetes
cluster.
The production of these events is governed and filtered by (in
this application) the recipe manifested by the produceAllDefaultConfigMaps(KubernetesClient)
producer method.
The events that result indirectly from that Kubernetes event
selector method are "linked" with this Kubernetes event observer
method by way of the AllDefaultConfigMapsController.AllDefaultConfigMaps
Kubernetes
event selector annotation.
modifiedConfigMap
- the ConfigMap
that was modified;
will not be null
priorConfigMap
- an Optional
containing any known
prior state of the ConfigMap
in question; will not be
null
but may be emptyclient
- a KubernetesClient
that will be supplied
here by the CDI ecosystem; will not be (and must not be) null
NullPointerException
- if modifiedConfigMap
or
priorConfigMap
or client
is null
for any
reason; in normal usage they will not beAllDefaultConfigMapsController.AllDefaultConfigMaps
,
produceAllDefaultConfigMaps(KubernetesClient)
,
Modified
,
Prior
private final void onConfigMapDeletion(@Observes @AllDefaultConfigMapsController.AllDefaultConfigMaps @Deleted ConfigMap deletedConfigMap, KubernetesClient client)
ConfigMap
"events" that describe the deletion of a ConfigMap
from a Kubernetes
cluster.
The production of these events is governed and filtered by (in
this application) the recipe manifested by the produceAllDefaultConfigMaps(KubernetesClient)
producer method.
The events that result indirectly from that Kubernetes event
selector method are "linked" with this Kubernetes event observer
method by way of the AllDefaultConfigMapsController.AllDefaultConfigMaps
Kubernetes
event selector annotation.
deletedConfigMap
- the ConfigMap
that was deleted;
will not be null
client
- a KubernetesClient
that will be supplied
here by the CDI ecosystem; will not be (and must not be) null
NullPointerException
- if deletedConfigMap
or or
client
is null
for any reason; in normal usage
they will not beAllDefaultConfigMapsController.AllDefaultConfigMaps
,
produceAllDefaultConfigMaps(KubernetesClient)
,
Deleted
,
Prior
@Produces @ApplicationScoped @AllDefaultConfigMapsController.AllDefaultConfigMaps private static final Map<Object,ConfigMap> produceKubernetesResourceCache()
Map
of ConfigMap
s indexed by the keys that Kubernetes assigns to them.
This method never returns null
.
This method is safe for concurrent use by multiple threads.
The return value that results from invoking this
method is not safe for concurrent use by multiple
threads. Threads must synchronize
on it
appropriately for all retrieval, traversal and mutation
operations.
null
Map
that will be used to house
prior states of Kubernetes resourcesCopyright © 2018–2018, Laird Nelson. All rights reserved.