All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fluxtion.api.audit.EventLogControlEvent Maven / Gradle / Ivy

/*
 * Copyright (C) 2020 V12 Technology Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the Server Side Public License, version 1,
 * as published by MongoDB, Inc.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Server Side License for more details.
 *
 * You should have received a copy of the Server Side Public License
 * along with this program.  If not, see 
 * .
 */
package com.fluxtion.api.audit;

import com.fluxtion.api.event.Event;

/**
 * Control message to manage the audit logging of events by the
 * {@link EventLogManager} at runtime. Configurable options:
 * 
    *
  • Log level of an EventLogSource instance with {@link #sourceId}. *
  • Log level of a group EventLogSource with {@link #groupId}. *
  • Log level of all EventLogSource instances. *
  • The LogRecordListener to process LogRecords. *
* * * @author Greg Higgins ([email protected]) */ public class EventLogControlEvent implements Event { private LogLevel level; /** * The name of the node to apply the configuration to. A null value, the * default, is no filtering and configuration will be applied to all nodes. */ private String sourceId; /** * The group Id of a SEP to apply the configuration to. A null value, the * default, is no filtering and configuration will be applied to all SEP's. */ private String groupId; private LogRecordListener logRecordProcessor; public EventLogControlEvent() { this(LogLevel.INFO); } public EventLogControlEvent(LogLevel level) { this(null, null, level); } public EventLogControlEvent(LogRecordListener logRecordProcessor) { this(null, null, null); this.logRecordProcessor = logRecordProcessor; } public EventLogControlEvent(String sourceId, String groupId, LogLevel level) { this.sourceId = sourceId; this.groupId = groupId; this.level = level; } public EventLogControlEvent(String sourceId, String groupId, LogLevel level, LogRecordListener logRecordProcessor) { this.sourceId = sourceId; this.groupId = groupId; this.logRecordProcessor = logRecordProcessor; this.level = level; } public LogLevel getLevel() { return level; } public String getSourceId() { return sourceId; } public String getGroupId() { return groupId; } public LogRecordListener getLogRecordProcessor() { return logRecordProcessor; } public enum LogLevel { NONE(Integer.MAX_VALUE), ERROR(1), WARN(2), INFO(3), DEBUG(4), TRACE(5); private LogLevel(int level) { this.level = level; } public final int level; } @Override public String toString() { return "EventLogConfig{" + "level=" + level + ", logRecordProcessor=" + logRecordProcessor + ", sourceId=" + sourceId + ", groupId=" + groupId + '}'; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy