<commit_before>package com.hp.nga.integrations.bridge;

import com.hp.nga.integrations.configuration.ServerConfiguration;

import java.util.logging.Logger;

/**
 * Created by gullery on 05/08/2015.
 * <p/>
 * Bridge Service meant to provide an abridged connectivity functionality
 * The only APIs to be exposed is the basic management of abridged clients
 */

public class BridgeService {
	private static final Logger logger = Logger.getLogger(BridgeService.class.getName());

	private static final BridgeService instance = new BridgeService();
	private BridgeClient bridgeClient;

	private BridgeService() {
	}

	public static BridgeService getInstance() {
		return instance;
	}

	public void updateBridge(ServerConfiguration config) {
		if (config.isValid()) {
			if (bridgeClient != null) {
				bridgeClient.update(config);
			} else {
				bridgeClient = new BridgeClient(config);
			}
		} else {
			if (bridgeClient != null) {
				logger.info("BRIDGE: empty / non-valid configuration submitted, disposing bridge client");
				bridgeClient.dispose();
				bridgeClient = null;
			}
		}
	}
}
<commit_msg>tech: preps for loopback disabling<commit_after>package com.hp.nga.integrations.bridge;

import com.hp.nga.integrations.configuration.ServerConfiguration;

import java.util.logging.Logger;

/**
 * Created by gullery on 05/08/2015.
 * <p/>
 * Bridge Service meant to provide an abridged connectivity functionality
 * The only APIs to be exposed is the basic management of abridged clients
 */

public class BridgeService {
	private static final Logger logger = Logger.getLogger(BridgeService.class.getName());

	private static final BridgeService instance = new BridgeService();
	private BridgeClient bridgeClient;

	private BridgeService() {
	}

	public static BridgeService getInstance() {
		return instance;
	}

	public void updateBridge(ServerConfiguration config) {
		if (config.isValid()) {
			if (bridgeClient != null) {
				bridgeClient.update(config);
			} else {
				bridgeClient = new BridgeClient();
			}
		} else {
			if (bridgeClient != null) {
				logger.info("BRIDGE: empty / non-valid configuration submitted, disposing bridge client");
				bridgeClient.dispose();
				bridgeClient = null;
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.09842696629213483, 'fraction_numerical': 0.0071910112359550565, 'mean_word_length': 4.164733178654292, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2408101', 'n_tokens_mistral': 701, 'n_tokens_neox': 615, 'n_words': 184}