Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.xsite
Class OfflineStatus

java.lang.Object
  extended by 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

Constructor Summary
OfflineStatus(TakeOfflineConfiguration takeOfflineConfiguration)
           
 
Method Summary
 void amend(Integer afterFailures, Long minTimeToWait)
           
 void amend(TakeOfflineConfiguration takeOffline)
          Configures the site to use the supplied configuration for determining when to take a site offline.
 boolean bringOnline()
           
 boolean forceOffline()
           
 int getFailureCount()
           
 TakeOfflineConfiguration getTakeOffline()
           
 boolean isEnabled()
           
 boolean isOffline()
           
 long millisSinceFirstFailure()
           
 boolean minTimeHasElapsed()
           
 void reset()
           
 String toString()
           
 void updateOnCommunicationFailure(long sendTimeMillis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OfflineStatus

public OfflineStatus(TakeOfflineConfiguration takeOfflineConfiguration)
Method Detail

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)

Infinispan Distribution 5.2.6.Final-redhat-2

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.