Package com.illumon.iris.controller
Class ControllerHashtableClient
java.lang.Object
com.illumon.iris.controller.ControllerHashtable
com.illumon.iris.controller.ControllerHashtableClient
- All Implemented Interfaces:
com.fishlib.net.api.CommandHandler,com.fishlib.net.api.ConnectionStatusHandlerEx,com.fishlib.net.CommBase.ConnectionStatusHandler,ControllerHashtableEventSource,Map<Long,PersistentQueryInfo>
- Direct Known Subclasses:
PersistentQueryControllerClient
public class ControllerHashtableClient extends ControllerHashtable implements com.fishlib.net.api.CommandHandler, com.fishlib.net.api.ConnectionStatusHandlerEx
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected com.fishlib.io.logger.Loggerlog -
Method Summary
Modifier and Type Method Description voidaddEventHandlerAndGetData(ControllerHashtableEventHandler handler)Subscribe to events with an initial snapshot of the data.voidaddReloadCommandListener(Consumer<PersistentQueryControllerConfiguration> reloadListener)voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)voiddisconnect()Set<Map.Entry<Long,PersistentQueryInfo>>entrySet()PersistentQueryInfoget(Object key)com.fishlib.net.api.CommClientgetComm()com.fishlib.base.hash.IndexableMap<Long,PersistentQueryInfo>getData()Map<Long,PersistentQueryInfo>getUnderlyingMap()voidhandleClientDeath(com.fishlib.net.api.ClientEntry client)voidhandleCommand(com.fishlib.net.api.ClientEntry client, com.fishlib.base.Command cmd)voidhandleConnectionLost(com.fishlib.net.api.ClientEntry client)voidhandleConnectionReestablished()voidhandleInitialConnection(com.fishlib.net.api.CommClient commClient)booleanisEmpty()Set<Long>keySet()PersistentQueryInfoput(Long key, PersistentQueryInfo value)voidputAll(Map<? extends Long,? extends PersistentQueryInfo> t)PersistentQueryInforemove(Object key)intsize()voidsubscribeToAll()Collection<PersistentQueryInfo>values()Note that this breaks the contract ofMapbecause the values are copied.Methods inherited from class com.illumon.iris.controller.ControllerHashtable
addCommandHandler, addEventHandler, removeCommandHandler, removeEventHandlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
log
protected final com.fishlib.io.logger.Logger log
-
-
Method Details
-
addReloadCommandListener
public void addReloadCommandListener(Consumer<PersistentQueryControllerConfiguration> reloadListener) -
getComm
public com.fishlib.net.api.CommClient getComm() -
getData
-
get
- Specified by:
getin interfaceMap<Long,PersistentQueryInfo>
-
put
- Specified by:
putin interfaceMap<Long,PersistentQueryInfo>
-
clear
public void clear()- Specified by:
clearin interfaceMap<Long,PersistentQueryInfo>
-
remove
- Specified by:
removein interfaceMap<Long,PersistentQueryInfo>
-
handleCommand
public void handleCommand(com.fishlib.net.api.ClientEntry client, com.fishlib.base.Command cmd)- Specified by:
handleCommandin interfacecom.fishlib.net.api.CommandHandler
-
size
public int size()- Specified by:
sizein interfaceMap<Long,PersistentQueryInfo>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMap<Long,PersistentQueryInfo>
-
containsKey
- Specified by:
containsKeyin interfaceMap<Long,PersistentQueryInfo>
-
containsValue
- Specified by:
containsValuein interfaceMap<Long,PersistentQueryInfo>
-
values
Note that this breaks the contract ofMapbecause the values are copied.- Specified by:
valuesin interfaceMap<Long,PersistentQueryInfo>
-
putAll
- Specified by:
putAllin interfaceMap<Long,PersistentQueryInfo>
-
entrySet
- Specified by:
entrySetin interfaceMap<Long,PersistentQueryInfo>
-
keySet
- Specified by:
keySetin interfaceMap<Long,PersistentQueryInfo>
-
handleClientDeath
public void handleClientDeath(com.fishlib.net.api.ClientEntry client)- Specified by:
handleClientDeathin interfacecom.fishlib.net.api.CommandHandler
-
disconnect
- Specified by:
disconnectin classControllerHashtable- Throws:
IOException
-
addEventHandlerAndGetData
Subscribe to events with an initial snapshot of the data.- Specified by:
addEventHandlerAndGetDatain interfaceControllerHashtableEventSource- Parameters:
handler- the handler for ControllerHashTableEvents
-
subscribeToAll
- Specified by:
subscribeToAllin classControllerHashtable- Throws:
IOException
-
getUnderlyingMap
- Specified by:
getUnderlyingMapin classControllerHashtable
-
handleConnectionLost
public void handleConnectionLost(com.fishlib.net.api.ClientEntry client)- Specified by:
handleConnectionLostin interfacecom.fishlib.net.CommBase.ConnectionStatusHandler
-
handleConnectionReestablished
public void handleConnectionReestablished()- Specified by:
handleConnectionReestablishedin interfacecom.fishlib.net.CommBase.ConnectionStatusHandler
-
handleInitialConnection
public void handleInitialConnection(com.fishlib.net.api.CommClient commClient)- Specified by:
handleInitialConnectionin interfacecom.fishlib.net.api.ConnectionStatusHandlerEx
-