Package org.onosproject.store
Class AbstractStore<E extends Event,D extends StoreDelegate<E>>
- java.lang.Object
-
- org.onosproject.store.AbstractStore<E,D>
-
- All Implemented Interfaces:
Store<E,D>
- Direct Known Subclasses:
ApplicationArchive
,DistributedComponentConfigStore
public class AbstractStore<E extends Event,D extends StoreDelegate<E>> extends java.lang.Object implements Store<E,D>
Base implementation of a store.
-
-
Constructor Summary
Constructors Constructor Description AbstractStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasDelegate()
Indicates whether the store has a delegate.protected void
notifyDelegate(E event)
Notifies the delegate with the specified event.protected void
notifyDelegate(java.util.List<E> events)
Notifies the delegate with the specified list of events.void
setDelegate(D delegate)
Sets the delegate on the store.void
unsetDelegate(D delegate)
Withdraws the delegate from the store.
-
-
-
Field Detail
-
delegate
protected D extends StoreDelegate<E> delegate
-
-
Method Detail
-
setDelegate
public void setDelegate(D delegate)
Description copied from interface:Store
Sets the delegate on the store.- Specified by:
setDelegate
in interfaceStore<E extends Event,D extends StoreDelegate<E>>
- Parameters:
delegate
- new store delegate
-
unsetDelegate
public void unsetDelegate(D delegate)
Description copied from interface:Store
Withdraws the delegate from the store.- Specified by:
unsetDelegate
in interfaceStore<E extends Event,D extends StoreDelegate<E>>
- Parameters:
delegate
- store delegate to withdraw
-
hasDelegate
public boolean hasDelegate()
Description copied from interface:Store
Indicates whether the store has a delegate.- Specified by:
hasDelegate
in interfaceStore<E extends Event,D extends StoreDelegate<E>>
- Returns:
- true if delegate is set
-
notifyDelegate
protected void notifyDelegate(E event)
Notifies the delegate with the specified event.- Parameters:
event
- event to delegate
-
notifyDelegate
protected void notifyDelegate(java.util.List<E> events)
Notifies the delegate with the specified list of events.- Parameters:
events
- list of events to delegate
-
-