public class KdbPublisherManager extends Object
Provides the ability to maintain numerous kdb publishers and interface with them all through a single method call, within this class.
Use cases include PROD & DR dual-publishing
(c) 2014 - 2017 Sport Trades LtdModifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
log |
private ConcurrentHashMap<KdbProcess,KdbPublisherThread> |
publishers
Map of publishers that are available
|
Constructor and Description |
---|
KdbPublisherManager() |
Modifier and Type | Method and Description |
---|---|
void |
addPublisher(KdbProcess server) |
void |
disconnect(KdbProcess server)
Disconnects from the specified kdb server and removes it from the internal management object
|
List<KdbProcess> |
getTargetProcesses() |
void |
publish(List<KdbProcess> servers,
List<KdbTable> tables)
Provides the ability to publish a number of
KdbTable 's to a specified list of
kdb processes. |
void |
publish(List<KdbTable> tables)
Publishes the specified tables to all processes that are managed by this class.
|
void |
shutdown()
Simple wrapper for
disconnect(KdbProcess) to disconnect all processes in the current manager. |
private static final org.slf4j.Logger log
private final ConcurrentHashMap<KdbProcess,KdbPublisherThread> publishers
public void addPublisher(KdbProcess server) throws KdbTargetProcessUnavailableException, KdbPublisherAlreadyExistsException
public void publish(List<KdbTable> tables)
public void publish(List<KdbProcess> servers, List<KdbTable> tables) throws KdbPublisherDoesNotExistException
KdbTable
's to a specified list of
kdb processes. These processes must already have been added to this manager before attempting
to publish.servers
- The known kdb processes to publish the data totables
- The tables to publish to the kdb processesKdbPublisherDoesNotExistException
- If a server is passed that is not known to this managerpublic List<KdbProcess> getTargetProcesses()
public void disconnect(KdbProcess server) throws KdbPublisherDoesNotExistException
server
- The kdb process to disconnect fromKdbPublisherDoesNotExistException
- If the specified kdb process does not exist in this managerpublic void shutdown()
disconnect(KdbProcess)
to disconnect all processes in the current manager.Copyright © 2017. All rights reserved.