]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/Signal.java
Move Exception classes to corresponding package
[signal-cli] / src / main / java / org / asamk / Signal.java
index f8b353c7bcac24d4f774c2a769e19d260909132b..c1acf13edfb8a3dce10878cebdd3c041310e0230 100644 (file)
@@ -1,10 +1,10 @@
 package org.asamk;
 
-import org.asamk.signal.AttachmentInvalidException;
-import org.asamk.signal.GroupNotFoundException;
-import org.freedesktop.dbus.DBusInterface;
-import org.freedesktop.dbus.DBusSignal;
+import org.asamk.signal.manager.AttachmentInvalidException;
+import org.asamk.signal.manager.GroupNotFoundException;
 import org.freedesktop.dbus.exceptions.DBusException;
+import org.freedesktop.dbus.interfaces.DBusInterface;
+import org.freedesktop.dbus.messages.DBusSignal;
 import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptions;
 import org.whispersystems.signalservice.api.util.InvalidNumberException;
 
@@ -13,13 +13,13 @@ import java.util.List;
 
 public interface Signal extends DBusInterface {
 
-    void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
+    long sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
 
-    void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
+    long sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
 
     void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions, InvalidNumberException;
 
-    void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
+    long sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
 
     String getContactName(String number) throws InvalidNumberException;
 
@@ -41,11 +41,11 @@ public interface Signal extends DBusInterface {
 
     class MessageReceived extends DBusSignal {
 
-        private long timestamp;
-        private String sender;
-        private byte[] groupId;
-        private String message;
-        private List<String> attachments;
+        private final long timestamp;
+        private final String sender;
+        private final byte[] groupId;
+        private final String message;
+        private final List<String> attachments;
 
         public MessageReceived(String objectpath, long timestamp, String sender, byte[] groupId, String message, List<String> attachments) throws DBusException {
             super(objectpath, timestamp, sender, groupId, message, attachments);
@@ -79,8 +79,8 @@ public interface Signal extends DBusInterface {
 
     class ReceiptReceived extends DBusSignal {
 
-        private long timestamp;
-        private String sender;
+        private final long timestamp;
+        private final String sender;
 
         public ReceiptReceived(String objectpath, long timestamp, String sender) throws DBusException {
             super(objectpath, timestamp, sender);
@@ -98,12 +98,13 @@ public interface Signal extends DBusInterface {
     }
 
     class SyncMessageReceived extends DBusSignal {
-        private long timestamp;
-        private String source;
-        private String destination;
-        private byte[] groupId;
-        private String message;
-        private List<String> attachments;
+
+        private final long timestamp;
+        private final String source;
+        private final String destination;
+        private final byte[] groupId;
+        private final String message;
+        private final List<String> attachments;
 
         public SyncMessageReceived(String objectpath, long timestamp, String source, String destination, byte[] groupId, String message, List<String> attachments) throws DBusException {
             super(objectpath, timestamp, source, destination, groupId, message, attachments);