Package org.opennms.netmgt.syslogd
Class ConvertToEvent
- java.lang.Object
-
- org.opennms.netmgt.syslogd.ConvertToEvent
-
public class ConvertToEvent extends 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 StringHIDDEN_MESSAGEConstantHIDDEN_MESSAGE="The message logged has been removed due"{trunked}
-
Constructor Summary
Constructors Constructor Description ConvertToEvent(String systemId, String location, InetAddress addr, int port, ByteBuffer incoming, Date receivedTimestamp, SyslogdConfig config, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,String> dnsCache)Constructs a new event encapsulation instance based upon the information passed to the method.ConvertToEvent(String systemId, String location, InetAddress addr, int port, 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 EventgetEvent()getEventstatic EventBuildertoEventBuilder(SyslogMessage message, String systemId, String location)static EventBuildertoEventBuilder(SyslogMessage message, String systemId, String location, Date receivedTimestamp, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,String> dnsCache)StringtoString()toStringstatic ByteBuffertrimTrailingNulls(ByteBuffer original)Reduce the limit of the buffer to trim trailing nulls from the value.
-
-
-
Field Detail
-
HIDDEN_MESSAGE
protected static final String HIDDEN_MESSAGE
ConstantHIDDEN_MESSAGE="The message logged has been removed due"{trunked}- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConvertToEvent
public ConvertToEvent(String systemId, String location, InetAddress addr, int port, 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_ASCIIcharacter encoding.- Parameters:
systemId-location-addr- The remote agent's address.port- The remote agent's portincoming- The syslog datagram inStandardCharsets.US_ASCIIencoding.config- The Syslogd configuration- Throws:
MessageDiscardedException
-
ConvertToEvent
public ConvertToEvent(String systemId, String location, InetAddress addr, int port, ByteBuffer incoming, Date receivedTimestamp, SyslogdConfig config, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,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_ASCIIcharacter encoding.- Parameters:
systemId-location-addr- The remote agent's address.port- The remote agent's portincoming- The syslog datagram inStandardCharsets.US_ASCIIencoding.receivedTimestamp- the time the message was receivedconfig- The Syslogd configurationlocationAwareDnsLookupClient- Location Aware DNS Lookup ClientdnsCache-- Throws:
MessageDiscardedException
-
-
Method Detail
-
trimTrailingNulls
public static ByteBuffer trimTrailingNulls(ByteBuffer original)
Reduce the limit of the buffer to trim trailing nulls from the value.- Parameters:
original- ByteBuffer- Returns:
- A new
ByteBufferrepresenting the trimmed value.
-
toEventBuilder
public static final EventBuilder toEventBuilder(SyslogMessage message, String systemId, String location)
-
toEventBuilder
public static final EventBuilder toEventBuilder(SyslogMessage message, String systemId, String location, Date receivedTimestamp, LocationAwareDnsLookupClient locationAwareDnsLookupClient, com.google.common.cache.Cache<HostNameWithLocationKey,String> dnsCache)
-
-