Class EventUtils


  • public class EventUtils
    extends java.lang.Object
    The util to generate an event for the target resource. It is copied from https://github.com/EnMasseProject/enmasse/blob/master/k8s-api/src/main/java/io/enmasse/k8s/api/KubeEventLogger.java
    • Constructor Summary

      Constructors 
      Constructor Description
      EventUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean createIfNotExists​(io.fabric8.kubernetes.client.KubernetesClient client, io.fabric8.kubernetes.api.model.HasMetadata target, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.util.function.Consumer<io.fabric8.kubernetes.api.model.Event> eventListener, java.lang.String messageKey)  
      static boolean createOrUpdateEventWithInterval​(io.fabric8.kubernetes.client.KubernetesClient client, io.fabric8.kubernetes.api.model.HasMetadata target, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.util.function.Consumer<io.fabric8.kubernetes.api.model.Event> eventListener, java.lang.String messageKey, java.time.Duration interval)  
      static boolean createOrUpdateEventWithLabels​(io.fabric8.kubernetes.client.KubernetesClient client, io.fabric8.kubernetes.api.model.HasMetadata target, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.util.function.Consumer<io.fabric8.kubernetes.api.model.Event> eventListener, java.lang.String messageKey, java.time.Duration interval, java.util.function.Predicate<java.util.Map<java.lang.String,​java.lang.String>> dedupePredicate, java.util.Map<java.lang.String,​java.lang.String> labels)  
      static io.fabric8.kubernetes.api.model.Event findExistingEvent​(io.fabric8.kubernetes.client.KubernetesClient client, io.fabric8.kubernetes.api.model.HasMetadata target, java.lang.String eventName)  
      static java.lang.String generateEventName​(io.fabric8.kubernetes.api.model.HasMetadata target, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventUtils

        public EventUtils()
    • Method Detail

      • generateEventName

        public static java.lang.String generateEventName​(io.fabric8.kubernetes.api.model.HasMetadata target,
                                                         EventRecorder.Type type,
                                                         java.lang.String reason,
                                                         java.lang.String message,
                                                         EventRecorder.Component component)
      • createOrUpdateEventWithInterval

        public static boolean createOrUpdateEventWithInterval​(io.fabric8.kubernetes.client.KubernetesClient client,
                                                              io.fabric8.kubernetes.api.model.HasMetadata target,
                                                              EventRecorder.Type type,
                                                              java.lang.String reason,
                                                              java.lang.String message,
                                                              EventRecorder.Component component,
                                                              java.util.function.Consumer<io.fabric8.kubernetes.api.model.Event> eventListener,
                                                              @Nullable
                                                              java.lang.String messageKey,
                                                              @Nullable
                                                              java.time.Duration interval)
      • findExistingEvent

        public static io.fabric8.kubernetes.api.model.Event findExistingEvent​(io.fabric8.kubernetes.client.KubernetesClient client,
                                                                              io.fabric8.kubernetes.api.model.HasMetadata target,
                                                                              java.lang.String eventName)
      • createIfNotExists

        public static boolean createIfNotExists​(io.fabric8.kubernetes.client.KubernetesClient client,
                                                io.fabric8.kubernetes.api.model.HasMetadata target,
                                                EventRecorder.Type type,
                                                java.lang.String reason,
                                                java.lang.String message,
                                                EventRecorder.Component component,
                                                java.util.function.Consumer<io.fabric8.kubernetes.api.model.Event> eventListener,
                                                @Nullable
                                                java.lang.String messageKey)
      • createOrUpdateEventWithLabels

        public static boolean createOrUpdateEventWithLabels​(io.fabric8.kubernetes.client.KubernetesClient client,
                                                            io.fabric8.kubernetes.api.model.HasMetadata target,
                                                            EventRecorder.Type type,
                                                            java.lang.String reason,
                                                            java.lang.String message,
                                                            EventRecorder.Component component,
                                                            java.util.function.Consumer<io.fabric8.kubernetes.api.model.Event> eventListener,
                                                            @Nullable
                                                            java.lang.String messageKey,
                                                            @Nullable
                                                            java.time.Duration interval,
                                                            @Nullable
                                                            java.util.function.Predicate<java.util.Map<java.lang.String,​java.lang.String>> dedupePredicate,
                                                            @Nullable
                                                            java.util.Map<java.lang.String,​java.lang.String> labels)