Class SyslogDestination
- java.lang.Object
-
- org.opennms.netmgt.alarmd.northbounder.syslog.SyslogDestination
-
- All Implemented Interfaces:
java.io.Serializable
,Destination
public class SyslogDestination extends java.lang.Object implements Destination
Configuration for the various Syslog hosts to receive alarms via Syslog.- Author:
- David Hustace
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyslogDestination.SyslogFacility
The Enumeration SyslogFacility.static class
SyslogDestination.SyslogProtocol
The Enumeration SyslogProtocol.
-
Constructor Summary
Constructors Constructor Description SyslogDestination()
Instantiates a new Syslog destination.SyslogDestination(java.lang.String name, SyslogDestination.SyslogProtocol protocol, SyslogDestination.SyslogFacility facility)
Instantiates a new Syslog destination.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCharSet()
Gets the char set.java.lang.String
getCustomMessageFormat(NorthboundAlarm alarm)
Gets the custom message format.SyslogDestination.SyslogFacility
getFacility()
Gets the facility.java.util.List<SyslogFilter>
getFilters()
Gets the filters.java.lang.String
getHost()
Gets the host.java.lang.Integer
getMaxMessageLength()
Gets the max message length.java.lang.String
getName()
Gets the destination name.java.lang.Integer
getPort()
Gets the port.SyslogDestination.SyslogProtocol
getProtocol()
Gets the protocol.boolean
isFirstOccurrenceOnly()
Checks if is first occurrence only.java.lang.Boolean
isSendLocalName()
Checks if is send local name flag.java.lang.Boolean
isSendLocalTime()
Checks if is send local time flag.java.lang.Boolean
isTruncateMessage()
Checks if is truncate message flag.boolean
passFilter(NorthboundAlarm alarm)
Pass filter.void
setCharSet(java.lang.String charSet)
Sets the char set.void
setFilters(java.util.List<SyslogFilter> filters)
Sets the filters.void
setFirstOccurrenceOnly(java.lang.Boolean firstOccurrenceOnly)
Sets the first occurrence only.void
setHost(java.lang.String m_host)
Sets the host.void
setMaxMessageLength(java.lang.Integer maxMessageLength)
Sets the max message length.void
setName(java.lang.String name)
Sets the name.void
setPort(java.lang.Integer m_port)
Sets the port.void
setProtocol(SyslogDestination.SyslogProtocol m_protocol)
Sets the protocol.void
setSendLocalName(java.lang.Boolean sendLocalName)
Sets the send local name flag.void
setSendLocalTime(java.lang.Boolean sendLocalTime)
Sets the send local time flag.void
setTruncateMessage(java.lang.Boolean truncateMessage)
Sets the truncate message flag.
-
-
-
Constructor Detail
-
SyslogDestination
public SyslogDestination()
Instantiates a new Syslog destination.
-
SyslogDestination
public SyslogDestination(java.lang.String name, SyslogDestination.SyslogProtocol protocol, SyslogDestination.SyslogFacility facility)
Instantiates a new Syslog destination.- Parameters:
name
- the nameprotocol
- the protocolfacility
- the facility
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:Destination
Gets the destination name.- Specified by:
getName
in interfaceDestination
- Returns:
- the destination name
-
setName
public void setName(java.lang.String name)
Sets the name.- Parameters:
name
- the new name
-
getHost
public java.lang.String getHost()
Gets the host.- Returns:
- the host
-
setHost
public void setHost(java.lang.String m_host)
Sets the host.- Parameters:
m_host
- the new host
-
getPort
public java.lang.Integer getPort()
Gets the port.- Returns:
- the port
-
setPort
public void setPort(java.lang.Integer m_port)
Sets the port.- Parameters:
m_port
- the new port
-
getProtocol
public SyslogDestination.SyslogProtocol getProtocol()
Gets the protocol.- Returns:
- the protocol
-
setProtocol
public void setProtocol(SyslogDestination.SyslogProtocol m_protocol)
Sets the protocol.- Parameters:
m_protocol
- the new protocol
-
getFacility
public SyslogDestination.SyslogFacility getFacility()
Gets the facility.- Returns:
- the facility
-
getCharSet
public java.lang.String getCharSet()
Gets the char set.- Returns:
- the char set
-
setCharSet
public void setCharSet(java.lang.String charSet)
Sets the char set.- Parameters:
charSet
- the new char set
-
getMaxMessageLength
public java.lang.Integer getMaxMessageLength()
Gets the max message length.- Returns:
- the max message length
-
setMaxMessageLength
public void setMaxMessageLength(java.lang.Integer maxMessageLength)
Sets the max message length.- Parameters:
maxMessageLength
- the new max message length
-
isSendLocalName
public java.lang.Boolean isSendLocalName()
Checks if is send local name flag.- Returns:
- true, if is send local name flag
-
setSendLocalName
public void setSendLocalName(java.lang.Boolean sendLocalName)
Sets the send local name flag.- Parameters:
sendLocalName
- the new send local name flag
-
isSendLocalTime
public java.lang.Boolean isSendLocalTime()
Checks if is send local time flag.- Returns:
- true, if is send local time flag
-
setSendLocalTime
public void setSendLocalTime(java.lang.Boolean sendLocalTime)
Sets the send local time flag.- Parameters:
sendLocalTime
- the new send local time flag
-
isTruncateMessage
public java.lang.Boolean isTruncateMessage()
Checks if is truncate message flag.- Returns:
- true, if is truncate message flag
-
setTruncateMessage
public void setTruncateMessage(java.lang.Boolean truncateMessage)
Sets the truncate message flag.- Parameters:
truncateMessage
- the new truncate message flag
-
isFirstOccurrenceOnly
public boolean isFirstOccurrenceOnly()
Description copied from interface:Destination
Checks if is first occurrence only.- Specified by:
isFirstOccurrenceOnly
in interfaceDestination
- Returns:
- true, if is first occurrence only
-
setFirstOccurrenceOnly
public void setFirstOccurrenceOnly(java.lang.Boolean firstOccurrenceOnly)
Sets the first occurrence only.- Parameters:
firstOccurrenceOnly
- the new first occurrence only
-
getFilters
public java.util.List<SyslogFilter> getFilters()
Gets the filters.- Returns:
- the filters
-
setFilters
public void setFilters(java.util.List<SyslogFilter> filters)
Sets the filters.- Parameters:
filters
- the new filters
-
passFilter
public boolean passFilter(NorthboundAlarm alarm)
Pass filter.If the destination doesn't have filter, the method will return true.
If the method has filters, they will be evaluated. If no filters are satisfied, the method will return false. Otherwise, the method will return true as soon as one filter is satisfied.
- Parameters:
alarm
- the alarm- Returns:
- true, if successful
-
getCustomMessageFormat
public java.lang.String getCustomMessageFormat(NorthboundAlarm alarm)
Gets the custom message format.- Parameters:
alarm
- the alarm- Returns:
- the custom message format
-
-