All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwapp.notification.twitter.TwitterNotificationManager Maven / Gradle / Ivy

Go to download

Lwapp notification is a utility jar file with most common notification features(email, sms, twitter) needed in daily java programming.

The newest version!
package org.lwapp.notification.twitter;

import javax.inject.Inject;
import javax.inject.Singleton;

import org.lwapp.notification.config.ApplicationServerConfig;
import org.lwapp.jms.common.JmsDestination;
import org.lwapp.jms.common.incoming.AbstractJmsQueuePoller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Singleton
public class TwitterNotificationManager extends AbstractJmsQueuePoller {
	private static final Logger LOG = LoggerFactory.getLogger(TwitterNotificationManager.class);

	@Inject
	private ApplicationServerConfig configurationClient;

	@Override
	protected JmsDestination getInJmsDestination() {
		return configurationClient.getTwitterIncomingJmsQueue();
	}

	@Override
	protected JmsDestination getErrorQueueJmsDestination() {
		return configurationClient.getTwitterErrorJmsQueue();
	}

	@Override
	protected void afterReadingMessage(final Tweet tweetRequest) throws Exception {
		tweet(tweetRequest.getTo(), tweetRequest.getMessage());
	}

	private void tweet(final String to, final String message) {
		LOG.info("Sending twitter:\n@{},\t{}", to, message);

		// FIXME: Add twitter related code
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy