public interface UIModule
StatsStorage
instance.StatsStorage
object is attached to a UIServer
, the UI server will
start receiving StatsStorageEvent
instances; some of these (only the appropriate ones based on the specified
TypeIDs from the getCallbackTypeIDs()
method) will be routed to the UIModule, via reportStorageEvents(Collection)
.
Each UIModule will generally handle one (or at most a few) different types of data (Type IDs); note however that events
for a single Type ID can be routed to multiple UI modules, if required.
The UIModule also encapsulates the relevant routing information: i.e., what GET/PUT (etc) methods are available for this module, and how those methods should be handled.
Modifier and Type | Method and Description |
---|---|
List<String> |
getCallbackTypeIDs()
Get the list of Type IDs that should be collected from the registered
StatsStorage instances, and
passed on to the reportStorageEvents(Collection) method. |
List<I18NResource> |
getInternationalizationResources() |
List<Route> |
getRoutes()
Get a list of
Route objects, that specify GET/SET etc methods, and how these should be handled. |
void |
onAttach(StatsStorage statsStorage)
Notify the UI module that the given
StatsStorage instance has been attached to the UI |
void |
onDetach(StatsStorage statsStorage)
Notify the UI module that the given
StatsStorage instance has been detached from the UI |
void |
reportStorageEvents(Collection<StatsStorageEvent> events)
Whenever the
UIServer receives some StatsStorageEvent s from one of the registered StatsStorage
instances, it will filter these and pass on to the UI module those ones that match one of the Type IDs from
getCallbackTypeIDs() . |
List<String> getCallbackTypeIDs()
StatsStorage
instances, and
passed on to the reportStorageEvents(Collection)
method.List<Route> getRoutes()
Route
objects, that specify GET/SET etc methods, and how these should be handled.void reportStorageEvents(Collection<StatsStorageEvent> events)
UIServer
receives some StatsStorageEvent
s from one of the registered StatsStorage
instances, it will filter these and pass on to the UI module those ones that match one of the Type IDs from
getCallbackTypeIDs()
.events
- List of relevant events (type IDs match one of those from getCallbackTypeIDs()
void onAttach(StatsStorage statsStorage)
StatsStorage
instance has been attached to the UIstatsStorage
- Stats storage that has been attachedvoid onDetach(StatsStorage statsStorage)
StatsStorage
instance has been detached from the UIstatsStorage
- Stats storage that has been detachedList<I18NResource> getInternationalizationResources()
Copyright © 2020. All rights reserved.