]>
nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/Signal.java
3 import org
.freedesktop
.dbus
.exceptions
.DBusException
;
4 import org
.freedesktop
.dbus
.exceptions
.DBusExecutionException
;
5 import org
.freedesktop
.dbus
.interfaces
.DBusInterface
;
6 import org
.freedesktop
.dbus
.messages
.DBusSignal
;
11 * DBus interface for the org.asamk.Signal service.
12 * Including emitted Signals and returned Errors.
14 public interface Signal
extends DBusInterface
{
17 String message
, List
<String
> attachments
, String recipient
18 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
21 String message
, List
<String
> attachments
, List
<String
> recipients
22 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
24 long sendRemoteDeleteMessage(
25 long targetSentTimestamp
, String recipient
26 ) throws Error
.Failure
, Error
.InvalidNumber
;
28 long sendRemoteDeleteMessage(
29 long targetSentTimestamp
, List
<String
> recipients
30 ) throws Error
.Failure
, Error
.InvalidNumber
;
32 long sendGroupRemoteDeleteMessage(
33 long targetSentTimestamp
, byte[] groupId
34 ) throws Error
.Failure
, Error
.GroupNotFound
;
36 long sendMessageReaction(
37 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, String recipient
38 ) throws Error
.InvalidNumber
, Error
.Failure
;
40 long sendMessageReaction(
41 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, List
<String
> recipients
42 ) throws Error
.InvalidNumber
, Error
.Failure
;
44 long sendNoteToSelfMessage(
45 String message
, List
<String
> attachments
46 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
48 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
50 long sendGroupMessage(
51 String message
, List
<String
> attachments
, byte[] groupId
52 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
;
54 long sendGroupMessageReaction(
55 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
56 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
;
58 String
getContactName(String number
) throws Error
.InvalidNumber
;
60 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
62 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
64 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
;
66 List
<byte[]> getGroupIds();
68 String
getGroupName(byte[] groupId
);
70 List
<String
> getGroupMembers(byte[] groupId
);
73 byte[] groupId
, String name
, List
<String
> members
, String avatar
74 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
;
76 boolean isRegistered();
79 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
80 ) throws Error
.Failure
;
84 List
<String
> listNumbers();
86 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
88 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
;
90 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
92 boolean isGroupBlocked(final byte[] groupId
);
94 boolean isMember(final byte[] groupId
);
96 void joinGroup(final String groupLink
) throws Error
.Failure
;
98 class MessageReceived
extends DBusSignal
{
100 private final long timestamp
;
101 private final String sender
;
102 private final byte[] groupId
;
103 private final String message
;
104 private final List
<String
> attachments
;
106 public MessageReceived(
112 List
<String
> attachments
113 ) throws DBusException
{
114 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
115 this.timestamp
= timestamp
;
116 this.sender
= sender
;
117 this.groupId
= groupId
;
118 this.message
= message
;
119 this.attachments
= attachments
;
122 public long getTimestamp() {
126 public String
getSender() {
130 public byte[] getGroupId() {
134 public String
getMessage() {
138 public List
<String
> getAttachments() {
143 class ReceiptReceived
extends DBusSignal
{
145 private final long timestamp
;
146 private final String sender
;
148 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
149 super(objectpath
, timestamp
, sender
);
150 this.timestamp
= timestamp
;
151 this.sender
= sender
;
154 public long getTimestamp() {
158 public String
getSender() {
163 class SyncMessageReceived
extends DBusSignal
{
165 private final long timestamp
;
166 private final String source
;
167 private final String destination
;
168 private final byte[] groupId
;
169 private final String message
;
170 private final List
<String
> attachments
;
172 public SyncMessageReceived(
179 List
<String
> attachments
180 ) throws DBusException
{
181 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
182 this.timestamp
= timestamp
;
183 this.source
= source
;
184 this.destination
= destination
;
185 this.groupId
= groupId
;
186 this.message
= message
;
187 this.attachments
= attachments
;
190 public long getTimestamp() {
194 public String
getSource() {
198 public String
getDestination() {
202 public byte[] getGroupId() {
206 public String
getMessage() {
210 public List
<String
> getAttachments() {
217 class AttachmentInvalid
extends DBusExecutionException
{
219 public AttachmentInvalid(final String message
) {
224 class Failure
extends DBusExecutionException
{
226 public Failure(final String message
) {
231 class GroupNotFound
extends DBusExecutionException
{
233 public GroupNotFound(final String message
) {
238 class InvalidNumber
extends DBusExecutionException
{
240 public InvalidNumber(final String message
) {
245 class UntrustedIdentity
extends DBusExecutionException
{
247 public UntrustedIdentity(final String message
) {