public interface CloudConnectionStatusService
CloudConnectionStatusComponent
which represents all the elements
that are responsible of notifying the connection status.CloudConnectionStatusComponent
is assigned with a priority and a status (CloudConnectionStatusEnum
).
The Service shows the status of the highest priority CloudConnectionStatusComponent registered in the list.CloudConnectionStatusComponent
interface and register itself
in the Service component registry using the register(CloudConnectionStatusComponent c)
method.updateStatus(...)
will trigger an internal status change for the relevant component, and the Service will
trigger a status change for the highest priority component only if needed.Modifier and Type | Field and Description |
---|---|
static int |
PRIORITY_CRITICAL
Priorities are evaluated in ascending order.
|
static int |
PRIORITY_HIGH |
static int |
PRIORITY_LOW |
static int |
PRIORITY_MAX
Maximum priority for the notification.
|
static int |
PRIORITY_MEDIUM |
static int |
PRIORITY_MIN
Minimum priority for the notification.
|
Modifier and Type | Method and Description |
---|---|
void |
register(CloudConnectionStatusComponent component)
Registers a
CloudConnectionStatusComponent in the component registry of the Service |
void |
unregister(CloudConnectionStatusComponent component)
Unregisters a
CloudConnectionStatusComponent from the component registry of the Service |
boolean |
updateStatus(CloudConnectionStatusComponent component,
CloudConnectionStatusEnum status)
Updates the status of a
CloudConnectionStatusComponent in the registry. |
static final int PRIORITY_MAX
static final int PRIORITY_CRITICAL
static final int PRIORITY_HIGH
static final int PRIORITY_MEDIUM
static final int PRIORITY_LOW
static final int PRIORITY_MIN
void register(CloudConnectionStatusComponent component)
CloudConnectionStatusComponent
in the component registry of the Servicecomponent
- CloudConnectionStatusComponent to be registered in the registryvoid unregister(CloudConnectionStatusComponent component)
CloudConnectionStatusComponent
from the component registry of the Servicecomponent
- CloudConnectionStatusComponent to be unregistered from the registryboolean updateStatus(CloudConnectionStatusComponent component, CloudConnectionStatusEnum status)
CloudConnectionStatusComponent
in the registry.
Implementation should also set the internal status of the CloudConnectionStatus component so to persist it.component
- CloudConnectionStatusComponent
for which the status has to be changedstatus
- CloudConnectionStatusEnum
representing the new status of the componentCopyright © 2015. All Rights Reserved.