Class FailoverLoomClient
java.lang.Object
com.loomcache.client.FailoverLoomClient
- All Implemented Interfaces:
AutoCloseable
Blue/green failover wrapper that connects to one configured cluster at a time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLifecycleListener(LifecycleListener listener) asCache()voidclose()voidconnect()Connect to the first reachable configured client cluster.static FailoverLoomClientconnect(ClientFailoverConfig config) intintvoidfailover()Close the active client and roll to the next reachable configured cluster.booleanbooleanremoveLifecycleListener(LifecycleListener listener)
-
Constructor Details
-
FailoverLoomClient
-
-
Method Details
-
connect
-
connect
public void connect()Connect to the first reachable configured client cluster. -
failover
public void failover()Close the active client and roll to the next reachable configured cluster. -
currentClient
-
currentConfigIndex
public int currentConfigIndex() -
isConnected
public boolean isConnected() -
connectedNodeCount
public int connectedNodeCount() -
asCache
-
addLifecycleListener
-
removeLifecycleListener
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-