T - a type of Kubernetes resourcepublic interface EventCache<T extends HasMetadata>
Events representing Kubernetes resources.
Instances of implementations of this interface must be
safe for concurrent usage by multiple Threads.
Event,
EventQueueCollection| Modifier and Type | Method and Description |
|---|---|
Event<T> |
add(Object source,
AbstractEvent.Type eventType,
T resource)
Adds a new
Event constructed out of the parameters
supplied to this method to this EventCache implementation
and returns the Event that was added. |
void |
replace(Collection<? extends T> incomingResources,
Object resourceVersion)
A "full replace" operation that atomically replaces all internal
state with new state derived from the supplied
Collection
of resources. |
void |
synchronize()
Synchronizes this
EventCache implementation's state with
its downstream consumers, if any. |
Event<T> add(Object source, AbstractEvent.Type eventType, T resource)
Event constructed out of the parameters
supplied to this method to this EventCache implementation
and returns the Event that was added.
Implementations of this method may return null to
indicate that for whatever reason no Event was actually
added.
source - the source of the
Event that will be created and added; must not be nulleventType - the type of Event that will be created and added; must not be nullresource - the resource of
the Event that will be created and added must not be
nullEvent that was created and added, or null if no Event was actually added as a result of this
method's invocationNullPointerException - if any of the parameters is
nullEventvoid replace(Collection<? extends T> incomingResources, Object resourceVersion)
Collection
of resources.incomingResources - the resources comprising the new state;
must not be null; must be synchronized
on when accessingresourceVersion - the notional version of the supplied
Collection; may be null; often ignored by
implementationsNullPointerException - if incomingResources is
nullvoid synchronize()
EventCache implementation's state with
its downstream consumers, if any.
Not all EventCache implementations need support
synchronization. An implementation of this method that does
nothing is explicitly permitted.
Copyright © 2017–2018, microBean. All rights reserved.