Package org.infinispan.xsite.status
Class NoOpTakeOfflineManager
java.lang.Object
org.infinispan.xsite.status.NoOpTakeOfflineManager
- All Implemented Interfaces:
org.infinispan.metrics.impl.CustomMetricsSupplier
,TakeOfflineManager
An empty
TakeOfflineManager
implementation for caches which don't backup any data to remote sites.- 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
.static NoOpTakeOfflineManager
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.infinispan.xsite.status.TakeOfflineManager
getCustomMetrics
-
Method Details
-
getInstance
-
registerRequest
Description copied from interface:TakeOfflineManager
Registers a cross-site request made.Handles the response for the request and takes action in case of failure.
- Specified by:
registerRequest
in interfaceTakeOfflineManager
- Parameters:
response
- The cross-site response.
-
getSiteState
Description copied from interface:TakeOfflineManager
Returns the site state for sitesiteName
.The site can be
SiteState.ONLINE
orSiteState.OFFLINE
. If it doesn't exist,SiteState.NOT_FOUND
is returned.- Specified by:
getSiteState
in interfaceTakeOfflineManager
- Parameters:
siteName
- The remote site name.- Returns:
- The
SiteState
.
-
amendConfiguration
Description copied from interface:TakeOfflineManager
It changes theTakeOfflineConfiguration
for sitesiteName
.If the
siteName
doesn't exist, this method is a no-op.- Specified by:
amendConfiguration
in interfaceTakeOfflineManager
- 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
Description copied from interface:TakeOfflineManager
It returns the currentTakeOfflineConfiguration
for sitesiteName
.- Specified by:
getConfiguration
in interfaceTakeOfflineManager
- Parameters:
siteName
- The remote site name.- Returns:
- The current
TakeOfflineConfiguration
ornull
if the sitesiteName
doesn't exist.
-
status
Description copied from interface:TakeOfflineManager
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
.- Specified by:
status
in interfaceTakeOfflineManager
- Returns:
- A
Map
with the site state.
-
bringSiteOnline
Description copied from interface:TakeOfflineManager
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.- Specified by:
bringSiteOnline
in interfaceTakeOfflineManager
- Parameters:
siteName
- The remote site name.- Returns:
- The
BringSiteOnlineResponse
.
-
takeSiteOffline
Description copied from interface:TakeOfflineManager
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.- Specified by:
takeSiteOffline
in interfaceTakeOfflineManager
- Parameters:
siteName
- The remote site name.- Returns:
- The
TakeSiteOfflineResponse
.
-