Package org.jdrupes.vmoperator.manager
Class DisplaySecretMonitor
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.manager.AbstractMonitor<io.kubernetes.client.openapi.models.V1Secret,io.kubernetes.client.openapi.models.V1SecretList,VmChannel>
org.jdrupes.vmoperator.manager.DisplaySecretMonitor
- All Implemented Interfaces:
Iterable<ComponentType>
,Channel
,ComponentType
,Eligible
,Manager
public class DisplaySecretMonitor
extends AbstractMonitor<io.kubernetes.client.openapi.models.V1Secret,io.kubernetes.client.openapi.models.V1SecretList,VmChannel>
Watches for changes of display secrets.
The component supports the following configuration properties:
passwordValidity
: the validity of the random password in seconds. Used to calculate the password expiry time in the generated secret.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDisplaySecretMonitor
(Channel componentChannel, ChannelDictionary<String, VmChannel, ?> channelDictionary) Instantiates a new display secrets monitor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
handleChange
(K8sClient client, io.kubernetes.client.util.Watch.Response<io.kubernetes.client.openapi.models.V1Secret> change) Handle an observed change.void
On configuration update.void
onGetDisplaySecrets
(GetDisplayPassword event, VmChannel channel) On get display secrets.void
onVmDefChanged
(VmDefChanged event, Channel channel) On vm def changed.protected void
Invoked byAbstractMonitor.onStart(Start)
after the namespace has been configured and before starting the observer.Methods inherited from class org.jdrupes.vmoperator.manager.AbstractMonitor
client, client, context, context, namespace, namespace, onStart, options, options
Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setName
Methods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DisplaySecretMonitor
public DisplaySecretMonitor(Channel componentChannel, ChannelDictionary<String, VmChannel, ?> channelDictionary) Instantiates a new display secrets monitor.- Parameters:
componentChannel
- the component channelchannelDictionary
- the channel dictionary
-
-
Method Details
-
onConfigurationUpdate
On configuration update.- Overrides:
onConfigurationUpdate
in classAbstractMonitor<io.kubernetes.client.openapi.models.V1Secret,
io.kubernetes.client.openapi.models.V1SecretList, VmChannel> - Parameters:
event
- the event
-
prepareMonitoring
Description copied from class:AbstractMonitor
Invoked byAbstractMonitor.onStart(Start)
after the namespace has been configured and before starting the observer.This is the last opportunity to invoke
AbstractMonitor.context(APIResource)
.- Overrides:
prepareMonitoring
in classAbstractMonitor<io.kubernetes.client.openapi.models.V1Secret,
io.kubernetes.client.openapi.models.V1SecretList, VmChannel> - Throws:
IOException
- Signals that an I/O exception has occurred.io.kubernetes.client.openapi.ApiException
- the api exception
-
handleChange
protected void handleChange(K8sClient client, io.kubernetes.client.util.Watch.Response<io.kubernetes.client.openapi.models.V1Secret> change) Description copied from class:AbstractMonitor
Handle an observed change.- Specified by:
handleChange
in classAbstractMonitor<io.kubernetes.client.openapi.models.V1Secret,
io.kubernetes.client.openapi.models.V1SecretList, VmChannel> - Parameters:
client
- the clientchange
- the change
-
onGetDisplaySecrets
@Handler public void onGetDisplaySecrets(GetDisplayPassword event, VmChannel channel) throws io.kubernetes.client.openapi.ApiException On get display secrets.- Parameters:
event
- the eventchannel
- the channel- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception
-
onVmDefChanged
On vm def changed.- Parameters:
event
- the eventchannel
- the channel
-