Search in sources :

Example 6 with AdvancedComponentClient

use of alma.acs.component.client.AdvancedComponentClient in project ACS by ACS-Community.

the class LongRunTest method connectACSComponentClient.

/**
	 * Connect to ACS as component client.
	 * It connects client and the logger.
	 * 
	 * @return True if the connection is ok
	 */
private boolean connectACSComponentClient() {
    String clientName = "Mount GUI";
    logger = ClientLogManager.getAcsLogManager().getLoggerForApplication(clientName, true);
    if (logger == null) {
        System.err.println("Error getting the logger");
        return false;
    }
    String managerLoc = System.getProperty("ACS.manager").trim();
    try {
        client = new AdvancedComponentClient(logger, managerLoc, clientName);
        logger.log(AcsLogLevel.INFO, "Connected to ACS");
    } catch (Exception e) {
        logger.log(AcsLogLevel.ERROR, "Error connecting the simple client: " + e.getMessage());
        client = null;
    }
    return (client != null);
}
Also used : AdvancedComponentClient(alma.acs.component.client.AdvancedComponentClient)

Aggregations

AdvancedComponentClient (alma.acs.component.client.AdvancedComponentClient)6 Logger (java.util.logging.Logger)2 SourceClient (alma.alarmsystem.clients.SourceClient)1