public class NoOpTakeOfflineManager extends Object implements TakeOfflineManager
TakeOfflineManager
implementation for caches which don't backup any data to remote sites.Modifier and Type | Method and Description |
---|---|
void |
amendConfiguration(String siteName,
Integer afterFailures,
Long minTimeToWait)
It changes the
TakeOfflineConfiguration for site siteName . |
BringSiteOnlineResponse |
bringSiteOnline(String siteName)
It changes the site
siteName to online. |
TakeOfflineConfiguration |
getConfiguration(String siteName)
It returns the current
TakeOfflineConfiguration for site siteName . |
static NoOpTakeOfflineManager |
getInstance() |
SiteState |
getSiteState(String siteName)
Returns the site state for site
siteName . |
void |
registerRequest(XSiteResponse response)
Registers a cross-site request made.
|
Map<String,Boolean> |
status()
It returns a
Map with the sites name and their state (Online or Offline). |
TakeSiteOfflineResponse |
takeSiteOffline(String siteName)
It changes the site
siteName to offline. |
public static NoOpTakeOfflineManager getInstance()
public void registerRequest(XSiteResponse response)
TakeOfflineManager
Handles the response for the request and takes action in case of failure.
registerRequest
in interface TakeOfflineManager
response
- The cross-site response.public SiteState getSiteState(String siteName)
TakeOfflineManager
siteName
.
The site can be SiteState.ONLINE
or SiteState.OFFLINE
. If it doesn't exist, SiteState.NOT_FOUND
is returned.
getSiteState
in interface TakeOfflineManager
siteName
- The remote site name.SiteState
.public void amendConfiguration(String siteName, Integer afterFailures, Long minTimeToWait)
TakeOfflineManager
TakeOfflineConfiguration
for site siteName
.
If the siteName
doesn't exist, this method is a no-op.
amendConfiguration
in interface TakeOfflineManager
siteName
- The remote site name.afterFailures
- The new TakeOfflineConfigurationBuilder.afterFailures(int)
or null
for no
changes.minTimeToWait
- The new TakeOfflineConfigurationBuilder.minTimeToWait(long)
or null
for no
changes.public TakeOfflineConfiguration getConfiguration(String siteName)
TakeOfflineManager
TakeOfflineConfiguration
for site siteName
.getConfiguration
in interface TakeOfflineManager
siteName
- The remote site name.TakeOfflineConfiguration
or null
if the site siteName
doesn't exist.public Map<String,Boolean> status()
TakeOfflineManager
Map
with the sites name and their state (Online or Offline).
If a site is online, then its value is Boolean.TRUE
, otherwise is Boolean.FALSE
.
status
in interface TakeOfflineManager
Map
with the site state.public BringSiteOnlineResponse bringSiteOnline(String siteName)
TakeOfflineManager
siteName
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.
bringSiteOnline
in interface TakeOfflineManager
siteName
- The remote site name.BringSiteOnlineResponse
.public TakeSiteOfflineResponse takeSiteOffline(String siteName)
TakeOfflineManager
siteName
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.
takeSiteOffline
in interface TakeOfflineManager
siteName
- The remote site name.TakeSiteOfflineResponse
.Copyright © 2021 JBoss by Red Hat. All rights reserved.