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.Logger
log
-
Method Summary
Modifier and Type Method Description void
addEventHandlerAndGetData(ControllerHashtableEventHandler handler)
Subscribe to events with an initial snapshot of the data.void
addReloadCommandListener(Consumer<PersistentQueryControllerConfiguration> reloadListener)
void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
void
disconnect()
Set<Map.Entry<Long,PersistentQueryInfo>>
entrySet()
PersistentQueryInfo
get(Object key)
com.fishlib.net.api.CommClient
getComm()
com.fishlib.base.hash.IndexableMap<Long,PersistentQueryInfo>
getData()
Map<Long,PersistentQueryInfo>
getUnderlyingMap()
void
handleClientDeath(com.fishlib.net.api.ClientEntry client)
void
handleCommand(com.fishlib.net.api.ClientEntry client, com.fishlib.base.Command cmd)
void
handleConnectionLost(com.fishlib.net.api.ClientEntry client)
void
handleConnectionReestablished()
void
handleInitialConnection(com.fishlib.net.api.CommClient commClient)
boolean
isEmpty()
Set<Long>
keySet()
PersistentQueryInfo
put(Long key, PersistentQueryInfo value)
void
putAll(Map<? extends Long,? extends PersistentQueryInfo> t)
PersistentQueryInfo
remove(Object key)
int
size()
void
subscribeToAll()
Collection<PersistentQueryInfo>
values()
Note that this breaks the contract ofMap
because the values are copied.protected long
waitUntilConnectedOrTimeout(String who, long timeoutDurationMillis)
Methods inherited from class com.illumon.iris.controller.ControllerHashtable
addCommandHandler, addEventHandler, removeCommandHandler, removeEventHandler
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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) -
waitUntilConnectedOrTimeout
-
getComm
public com.fishlib.net.api.CommClient getComm() -
getData
-
get
- Specified by:
get
in interfaceMap<Long,PersistentQueryInfo>
-
put
- Specified by:
put
in interfaceMap<Long,PersistentQueryInfo>
-
clear
public void clear()- Specified by:
clear
in interfaceMap<Long,PersistentQueryInfo>
-
remove
- Specified by:
remove
in interfaceMap<Long,PersistentQueryInfo>
-
handleCommand
public void handleCommand(com.fishlib.net.api.ClientEntry client, com.fishlib.base.Command cmd)- Specified by:
handleCommand
in interfacecom.fishlib.net.api.CommandHandler
-
size
public int size()- Specified by:
size
in interfaceMap<Long,PersistentQueryInfo>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceMap<Long,PersistentQueryInfo>
-
containsKey
- Specified by:
containsKey
in interfaceMap<Long,PersistentQueryInfo>
-
containsValue
- Specified by:
containsValue
in interfaceMap<Long,PersistentQueryInfo>
-
values
Note that this breaks the contract ofMap
because the values are copied.- Specified by:
values
in interfaceMap<Long,PersistentQueryInfo>
-
putAll
- Specified by:
putAll
in interfaceMap<Long,PersistentQueryInfo>
-
entrySet
- Specified by:
entrySet
in interfaceMap<Long,PersistentQueryInfo>
-
keySet
- Specified by:
keySet
in interfaceMap<Long,PersistentQueryInfo>
-
handleClientDeath
public void handleClientDeath(com.fishlib.net.api.ClientEntry client)- Specified by:
handleClientDeath
in interfacecom.fishlib.net.api.CommandHandler
-
disconnect
- Specified by:
disconnect
in classControllerHashtable
- Throws:
IOException
-
addEventHandlerAndGetData
Subscribe to events with an initial snapshot of the data.- Specified by:
addEventHandlerAndGetData
in interfaceControllerHashtableEventSource
- Parameters:
handler
- the handler for ControllerHashTableEvents
-
subscribeToAll
- Specified by:
subscribeToAll
in classControllerHashtable
- Throws:
IOException
-
getUnderlyingMap
- Specified by:
getUnderlyingMap
in classControllerHashtable
-
handleConnectionLost
public void handleConnectionLost(com.fishlib.net.api.ClientEntry client)- Specified by:
handleConnectionLost
in interfacecom.fishlib.net.CommBase.ConnectionStatusHandler
-
handleConnectionReestablished
public void handleConnectionReestablished()- Specified by:
handleConnectionReestablished
in interfacecom.fishlib.net.CommBase.ConnectionStatusHandler
-
handleInitialConnection
public void handleInitialConnection(com.fishlib.net.api.CommClient commClient)- Specified by:
handleInitialConnection
in interfacecom.fishlib.net.api.ConnectionStatusHandlerEx
-