Package org.opennms.netmgt.syslogd
Class ConvertToEvent
- java.lang.Object
-
- org.opennms.netmgt.syslogd.ConvertToEvent
-
public class ConvertToEvent extends java.lang.Object
This routine does the majority of Syslogd's work. Improvements are most likely to be made. TODO: This class is sloooow. It needs to be sped up significantly to handle increased syslog volume.- Author:
- Seth, Johan Edstrom, Mathew Brozowski, DJ Gregor, Mike Huot, Jeff Gehlbach, Brian Weaver
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
HIDDEN_MESSAGE
ConstantHIDDEN_MESSAGE="The message logged has been removed due"{trunked}
-
Constructor Summary
Constructors Constructor Description ConvertToEvent(java.lang.String systemId, java.lang.String location, java.net.InetAddress addr, int port, java.nio.ByteBuffer incoming, java.util.Date receivedTimestamp, SyslogdConfig config, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,java.lang.String> dnsCache)
Constructs a new event encapsulation instance based upon the information passed to the method.ConvertToEvent(java.lang.String systemId, java.lang.String location, java.net.InetAddress addr, int port, java.nio.ByteBuffer incoming, SyslogdConfig config, LocationAwareDnsLookupClient locationAwareDnsLookupClient)
Constructs a new event encapsulation instance based upon the information passed to the method.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Event
getEvent()
getEventstatic EventBuilder
toEventBuilder(SyslogMessage message, java.lang.String systemId, java.lang.String location)
static EventBuilder
toEventBuilder(SyslogMessage message, java.lang.String systemId, java.lang.String location, java.util.Date receivedTimestamp, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,java.lang.String> dnsCache)
java.lang.String
toString()
toStringstatic java.nio.ByteBuffer
trimTrailingNulls(java.nio.ByteBuffer original)
Reduce the limit of the buffer to trim trailing nulls from the value.
-
-
-
Field Detail
-
HIDDEN_MESSAGE
protected static final java.lang.String HIDDEN_MESSAGE
ConstantHIDDEN_MESSAGE="The message logged has been removed due"{trunked}
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConvertToEvent
public ConvertToEvent(java.lang.String systemId, java.lang.String location, java.net.InetAddress addr, int port, java.nio.ByteBuffer incoming, SyslogdConfig config, LocationAwareDnsLookupClient locationAwareDnsLookupClient) throws MessageDiscardedException
Constructs a new event encapsulation instance based upon the information passed to the method. The passed byte array is decoded into a string using theStandardCharsets.US_ASCII
character encoding.- Parameters:
systemId
-location
-addr
- The remote agent's address.port
- The remote agent's portincoming
- The syslog datagram inStandardCharsets.US_ASCII
encoding.config
- The Syslogd configuration- Throws:
MessageDiscardedException
-
ConvertToEvent
public ConvertToEvent(java.lang.String systemId, java.lang.String location, java.net.InetAddress addr, int port, java.nio.ByteBuffer incoming, java.util.Date receivedTimestamp, SyslogdConfig config, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,java.lang.String> dnsCache) throws MessageDiscardedException
Constructs a new event encapsulation instance based upon the information passed to the method. The passed byte array is decoded into a string using theStandardCharsets.US_ASCII
character encoding.- Parameters:
systemId
-location
-addr
- The remote agent's address.port
- The remote agent's portincoming
- The syslog datagram inStandardCharsets.US_ASCII
encoding.receivedTimestamp
- the time the message was receivedconfig
- The Syslogd configurationlocationAwareDnsLookupClient
- Location Aware DNS Lookup ClientdnsCache
-- Throws:
MessageDiscardedException
-
-
Method Detail
-
trimTrailingNulls
public static java.nio.ByteBuffer trimTrailingNulls(java.nio.ByteBuffer original)
Reduce the limit of the buffer to trim trailing nulls from the value.- Parameters:
original
- ByteBuffer- Returns:
- A new
ByteBuffer
representing the trimmed value.
-
toEventBuilder
public static final EventBuilder toEventBuilder(SyslogMessage message, java.lang.String systemId, java.lang.String location)
-
toEventBuilder
public static final EventBuilder toEventBuilder(SyslogMessage message, java.lang.String systemId, java.lang.String location, java.util.Date receivedTimestamp, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,java.lang.String> dnsCache)
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
-