Class OfflineStatus

java.lang.Object
org.infinispan.xsite.OfflineStatus
All Implemented Interfaces:
CacheEventFilter<Object,Object>

@ThreadSafe public class OfflineStatus extends Object implements CacheEventFilter<Object,Object>
Keeps the 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 the 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, Pedro Ruivo
  • Constructor Details

  • Method Details

    • start

      public void start()
    • stop

      public void stop()
    • 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()
    • 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)
    • accept

      public boolean accept(Object key, Object oldValue, Metadata oldMetadata, Object newValue, Metadata newMetadata, EventType eventType)
      Description copied from interface: CacheEventFilter
      Whether or not this event should be raised to the listener it is attached to.
      Specified by:
      accept in interface CacheEventFilter<Object,Object>
      Parameters:
      key - The key for the entry that was changed for the event
      oldValue - The previous value before the event takes place
      oldMetadata - The old value before the event takes place
      newValue - The new value for the entry after the event takes place
      newMetadata - The new metadata for the entry after the event takes place
      eventType - The type of event that is being raised
      Returns:
      Whether or not to notify the listener
    • onStatusChanged

      public void onStatusChanged(CacheEntryEvent<ScopedState,Long> event)