org.infinispan.xsite
Class OfflineStatus
java.lang.Object
org.infinispan.xsite.OfflineStatus
@ThreadSafe
public class OfflineStatus
- extends Object
Keeps state needed for knowing when a site needs to be taken offline.
Thread safety: This class is updated from multiple threads so the access to it is synchronized by object's intrinsic
lock.
Impl detail: As this class's state changes constantly, the equals and hashCode haven't been overridden. This
shouldn't affect performance significantly as the number of site backups should be relatively small (1-3).
- Since:
- 5.2
- Author:
- Mircea Markus
OfflineStatus
public OfflineStatus(TakeOfflineConfiguration takeOfflineConfiguration)
updateOnCommunicationFailure
public void updateOnCommunicationFailure(long sendTimeMillis)
isOffline
public boolean isOffline()
minTimeHasElapsed
public boolean minTimeHasElapsed()
millisSinceFirstFailure
public long millisSinceFirstFailure()
bringOnline
public boolean bringOnline()
getFailureCount
public int getFailureCount()
isEnabled
public boolean isEnabled()
amend
public void amend(TakeOfflineConfiguration takeOffline)
- Configures the site to use the supplied configuration for determining when to take a site offline.
Also triggers a state reset.
reset
public void reset()
getTakeOffline
public TakeOfflineConfiguration getTakeOffline()
forceOffline
public boolean forceOffline()
toString
public String toString()
- Overrides:
toString
in class Object
amend
public void amend(Integer afterFailures,
Long minTimeToWait)
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.