001: /*
002: * $Header: /export/home/cvsroot/MyPersonalizerRepository/MyPersonalizer/Subsystems/Kernel/Sources/es/udc/mypersonalizer/kernel/config/LogConfig.java,v 1.1.1.1 2004/03/25 12:08:38 fbellas Exp $
003: * $Revision: 1.1.1.1 $
004: * $Date: 2004/03/25 12:08:38 $
005: *
006: * =============================================================================
007: *
008: * Copyright (c) 2003, The MyPersonalizer Development Group
009: * (http://www.tic.udc.es/~fbellas/mypersonalizer/index.html) at
010: * University Of A Coruna
011: * All rights reserved.
012: *
013: * Redistribution and use in source and binary forms, with or without
014: * modification, are permitted provided that the following conditions are met:
015: *
016: * - Redistributions of source code must retain the above copyright notice,
017: * this list of conditions and the following disclaimer.
018: *
019: * - Redistributions in binary form must reproduce the above copyright notice,
020: * this list of conditions and the following disclaimer in the documentation
021: * and/or other materials provided with the distribution.
022: *
023: * - Neither the name of the University Of A Coruna nor the names of its
024: * contributors may be used to endorse or promote products derived from
025: * this software without specific prior written permission.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
028: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
029: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
030: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
031: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
032: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
033: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
034: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
035: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
036: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
037: * POSSIBILITY OF SUCH DAMAGE.
038: *
039: */
040:
041: package es.udc.mypersonalizer.kernel.config;
042:
043: /**
044: * This is the configuration bean for each of the logs declared in the system. It
045: * takes its data from the <code>log</code> tag belonging to the
046: * <code>log-manager</code> in the Kernel configuration file. It contains:
047: * <ul>
048: * <li>A <b>name</b> for the log.</li>
049: * <li>A <b>log file</b> for the log.</li>
050: * <li>The <b>maximum size</b> the log file can reach.</li>
051: * <li>The maximum number of <b>backup files</b> that this log can
052: * create.</li>
053: * <li>Whether this log may <b>display messages on console</b> or not.</li>
054: * </ul>
055: *
056: * @author Daniel Fernandez
057: * @since 1.0
058: */
059: public class LogConfig {
060:
061: /** The name of the log. */
062: private String name = null;
063:
064: /** The name of the log file. */
065: private String logFile = null;
066:
067: /** The maximum size (in bytes) the log file can reach. */
068: private String maxLogSizeBytes = null;
069:
070: /** The maximum number of backup files that can be created for this log. */
071: private String maxBackupFiles = null;
072:
073: /** Flag that indicates whether this log displays its messages to console or not. */
074: private String displayOnConsole = null;
075:
076: /** Creates a new instance of LogConfig. */
077: public LogConfig() {
078: }
079:
080: /**
081: * Returns the name of the log.
082: *
083: * @return a String with the name of the log.
084: */
085: public String getName() {
086: return name;
087: }
088:
089: /**
090: * Sets a new name for this log.
091: *
092: * @param name the new name
093: */
094: public void setName(String name) {
095: this .name = name;
096: }
097:
098: /**
099: * Returns the name of the log file beloging to this log.
100: *
101: * @return a String with the name of the log file.
102: */
103: public String getLogFile() {
104: return logFile;
105: }
106:
107: /**
108: * Sets a new name for the log file.
109: *
110: * @param logFile the new name
111: */
112: public void setLogFile(String logFile) {
113: this .logFile = logFile;
114: }
115:
116: /**
117: * Returns the maximum size (in bytes) that the log file related to this
118: * log can reach.
119: *
120: * @return a String with the size limit.
121: */
122: public String getMaxLogSizeBytes() {
123: return maxLogSizeBytes;
124: }
125:
126: /**
127: * Sets a new size limit (in bytes) for the log file.
128: *
129: * @param maxLogSizeBytes the new size in bytes, in a String.
130: */
131: public void setMaxLogSizeBytes(String maxLogSizeBytes) {
132: this .maxLogSizeBytes = maxLogSizeBytes;
133: }
134:
135: /**
136: * Returns the maximum number of backup files (created when the log file
137: * reaches its size limit) that can be handled.
138: *
139: * @return a String with the maximum number of backup files to be allowed.
140: */
141: public String getMaxBackupFiles() {
142: return maxBackupFiles;
143: }
144:
145: /**
146: * Sets a new value for the number of backup files that can be created
147: * for a log.
148: *
149: * @param maxBackupFiles the new number of backup files.
150: */
151: public void setMaxBackupFiles(String maxBackupFiles) {
152: this .maxBackupFiles = maxBackupFiles;
153: }
154:
155: /**
156: * Returns a String establishing whether a log may be displayed on
157: * console or not.
158: *
159: * @return a String with the value of the displayOnConsole parameter.
160: */
161: public String getDisplayOnConsole() {
162: return displayOnConsole;
163: }
164:
165: /**
166: * Sets a new value for the parameters that establishes whether a log will
167: * show on console or not.
168: *
169: * @param displayOnConsole the new value for the displayOnConsole parameter.
170: */
171: public void setDisplayOnConsole(String displayOnConsole) {
172: this.displayOnConsole = displayOnConsole;
173: }
174:
175: }
|