Package org.opennms.netmgt.notifd
Class MicroblogNotificationStrategy
- java.lang.Object
-
- org.opennms.netmgt.notifd.MicroblogNotificationStrategy
-
- All Implemented Interfaces:
NotificationStrategy
- Direct Known Subclasses:
MicroblogDMNotificationStrategy
,MicroblogReplyNotificationStrategy
public class MicroblogNotificationStrategy extends java.lang.Object implements NotificationStrategy
Send notifications to a TwitterAPI-compatible microblog service.- Author:
- Jeff Gehlbach, OpenNMS
-
-
Field Summary
Fields Modifier and Type Field Description protected MicroblogConfigurationDao
m_configDao
protected MicroblogConfigurationDao
m_microblogConfigurationDao
-
Constructor Summary
Constructors Constructor Description MicroblogNotificationStrategy()
Constructor for MicroblogNotificationStrategy.MicroblogNotificationStrategy(org.springframework.core.io.Resource configResource)
Constructor for MicroblogNotificationStrategy.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
buildMessageBody(java.util.List<Argument> arguments)
buildMessageBodyprotected twitter4j.Twitter
buildUblogService(java.util.List<Argument> arguments)
buildUblogServiceprotected static org.springframework.core.io.Resource
findDefaultConfigResource()
findDefaultConfigResourceprotected java.lang.String
findDestName(java.util.List<Argument> arguments)
findDestNameMicroblogConfigurationDao
getMicroblogConfigurationDao()
getMicroblogConfigurationDaoint
send(java.util.List<Argument> arguments)
sendvoid
setMicroblogConfigurationDao(MicroblogConfigurationDao dao)
setMicroblogConfigurationDao
-
-
-
Field Detail
-
m_microblogConfigurationDao
protected MicroblogConfigurationDao m_microblogConfigurationDao
-
m_configDao
protected MicroblogConfigurationDao m_configDao
-
-
Constructor Detail
-
MicroblogNotificationStrategy
public MicroblogNotificationStrategy() throws java.io.IOException
Constructor for MicroblogNotificationStrategy.
- Throws:
java.io.IOException
- if any.
-
MicroblogNotificationStrategy
public MicroblogNotificationStrategy(org.springframework.core.io.Resource configResource)
Constructor for MicroblogNotificationStrategy.
- Parameters:
configResource
- aResource
object.
-
-
Method Detail
-
send
public int send(java.util.List<Argument> arguments)
send
- Specified by:
send
in interfaceNotificationStrategy
- Parameters:
arguments
- aList
object.- Returns:
- a int.
-
buildUblogService
protected twitter4j.Twitter buildUblogService(java.util.List<Argument> arguments)
buildUblogService
- Parameters:
arguments
- aList
object.- Returns:
- a
Twitter
object.
-
buildMessageBody
protected java.lang.String buildMessageBody(java.util.List<Argument> arguments)
buildMessageBody
- Parameters:
arguments
- aList
object.- Returns:
- a
String
object.
-
findDestName
protected java.lang.String findDestName(java.util.List<Argument> arguments)
findDestName
- Parameters:
arguments
- aList
object.- Returns:
- a
String
object.
-
findDefaultConfigResource
protected static org.springframework.core.io.Resource findDefaultConfigResource() throws java.io.IOException
findDefaultConfigResource
- Returns:
- a
Resource
object. - Throws:
java.io.IOException
- if any.
-
setMicroblogConfigurationDao
public void setMicroblogConfigurationDao(MicroblogConfigurationDao dao)
setMicroblogConfigurationDao
- Parameters:
dao
- aMicroblogConfigurationDao
object.
-
getMicroblogConfigurationDao
public MicroblogConfigurationDao getMicroblogConfigurationDao()
getMicroblogConfigurationDao
- Returns:
- a
MicroblogConfigurationDao
object.
-
-