KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > protomatter > syslog > SyslogMessage


1 package com.protomatter.syslog;
2
3 /**
4  * {{{ The Protomatter Software License, Version 1.0
5  * derived from The Apache Software License, Version 1.1
6  *
7  * Copyright (c) 1998-2002 Nate Sammons. All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in
18  * the documentation and/or other materials provided with the
19  * distribution.
20  *
21  * 3. The end-user documentation included with the redistribution,
22  * if any, must include the following acknowledgment:
23  * "This product includes software developed for the
24  * Protomatter Software Project
25  * (http://protomatter.sourceforge.net/)."
26  * Alternately, this acknowledgment may appear in the software itself,
27  * if and wherever such third-party acknowledgments normally appear.
28  *
29  * 4. The names "Protomatter" and "Protomatter Software Project" must
30  * not be used to endorse or promote products derived from this
31  * software without prior written permission. For written
32  * permission, please contact support@protomatter.com.
33  *
34  * 5. Products derived from this software may not be called "Protomatter",
35  * nor may "Protomatter" appear in their name, without prior written
36  * permission of the Protomatter Software Project
37  * (support@protomatter.com).
38  *
39  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
40  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42  * DISCLAIMED. IN NO EVENT SHALL THE PROTOMATTER SOFTWARE PROJECT OR
43  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
46  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
47  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
49  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50  * SUCH DAMAGE. }}}
51  */

52
53 import java.util.*;
54 import java.net.*;
55
56 import com.protomatter.util.StackTraceInfo;
57
58 /**
59  * A utility class representing all the information needed
60  * to make a syslog call.
61  */

62 public class SyslogMessage
63 {
64    /**
65     * The address of the host making the call.
66     */

67    public InetAddress host = null;
68
69    /**
70     * The time the call was made.
71     */

72    public long time = 0L;
73
74    /**
75     * The channel the message is for.
76     */

77    public String JavaDoc channel = null;
78
79    /**
80     * The object making the syslog call.
81     */

82    public Object JavaDoc logger = null;
83
84    /**
85     * The classname of the logger.
86     */

87    public String JavaDoc loggerClassname = null;
88
89    /**
90     * The name of the method being called when
91     * the Syslog method call was made.
92     */

93    public String JavaDoc callingMethodName = null;
94
95    /**
96     * The line number in the calling object's
97     * source file, if known.
98     */

99    public int callingMethodLineNumber = StackTraceInfo.LINE_NUMBER_UNKNOWN;
100
101    /**
102     * The message.
103     */

104    public Object JavaDoc msg = null;
105
106    /**
107     * The detailed message.
108     */

109    public Object JavaDoc detail = null;
110
111    /**
112     * The log level.
113     */

114    public int level = 0;
115
116    /**
117     * The thread that made the log request.
118     */

119    public Thread JavaDoc thread = null;
120
121    /**
122     * The output of <tt>toString()</tt> on the thread that made the log request.
123     */

124    public String JavaDoc threadName = null;
125
126    /**
127     * Default constructor.
128     */

129    public SyslogMessage()
130    {
131      super();
132    }
133
134    /**
135     * A utility constructor.
136     */

137    public SyslogMessage(InetAddress host, long time, String JavaDoc channel,
138         Object JavaDoc logger, String JavaDoc loggerClassname,
139         Object JavaDoc msg, Object JavaDoc detail, int level,
140         Thread JavaDoc thread, String JavaDoc threadName, String JavaDoc methodName,
141         int lineNumber)
142    {
143      this();
144
145      this.host = host;
146      this.time = time;
147      this.channel = channel;
148      this.logger = logger;
149      this.loggerClassname = loggerClassname;
150      this.msg = msg;
151      this.detail = detail;
152      this.level = level;
153      this.thread = thread;
154      this.threadName = threadName;
155      this.callingMethodName = methodName;
156      this.callingMethodLineNumber = lineNumber;
157    }
158 }
159
Popular Tags