Class SyslogDestination
- java.lang.Object
-
- org.opennms.netmgt.alarmd.northbounder.syslog.SyslogDestination
-
- All Implemented Interfaces:
Serializable,Destination
public class SyslogDestination extends 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 classSyslogDestination.SyslogFacilityThe Enumeration SyslogFacility.static classSyslogDestination.SyslogProtocolThe Enumeration SyslogProtocol.
-
Constructor Summary
Constructors Constructor Description SyslogDestination()Instantiates a new Syslog destination.SyslogDestination(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 StringgetCharSet()Gets the char set.StringgetCustomMessageFormat(NorthboundAlarm alarm)Gets the custom message format.SyslogDestination.SyslogFacilitygetFacility()Gets the facility.List<SyslogFilter>getFilters()Gets the filters.StringgetHost()Gets the host.IntegergetMaxMessageLength()Gets the max message length.StringgetName()Gets the destination name.IntegergetPort()Gets the port.SyslogDestination.SyslogProtocolgetProtocol()Gets the protocol.booleanisFirstOccurrenceOnly()Checks if is first occurrence only.BooleanisSendLocalName()Checks if is send local name flag.BooleanisSendLocalTime()Checks if is send local time flag.BooleanisTruncateMessage()Checks if is truncate message flag.booleanpassFilter(NorthboundAlarm alarm)Pass filter.voidsetCharSet(String charSet)Sets the char set.voidsetFilters(List<SyslogFilter> filters)Sets the filters.voidsetFirstOccurrenceOnly(Boolean firstOccurrenceOnly)Sets the first occurrence only.voidsetHost(String m_host)Sets the host.voidsetMaxMessageLength(Integer maxMessageLength)Sets the max message length.voidsetName(String name)Sets the name.voidsetPort(Integer m_port)Sets the port.voidsetProtocol(SyslogDestination.SyslogProtocol m_protocol)Sets the protocol.voidsetSendLocalName(Boolean sendLocalName)Sets the send local name flag.voidsetSendLocalTime(Boolean sendLocalTime)Sets the send local time flag.voidsetTruncateMessage(Boolean truncateMessage)Sets the truncate message flag.
-
-
-
Constructor Detail
-
SyslogDestination
public SyslogDestination()
Instantiates a new Syslog destination.
-
SyslogDestination
public SyslogDestination(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 String getName()
Description copied from interface:DestinationGets the destination name.- Specified by:
getNamein interfaceDestination- Returns:
- the destination name
-
setName
public void setName(String name)
Sets the name.- Parameters:
name- the new name
-
getHost
public String getHost()
Gets the host.- Returns:
- the host
-
setHost
public void setHost(String m_host)
Sets the host.- Parameters:
m_host- the new host
-
getPort
public Integer getPort()
Gets the port.- Returns:
- the port
-
setPort
public void setPort(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 String getCharSet()
Gets the char set.- Returns:
- the char set
-
setCharSet
public void setCharSet(String charSet)
Sets the char set.- Parameters:
charSet- the new char set
-
getMaxMessageLength
public Integer getMaxMessageLength()
Gets the max message length.- Returns:
- the max message length
-
setMaxMessageLength
public void setMaxMessageLength(Integer maxMessageLength)
Sets the max message length.- Parameters:
maxMessageLength- the new max message length
-
isSendLocalName
public Boolean isSendLocalName()
Checks if is send local name flag.- Returns:
- true, if is send local name flag
-
setSendLocalName
public void setSendLocalName(Boolean sendLocalName)
Sets the send local name flag.- Parameters:
sendLocalName- the new send local name flag
-
isSendLocalTime
public Boolean isSendLocalTime()
Checks if is send local time flag.- Returns:
- true, if is send local time flag
-
setSendLocalTime
public void setSendLocalTime(Boolean sendLocalTime)
Sets the send local time flag.- Parameters:
sendLocalTime- the new send local time flag
-
isTruncateMessage
public Boolean isTruncateMessage()
Checks if is truncate message flag.- Returns:
- true, if is truncate message flag
-
setTruncateMessage
public void setTruncateMessage(Boolean truncateMessage)
Sets the truncate message flag.- Parameters:
truncateMessage- the new truncate message flag
-
isFirstOccurrenceOnly
public boolean isFirstOccurrenceOnly()
Description copied from interface:DestinationChecks if is first occurrence only.- Specified by:
isFirstOccurrenceOnlyin interfaceDestination- Returns:
- true, if is first occurrence only
-
setFirstOccurrenceOnly
public void setFirstOccurrenceOnly(Boolean firstOccurrenceOnly)
Sets the first occurrence only.- Parameters:
firstOccurrenceOnly- the new first occurrence only
-
getFilters
public List<SyslogFilter> getFilters()
Gets the filters.- Returns:
- the filters
-
setFilters
public void setFilters(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 String getCustomMessageFormat(NorthboundAlarm alarm)
Gets the custom message format.- Parameters:
alarm- the alarm- Returns:
- the custom message format
-
-