From 14840af2abd9976b8f5634af8e77f4a7126dfac1 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 27 Jun 2018 15:55:19 +0500 Subject: - Rename NotificationException to MessageException - Simplify Notificator instantiation - Make sms configuration more clear - Move some defaults in code - Some cleanup --- src/org/traccar/smpp/SmppClient.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/smpp/SmppClient.java') diff --git a/src/org/traccar/smpp/SmppClient.java b/src/org/traccar/smpp/SmppClient.java index d5e6820ab..ddda4cb4f 100644 --- a/src/org/traccar/smpp/SmppClient.java +++ b/src/org/traccar/smpp/SmppClient.java @@ -25,8 +25,8 @@ import java.util.concurrent.TimeUnit; import org.traccar.Context; import org.traccar.helper.Log; -import org.traccar.sms.SMSException; -import org.traccar.sms.SMSManager; +import org.traccar.notification.MessageException; +import org.traccar.sms.SmsManager; import com.cloudhopper.commons.charset.CharsetUtil; import com.cloudhopper.smpp.SmppBindType; @@ -44,7 +44,7 @@ import com.cloudhopper.smpp.type.SmppChannelException; import com.cloudhopper.smpp.type.SmppTimeoutException; import com.cloudhopper.smpp.type.UnrecoverablePduException; -public class SmppClient implements SMSManager { +public class SmppClient implements SmsManager { private SmppSessionConfiguration sessionConfig = new SmppSessionConfiguration(); private SmppSession smppSession; @@ -216,7 +216,7 @@ public class SmppClient implements SMSManager { @Override public synchronized void sendMessageSync(String destAddress, String message, boolean command) - throws SMSException, InterruptedException, IllegalStateException { + throws MessageException, InterruptedException, IllegalStateException { if (getSession() != null && getSession().isBound()) { try { SubmitSm submit = new SubmitSm(); @@ -245,10 +245,10 @@ public class SmppClient implements SMSManager { } } catch (SmppChannelException | RecoverablePduException | SmppTimeoutException | UnrecoverablePduException error) { - throw new SMSException(error); + throw new MessageException(error); } } else { - throw new SMSException(new SmppChannelException("SMPP session is not connected")); + throw new MessageException(new SmppChannelException("SMPP session is not connected")); } } @@ -259,7 +259,7 @@ public class SmppClient implements SMSManager { public void run() { try { sendMessageSync(destAddress, message, command); - } catch (SMSException | InterruptedException | IllegalStateException error) { + } catch (MessageException | InterruptedException | IllegalStateException error) { Log.warning(error); } } -- cgit v1.2.3