Package org.infinispan.xsite.status
Interface TakeOfflineManager
- All Superinterfaces:
CustomMetricsSupplier
- All Known Implementing Classes:
DefaultTakeOfflineManager,NoOpTakeOfflineManager
It keeps tracks of cross-site requests to take sites offline when certain failures conditions happen.
Those condition are configured in TakeOfflineConfiguration.
- Since:
- 11.0
- Author:
- Pedro Ruivo
-
Method Summary
Modifier and TypeMethodDescriptionvoidamendConfiguration(String siteName, Integer afterFailures, Long minTimeToWait) It changes theTakeOfflineConfigurationfor sitesiteName.bringSiteOnline(String siteName) It changes the sitesiteNameto online.getConfiguration(String siteName) It returns the currentTakeOfflineConfigurationfor sitesiteName.getSiteState(String siteName) Returns the site state for sitesiteName.voidregisterRequest(XSiteResponse<?> response) Registers a cross-site request made.status()It returns aMapwith the sites name and their state (Online or Offline).takeSiteOffline(String siteName) It changes the sitesiteNameto offline.
-
Method Details
-
registerRequest
Registers a cross-site request made.Handles the response for the request and takes action in case of failure.
- Parameters:
response- The cross-site response.
-
getSiteState
Returns the site state for sitesiteName.The site can be
SiteState.ONLINEorSiteState.OFFLINE. If it doesn't exist,SiteState.NOT_FOUNDis returned.- Parameters:
siteName- The remote site name.- Returns:
- The
SiteState.
-
amendConfiguration
It changes theTakeOfflineConfigurationfor sitesiteName.If the
siteNamedoesn't exist, this method is a no-op.- Parameters:
siteName- The remote site name.afterFailures- The newTakeOfflineConfigurationBuilder.afterFailures(int)ornullfor no changes.minTimeToWait- The newTakeOfflineConfigurationBuilder.minTimeToWait(long)ornullfor no changes.
-
getConfiguration
It returns the currentTakeOfflineConfigurationfor sitesiteName.- Parameters:
siteName- The remote site name.- Returns:
- The current
TakeOfflineConfigurationornullif the sitesiteNamedoesn't exist.
-
status
It returns aMapwith the sites name and their state (Online or Offline).If a site is online, then its value is
Boolean.TRUE, otherwise isBoolean.FALSE.- Returns:
- A
Mapwith the site state.
-
bringSiteOnline
It changes the sitesiteNameto online.If the site is already online, then
BringSiteOnlineResponse.ALREADY_ONLINEis returned. If it doesn't exits,BringSiteOnlineResponse.NO_SUCH_SITEis returned.- Parameters:
siteName- The remote site name.- Returns:
- The
BringSiteOnlineResponse.
-
takeSiteOffline
It changes the sitesiteNameto offline.If the site is already offline, then
TakeSiteOfflineResponse.ALREADY_OFFLINEis returned. If it doesn't exits,TakeSiteOfflineResponse.NO_SUCH_SITEis returned.- Parameters:
siteName- The remote site name.- Returns:
- The
TakeSiteOfflineResponse.
-
getCustomMetrics
- Specified by:
getCustomMetricsin interfaceCustomMetricsSupplier- Returns:
- A list of
MBeanMetadata.AttributeMetadatato be registered.
-