Class AdministrativeStatusManagerImpl
- java.lang.Object
-
- org.nuxeo.ecm.core.management.statuses.AdministrativeStatusManagerImpl
-
- All Implemented Interfaces:
AdministrativeStatusManager
,CoreManagementService
public class AdministrativeStatusManagerImpl extends Object implements AdministrativeStatusManager, CoreManagementService
Implementation class for theAdministrativeStatusManager
service. For each Nuxeo Instance in the cluster one instance of this class is created.- Author:
- tiry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AdministrativeStatusManagerImpl.NotifyStatusesHandler
-
Field Summary
Fields Modifier and Type Field Description protected GlobalAdministrativeStatusManager
globalManager
protected Notifier[]
notifiers
protected AdministrativeStatusPersister
persister
protected ScheduledExecutorService
scheduler
protected String
serverInstanceName
-
Fields inherited from interface org.nuxeo.ecm.core.management.api.AdministrativeStatusManager
ACTIVATED_EVENT, ADMINISTRATIVE_EVENT_CATEGORY, ADMINISTRATIVE_EVENT_INSTANCE, ADMINISTRATIVE_EVENT_SERVICE, ADMINISTRATIVE_INSTANCE_ID, GLOBAL_INSTANCE_AVAILABILITY, PASSIVATED_EVENT
-
-
Constructor Summary
Constructors Constructor Description AdministrativeStatusManagerImpl(GlobalAdministrativeStatusManager globalManager, AdministrativeStatusPersister persister)
AdministrativeStatusManagerImpl(GlobalAdministrativeStatusManager globalManager, AdministrativeStatusPersister persister, String instanceIdentifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdministrativeStatus
activate(String serviceIdentifier, String message, String login)
Mark a given resource as active.AdministrativeStatus
activateNuxeoInstance(String message, String login)
Mark local Nuxeo instance as active.protected AdministrativeStatus
addLabelAndDescription(AdministrativeStatus status)
AdministrativeStatus
deactivate(String serviceIdentifier, String message, String login)
Mark a given resource as non active.AdministrativeStatus
deactivateNuxeoInstance(String message, String login)
Mark local Nuxeo instance as non active.protected void
doNotifyAllStatuses()
List<AdministrativeStatus>
getAllStatuses()
ListAdministrativeStatus
for all tracked resources (Servers or Services).AdministrativeStatus
getNuxeoInstanceStatus()
Get theAdministrativeStatus
of a the local Nuxeo Instance.protected String
getServerInstanceName()
AdministrativeStatus
getStatus(String serviceIdentifier)
Get theAdministrativeStatus
of a given resource.protected void
notifyEvent(String eventName, String instanceIdentifier, String serviceIdentifier)
protected void
notifyOnStatus(AdministrativeStatus status)
void
onNuxeoServerShutdown()
void
onNuxeoServerStartup()
AdministrativeStatus
setNuxeoInstanceStatus(String state, String message, String login)
Sets theAdministrativeStatus
of the Local Nuxeo Instance.AdministrativeStatus
setStatus(String serviceIdentifier, String state, String message, String login)
Sets theAdministrativeStatus
of a given resource.
-
-
-
Field Detail
-
persister
protected final AdministrativeStatusPersister persister
-
globalManager
protected final GlobalAdministrativeStatusManager globalManager
-
serverInstanceName
protected final String serverInstanceName
-
scheduler
protected ScheduledExecutorService scheduler
-
notifiers
protected final Notifier[] notifiers
-
-
Constructor Detail
-
AdministrativeStatusManagerImpl
public AdministrativeStatusManagerImpl(GlobalAdministrativeStatusManager globalManager, AdministrativeStatusPersister persister)
-
AdministrativeStatusManagerImpl
public AdministrativeStatusManagerImpl(GlobalAdministrativeStatusManager globalManager, AdministrativeStatusPersister persister, String instanceIdentifier)
-
-
Method Detail
-
getServerInstanceName
protected String getServerInstanceName()
-
notifyEvent
protected void notifyEvent(String eventName, String instanceIdentifier, String serviceIdentifier)
-
onNuxeoServerStartup
public void onNuxeoServerStartup()
-
doNotifyAllStatuses
protected void doNotifyAllStatuses()
-
onNuxeoServerShutdown
public void onNuxeoServerShutdown()
-
notifyOnStatus
protected void notifyOnStatus(AdministrativeStatus status)
-
activateNuxeoInstance
public AdministrativeStatus activateNuxeoInstance(String message, String login)
Description copied from interface:AdministrativeStatusManager
Mark local Nuxeo instance as active.- Specified by:
activateNuxeoInstance
in interfaceAdministrativeStatusManager
-
deactivateNuxeoInstance
public AdministrativeStatus deactivateNuxeoInstance(String message, String login)
Description copied from interface:AdministrativeStatusManager
Mark local Nuxeo instance as non active.- Specified by:
deactivateNuxeoInstance
in interfaceAdministrativeStatusManager
-
getNuxeoInstanceStatus
public AdministrativeStatus getNuxeoInstanceStatus()
Description copied from interface:AdministrativeStatusManager
Get theAdministrativeStatus
of a the local Nuxeo Instance.- Specified by:
getNuxeoInstanceStatus
in interfaceAdministrativeStatusManager
-
setNuxeoInstanceStatus
public AdministrativeStatus setNuxeoInstanceStatus(String state, String message, String login)
Description copied from interface:AdministrativeStatusManager
Sets theAdministrativeStatus
of the Local Nuxeo Instance.- Specified by:
setNuxeoInstanceStatus
in interfaceAdministrativeStatusManager
-
activate
public AdministrativeStatus activate(String serviceIdentifier, String message, String login)
Description copied from interface:AdministrativeStatusManager
Mark a given resource as active.- Specified by:
activate
in interfaceAdministrativeStatusManager
-
deactivate
public AdministrativeStatus deactivate(String serviceIdentifier, String message, String login)
Description copied from interface:AdministrativeStatusManager
Mark a given resource as non active.- Specified by:
deactivate
in interfaceAdministrativeStatusManager
-
setStatus
public AdministrativeStatus setStatus(String serviceIdentifier, String state, String message, String login)
Description copied from interface:AdministrativeStatusManager
Sets theAdministrativeStatus
of a given resource.- Specified by:
setStatus
in interfaceAdministrativeStatusManager
-
getAllStatuses
public List<AdministrativeStatus> getAllStatuses()
Description copied from interface:AdministrativeStatusManager
ListAdministrativeStatus
for all tracked resources (Servers or Services).- Specified by:
getAllStatuses
in interfaceAdministrativeStatusManager
-
addLabelAndDescription
protected AdministrativeStatus addLabelAndDescription(AdministrativeStatus status)
-
getStatus
public AdministrativeStatus getStatus(String serviceIdentifier)
Description copied from interface:AdministrativeStatusManager
Get theAdministrativeStatus
of a given resource.- Specified by:
getStatus
in interfaceAdministrativeStatusManager
-
-