org.opennms.netmgt.syslogd
Class SyslogTimeStamp

java.lang.Object
  extended by java.text.Format
      extended by org.opennms.netmgt.syslogd.SyslogTimeStamp
All Implemented Interfaces:
Serializable, Cloneable

public class SyslogTimeStamp
extends Format

The TimestampFormat class implements the code necessary to format and parse syslog timestamps, which come in the flavor of 'Sep 14 15:43:06'.

Version:
$Revision: 1.1.1.1 $
Author:
Timothy Gerard Endres, time@ice.com.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
Format.Field
 
Field Summary
static String DEFAULT_GMT_TZID
           
 
Constructor Summary
SyslogTimeStamp()
           
 
Method Summary
 String format(Date date)
           
 StringBuffer format(Object date, StringBuffer appendTo, FieldPosition fieldPos)
           
 String formatTimeZone(Date date, TimeZone tz)
           
static SyslogTimeStamp getInstance()
           
 Date parse(String source)
           
 Object parseObject(String source, ParsePosition pos)
           
 Date parseTimestamp(String source)
           
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_GMT_TZID

public static final String DEFAULT_GMT_TZID
See Also:
Constant Field Values
Constructor Detail

SyslogTimeStamp

public SyslogTimeStamp()
Method Detail

getInstance

public static final SyslogTimeStamp getInstance()

format

public String format(Date date)
              throws IllegalArgumentException
Throws:
IllegalArgumentException

formatTimeZone

public String formatTimeZone(Date date,
                             TimeZone tz)
                      throws IllegalArgumentException
Throws:
IllegalArgumentException

format

public StringBuffer format(Object date,
                           StringBuffer appendTo,
                           FieldPosition fieldPos)
                    throws IllegalArgumentException
Specified by:
format in class Format
Throws:
IllegalArgumentException

parse

public Date parse(String source)
           throws ParseException
Throws:
ParseException

parseObject

public Object parseObject(String source,
                          ParsePosition pos)
Specified by:
parseObject in class Format

parseTimestamp

public Date parseTimestamp(String source)
                    throws ParseException
Throws:
ParseException


Copyright © 2009. All Rights Reserved.