org.productivity.java.syslog4j.server.impl.event
Class SyslogServerEvent

java.lang.Object
  extended by org.productivity.java.syslog4j.server.impl.event.SyslogServerEvent
All Implemented Interfaces:
java.io.Serializable, SyslogServerEventIF, SyslogCharSetIF
Direct Known Subclasses:
StructuredSyslogServerEvent

public class SyslogServerEvent
extends java.lang.Object
implements SyslogServerEventIF

SyslogServerEvent provides an implementation of the SyslogServerEventIF 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.

Version:
$Id: SyslogServerEvent.java,v 1.9 2011/01/11 06:21:15 cvs Exp $
Author:
<syslog4j@productivity.org>
See Also:
Serialized Form

Field Summary
protected  java.lang.String charSet
           
protected  java.util.Date date
           
static java.lang.String DATE_FORMAT
           
protected  int facility
           
protected  java.lang.String host
           
protected  java.net.InetAddress inetAddress
           
protected  boolean isHostStrippedFromMessage
           
protected  int level
           
protected  java.lang.String message
           
protected  byte[] rawBytes
           
protected  int rawLength
           
protected  java.lang.String rawString
           
 
Constructor Summary
protected SyslogServerEvent()
           
  SyslogServerEvent(byte[] message, int length, java.net.InetAddress inetAddress)
           
  SyslogServerEvent(java.lang.String message, java.net.InetAddress inetAddress)
           
 
Method Summary
 java.lang.String getCharSet()
           
 java.util.Date getDate()
           
 int getFacility()
           
 java.lang.String getHost()
           
 int getLevel()
           
 java.lang.String getMessage()
           
 byte[] getRaw()
          Note: getRaw() may use System.arraycopy(..) each time it is called; best to call it once and store the result.
 int getRawLength()
           
protected  void initialize(byte[] message, int length, java.net.InetAddress inetAddress)
           
protected  void initialize(java.lang.String message, java.net.InetAddress inetAddress)
           
 boolean isHostStrippedFromMessage()
           
protected  void parse()
           
protected  void parseDate()
           
protected  void parseHost()
           
protected  void parsePriority()
           
 void setCharSet(java.lang.String charSet)
           
 void setDate(java.util.Date date)
           
 void setFacility(int facility)
           
 void setHost(java.lang.String host)
           
 void setLevel(int level)
           
 void setMessage(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static final java.lang.String DATE_FORMAT
See Also:
Constant Field Values

charSet

protected java.lang.String charSet

rawString

protected java.lang.String rawString

rawBytes

protected byte[] rawBytes

rawLength

protected int rawLength

date

protected java.util.Date date

level

protected int level

facility

protected int facility

host

protected java.lang.String host

isHostStrippedFromMessage

protected boolean isHostStrippedFromMessage

message

protected java.lang.String message

inetAddress

protected java.net.InetAddress inetAddress
Constructor Detail

SyslogServerEvent

protected SyslogServerEvent()

SyslogServerEvent

public SyslogServerEvent(java.lang.String message,
                         java.net.InetAddress inetAddress)

SyslogServerEvent

public SyslogServerEvent(byte[] message,
                         int length,
                         java.net.InetAddress inetAddress)
Method Detail

initialize

protected void initialize(java.lang.String message,
                          java.net.InetAddress inetAddress)

initialize

protected void initialize(byte[] message,
                          int length,
                          java.net.InetAddress inetAddress)

parseHost

protected void parseHost()

parseDate

protected void parseDate()

parsePriority

protected void parsePriority()

parse

protected void parse()

getFacility

public int getFacility()
Specified by:
getFacility in interface SyslogServerEventIF

setFacility

public void setFacility(int facility)
Specified by:
setFacility in interface SyslogServerEventIF

getRaw

public byte[] getRaw()
Description copied from interface: SyslogServerEventIF
Note: getRaw() may use System.arraycopy(..) each time it is called; best to call it once and store the result.

Specified by:
getRaw in interface SyslogServerEventIF
Returns:
Returns the raw data received from the client.

getRawLength

public int getRawLength()

getDate

public java.util.Date getDate()
Specified by:
getDate in interface SyslogServerEventIF

setDate

public void setDate(java.util.Date date)
Specified by:
setDate in interface SyslogServerEventIF

getLevel

public int getLevel()
Specified by:
getLevel in interface SyslogServerEventIF

setLevel

public void setLevel(int level)
Specified by:
setLevel in interface SyslogServerEventIF

getHost

public java.lang.String getHost()
Specified by:
getHost in interface SyslogServerEventIF

setHost

public void setHost(java.lang.String host)
Specified by:
setHost in interface SyslogServerEventIF

isHostStrippedFromMessage

public boolean isHostStrippedFromMessage()
Specified by:
isHostStrippedFromMessage in interface SyslogServerEventIF

getMessage

public java.lang.String getMessage()
Specified by:
getMessage in interface SyslogServerEventIF

setMessage

public void setMessage(java.lang.String message)
Specified by:
setMessage in interface SyslogServerEventIF

getCharSet

public java.lang.String getCharSet()
Specified by:
getCharSet in interface SyslogCharSetIF

setCharSet

public void setCharSet(java.lang.String charSet)
Specified by:
setCharSet in interface SyslogCharSetIF