Package org.infinispan.xsite.status
Interface TakeOfflineManager
- All Superinterfaces:
org.infinispan.metrics.impl.CustomMetricsSupplier
- All Known Implementing Classes:
DefaultTakeOfflineManager
,NoOpTakeOfflineManager
public interface TakeOfflineManager
extends org.infinispan.metrics.impl.CustomMetricsSupplier
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 TypeMethodDescriptionvoid
amendConfiguration
(String siteName, Integer afterFailures, Long minTimeToWait) It changes theTakeOfflineConfiguration
for sitesiteName
.bringSiteOnline
(String siteName) It changes the sitesiteName
to online.getConfiguration
(String siteName) It returns the currentTakeOfflineConfiguration
for sitesiteName
.default Collection<MetricInfo>
getCustomMetrics
(GlobalMetricsConfiguration configuration) getSiteState
(String siteName) Returns the site state for sitesiteName
.void
registerRequest
(XSiteResponse<?> response) Registers a cross-site request made.status()
It returns aMap
with the sites name and their state (Online or Offline).takeSiteOffline
(String siteName) It changes the sitesiteName
to 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.ONLINE
orSiteState.OFFLINE
. If it doesn't exist,SiteState.NOT_FOUND
is returned.- Parameters:
siteName
- The remote site name.- Returns:
- The
SiteState
.
-
amendConfiguration
It changes theTakeOfflineConfiguration
for sitesiteName
.If the
siteName
doesn't exist, this method is a no-op.- Parameters:
siteName
- The remote site name.afterFailures
- The newTakeOfflineConfigurationBuilder.afterFailures(int)
ornull
for no changes.minTimeToWait
- The newTakeOfflineConfigurationBuilder.minTimeToWait(long)
ornull
for no changes.
-
getConfiguration
It returns the currentTakeOfflineConfiguration
for sitesiteName
.- Parameters:
siteName
- The remote site name.- Returns:
- The current
TakeOfflineConfiguration
ornull
if the sitesiteName
doesn't exist.
-
status
It returns aMap
with 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
Map
with the site state.
-
bringSiteOnline
It changes the sitesiteName
to online.If the site is already online, then
BringSiteOnlineResponse.ALREADY_ONLINE
is returned. If it doesn't exits,BringSiteOnlineResponse.NO_SUCH_SITE
is returned.- Parameters:
siteName
- The remote site name.- Returns:
- The
BringSiteOnlineResponse
.
-
takeSiteOffline
It changes the sitesiteName
to offline.If the site is already offline, then
TakeSiteOfflineResponse.ALREADY_OFFLINE
is returned. If it doesn't exits,TakeSiteOfflineResponse.NO_SUCH_SITE
is returned.- Parameters:
siteName
- The remote site name.- Returns:
- The
TakeSiteOfflineResponse
.
-
getCustomMetrics
-