* The node that was added.
*/
private void fireNodeAdded(Node node) {
+ logger.finest("firing nodeAdded event with [node=" + node + "]");
for (NodeListener nodeListener : nodeListeners) {
nodeListener.nodeAdded(node);
}
* The node that was removed
*/
private void fireNodeRemoved(Node node) {
+ logger.finest("firing nodeRemoved event with [node=" + node + "]");
for (NodeListener nodeListener : nodeListeners) {
nodeListener.nodeRemoved(node);
}
* The node that is now connected
*/
private void fireNodeConnected(Node node) {
+ logger.finest("firing nodeConnected event with [node=" + node + "]");
for (NodeListener nodeListener : nodeListeners) {
nodeListener.nodeConnected(node);
}
* The cause of the failure
*/
private void fireNodeConnectionFailed(Node node, Throwable cause) {
+ logger.finest("firing nodeConnectionFailed event with [node=" + node + ",cause=" + cause + "]");
for (NodeListener nodeListener : nodeListeners) {
nodeListener.nodeConnectionFailed(node, cause);
}
* if there was no exception
*/
private void fireNodeDisconnected(Node node, Throwable throwable) {
+ logger.finest("firing nodeDisconnected event with [node=" + node + ",throwable=" + throwable + "]");
for (NodeListener nodeListener : nodeListeners) {
nodeListener.nodeDisconnected(node, throwable);
}
* if an I/O error occurs loading the nodes
*/
public void load() throws IOException {
+ logger.finest("load()");
File directoryFile = new File(directory);
File nodeFile = new File(directoryFile, "nodes.properties");
if (!nodeFile.exists() || !nodeFile.isFile() || !nodeFile.canRead()) {
* if an I/O error occurs saving the nodes
*/
public void save() throws IOException {
+ logger.finest("save()");
File directoryFile = new File(directory);
if (!directoryFile.exists()) {
if (!directoryFile.mkdirs()) {
* if the node was not added because it was already known
*/
public boolean addNode(Node node) {
+ logger.finest("addNode(node=" + node + ")");
if (nodes.contains(node)) {
logger.warning("was told to add already known node: " + node);
return false;
* The node to remove
*/
public void removeNode(Node node) {
+ logger.finest("removeNode(node=" + node + ")");
synchronized (syncObject) {
if (!nodes.contains(node)) {
return;
* The node to connect to
*/
public void connect(Node node) {
+ logger.finest("connect(node=" + node + ")");
HighLevelClient highLevelClient;
highLevelClient = nodeClients.get(node);
if (highLevelClient == null) {
* The node to disconnect
*/
public void disconnect(Node node) {
+ logger.finest("disconnect(node=" + node + ")");
synchronized (syncObject) {
if (!nodes.contains(node)) {
return;
* if there is a problem with the node
*/
public String[] generateKeyPair() throws IOException, JSiteException {
+ logger.finest("generateKeyPair()");
if (nodes.isEmpty()) {
throw new NoNodeException("no node configured");
}
* {@inheritDoc}
*/
public void clientConnected(HighLevelClient highLevelClient) {
- logger.log(Level.FINER, "clientConnected(c=" + highLevelClient + ")");
+ logger.finest("clientConnected(highLevelClient=" + highLevelClient + ")");
Node node = clientNodes.get(highLevelClient);
if (node == null) {
logger.log(Level.WARNING, "got event for unknown client");
* {@inheritDoc}
*/
public void clientDisconnected(HighLevelClient highLevelClient, Throwable throwable) {
- logger.log(Level.FINER, "clientDisconnected(c=" + highLevelClient + ",t=" + throwable + ")");
+ logger.finest("clientDisconnected(highLevelClient=" + highLevelClient + ",throwable=" + throwable + ")");
synchronized (syncObject) {
Node node = clientNodes.get(highLevelClient);
if (node == null) {