Package org.infinispan.xsite.status
Interface TakeOfflineManager
-
- All Known Implementing Classes:
DefaultTakeOfflineManager,NoOpTakeOfflineManager
public interface TakeOfflineManagerIt 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidamendConfiguration(String siteName, Integer afterFailures, Long minTimeToWait)It changes theTakeOfflineConfigurationfor sitesiteName.BringSiteOnlineResponsebringSiteOnline(String siteName)It changes the sitesiteNameto online.TakeOfflineConfigurationgetConfiguration(String siteName)It returns the currentTakeOfflineConfigurationfor sitesiteName.SiteStategetSiteState(String siteName)Returns the site state for sitesiteName.voidregisterRequest(XSiteResponse response)Registers a cross-site request made.Map<String,Boolean>status()It returns aMapwith the sites name and their state (Online or Offline).TakeSiteOfflineResponsetakeSiteOffline(String siteName)It changes the sitesiteNameto offline.
-
-
-
Method Detail
-
registerRequest
void registerRequest(XSiteResponse response)
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
SiteState getSiteState(String siteName)
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
void amendConfiguration(String siteName, Integer afterFailures, Long minTimeToWait)
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
TakeOfflineConfiguration getConfiguration(String siteName)
It returns the currentTakeOfflineConfigurationfor sitesiteName.- Parameters:
siteName- The remote site name.- Returns:
- The current
TakeOfflineConfigurationornullif the sitesiteNamedoesn't exist.
-
status
Map<String,Boolean> 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
BringSiteOnlineResponse bringSiteOnline(String siteName)
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
TakeSiteOfflineResponse takeSiteOffline(String siteName)
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.
-
-