Search in sources :

Example 1 with LogStatsInformation

use of alma.Logging.ACSLogStatisticsPackage.LogStatsInformation in project ACS by ACS-Community.

the class AcsContainer method get_statistics_logger_configuration.

// ///////////////////////////////////////////////////////////
// ACSLogStatistics interface
// ///////////////////////////////////////////////////////////
/** 
     * Gets the names and status of all statistics modules of all loggers, to allow configuring them individually.
     * If the logger statistics module has never been configured yet, then it will provide "Undefined"
     * as elementName 
     */
public LogStatsInformation[] get_statistics_logger_configuration() {
    tryToWaitForContainerStart();
    // Temporal list to store logger information
    ArrayList<LogStatsInformation> statsInfoList = new ArrayList<LogStatsInformation>();
    // Retrieve logger names 
    Set<String> loggerNames = logConfig.getLoggerNames();
    // Retrieve actual loggers information
    Iterator iterator = loggerNames.iterator();
    while (iterator.hasNext()) {
        // Get logger item
        String name = (String) iterator.next();
        AcsLogger retrievedLogger = ClientLogManager.getAcsLogManager().getLoggerByName(name);
        // Store relevant logger information
        statsInfoList.add(new LogStatsInformation(retrievedLogger.stats.getStatisticsIdentification(), retrievedLogger.getName(), retrievedLogger.stats.getDisableStatistics(), retrievedLogger.stats.getStatisticsCalculationPeriod(), retrievedLogger.stats.getStatisticsGranularity()));
    }
    // Structure from IDL to store retrieved logger statistics module relevant information
    LogStatsInformation[] statsInfoSeq = new LogStatsInformation[statsInfoList.size()];
    // Conversion from temp list to array
    statsInfoSeq = statsInfoList.toArray(statsInfoSeq);
    return statsInfoSeq;
}
Also used : ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) LogStatsInformation(alma.Logging.ACSLogStatisticsPackage.LogStatsInformation) AcsLogger(alma.acs.logging.AcsLogger)

Example 2 with LogStatsInformation

use of alma.Logging.ACSLogStatisticsPackage.LogStatsInformation in project ACS by ACS-Community.

the class AcsContainer method get_statistics_logger_configuration_byname.

/** 
     * Gets the names and status of statistics module of requested logger.
     * If the logger statistics module has never been configured yet, then it will provide "Undefined"
     * as elementName 
     * Throws LoggerDoesNotExistEx if a the logger is not found
     */
public LogStatsInformation get_statistics_logger_configuration_byname(String logger_name) throws alma.Logging.LoggerDoesNotExistEx {
    // Retrieve logger by logger name
    AcsLogger retrievedLogger = ClientLogManager.getAcsLogManager().getLoggerByName(logger_name);
    // Verification if logger does exist (!= null)
    if (retrievedLogger == null) {
        LoggerDoesNotExistEx inexistantLoggerEx = new LoggerDoesNotExistEx(logger_name);
        throw inexistantLoggerEx;
    }
    // Store logger statistics configuration
    LogStatsInformation statsInfo = new LogStatsInformation(retrievedLogger.stats.getStatisticsIdentification(), retrievedLogger.getName(), retrievedLogger.stats.getDisableStatistics(), retrievedLogger.stats.getStatisticsCalculationPeriod(), retrievedLogger.stats.getStatisticsGranularity());
    return statsInfo;
}
Also used : LoggerDoesNotExistEx(alma.Logging.LoggerDoesNotExistEx) LogStatsInformation(alma.Logging.ACSLogStatisticsPackage.LogStatsInformation) AcsLogger(alma.acs.logging.AcsLogger)

Aggregations

LogStatsInformation (alma.Logging.ACSLogStatisticsPackage.LogStatsInformation)2 AcsLogger (alma.acs.logging.AcsLogger)2 LoggerDoesNotExistEx (alma.Logging.LoggerDoesNotExistEx)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1