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

com.nesscomputing.syslog4j.server.impl.AbstractSyslogServerConfig Maven / Gradle / Ivy

Go to download

Syslog4j provides client and server implementations of the BSD Syslog protocol (RFC 3164) and the structured syslog" protocol (RFC5424).

There is a newer version: 0.9.47-NESS-8
Show newest version
/**
 *
 * (C) Copyright 2008-2011 syslog4j.org
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library 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 GNU
 * Lesser General Public License for more details.
 */
package com.nesscomputing.syslog4j.server.impl;

import static com.nesscomputing.syslog4j.SyslogConstants.THREAD_PRIORITY_DEFAULT;
import static com.nesscomputing.syslog4j.SyslogConstants.USE_DAEMON_THREAD_DEFAULT;
import static com.nesscomputing.syslog4j.SyslogConstants.USE_STRUCTURED_DATA_DEFAULT;

import java.nio.charset.Charset;
import java.util.List;


import com.google.common.base.Charsets;
import com.google.common.collect.Lists;
import com.nesscomputing.syslog4j.SyslogConstants;
import com.nesscomputing.syslog4j.server.SyslogServerConfigIF;
import com.nesscomputing.syslog4j.server.SyslogServerEventHandlerIF;
import com.nesscomputing.syslog4j.server.SyslogServerIF;
/**
* AbstractSyslogServerConfig provides a base abstract implementation of the SyslogServerConfigIF
* configuration interface.
*
* 

Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy * of the LGPL license is available in the META-INF folder in all * distributions of Syslog4j and in the base directory of the "doc" ZIP.

* * @author <[email protected]> * @version $Id: AbstractSyslogServerConfig.java,v 1.9 2011/01/11 05:11:13 cvs Exp $ */ public abstract class AbstractSyslogServerConfig implements SyslogServerConfigIF { public abstract Class getSyslogServerClass(); protected Charset charSet = Charsets.UTF_8; protected long shutdownWait = SyslogConstants.SERVER_SHUTDOWN_WAIT_DEFAULT; protected List eventHandlers = Lists.newArrayList(); protected boolean useStructuredData = USE_STRUCTURED_DATA_DEFAULT; protected Object dateTimeFormatter = null; protected boolean useDaemonThread = USE_DAEMON_THREAD_DEFAULT; protected int threadPriority = THREAD_PRIORITY_DEFAULT; @Override public Charset getCharSet() { return this.charSet; } @Override public void setCharSet(Charset charSet) { this.charSet = charSet; } public long getShutdownWait() { return this.shutdownWait; } public void setShutdownWait(long shutdownWait) { this.shutdownWait = shutdownWait; } public List getEventHandlers() { return this.eventHandlers; } public void addEventHandler(SyslogServerEventHandlerIF eventHandler) { this.eventHandlers.add(eventHandler); } public void insertEventHandler(int pos, SyslogServerEventHandlerIF eventHandler) { this.eventHandlers.add(pos, eventHandler); } public void removeEventHandler(SyslogServerEventHandlerIF eventHandler) { this.eventHandlers.remove(eventHandler); } public void removeAllEventHandlers() { this.eventHandlers.clear(); } public boolean isUseStructuredData() { return useStructuredData; } public void setUseStructuredData(boolean useStructuredData) { this.useStructuredData = useStructuredData; } public boolean isUseDaemonThread() { return useDaemonThread; } public Object getDateTimeFormatter() { return dateTimeFormatter; } public void setDateTimeFormatter(Object dateTimeFormatter) { this.dateTimeFormatter = dateTimeFormatter; } public void setUseDaemonThread(boolean useDaemonThread) { this.useDaemonThread = useDaemonThread; } public int getThreadPriority() { return threadPriority; } public void setThreadPriority(int threadPriority) { this.threadPriority = threadPriority; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy