
org.lwapp.notification.sms.SmsNotificationManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lwapp-notification Show documentation
Show all versions of lwapp-notification Show documentation
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.sms;
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 SmsNotificationManager extends AbstractJmsQueuePoller {
private static final Logger LOG = LoggerFactory.getLogger(SmsNotificationManager.class);
@Inject
private ApplicationServerConfig configurationClient;
@Override
protected JmsDestination getInJmsDestination() {
return configurationClient.getSmsIncomingJmsQueue();
}
@Override
protected JmsDestination getErrorQueueJmsDestination() {
return configurationClient.getSmsErrorJmsQueue();
}
@Override
protected void afterReadingMessage(final Sms sms) throws Exception {
sendMessageNow(sms);
}
private void sendMessageNow(final Sms sms) {
for (final String to : sms.getToNumbers()) {
LOG.info("Sending SMS to :{}", to);
// TODO: write code to send real sms
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy