]>
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
;
25 String recipient
, boolean stop
26 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.UntrustedIdentity
;
29 String recipient
, List
<Long
> targetSentTimestamp
30 ) throws Error
.Failure
, Error
.UntrustedIdentity
;
32 long sendRemoteDeleteMessage(
33 long targetSentTimestamp
, String recipient
34 ) throws Error
.Failure
, Error
.InvalidNumber
;
36 long sendRemoteDeleteMessage(
37 long targetSentTimestamp
, List
<String
> recipients
38 ) throws Error
.Failure
, Error
.InvalidNumber
;
40 long sendGroupRemoteDeleteMessage(
41 long targetSentTimestamp
, byte[] groupId
42 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
44 long sendMessageReaction(
45 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, String recipient
46 ) throws Error
.InvalidNumber
, Error
.Failure
;
48 long sendMessageReaction(
49 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, List
<String
> recipients
50 ) throws Error
.InvalidNumber
, Error
.Failure
;
52 long sendNoteToSelfMessage(
53 String message
, List
<String
> attachments
54 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
56 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
58 long sendGroupMessage(
59 String message
, List
<String
> attachments
, byte[] groupId
60 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.InvalidGroupId
;
62 long sendGroupMessageReaction(
63 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
64 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
, Error
.InvalidGroupId
;
66 String
getContactName(String number
) throws Error
.InvalidNumber
;
68 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
70 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
72 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
, Error
.InvalidGroupId
;
74 List
<byte[]> getGroupIds();
76 String
getGroupName(byte[] groupId
) throws Error
.InvalidGroupId
;
78 List
<String
> getGroupMembers(byte[] groupId
) throws Error
.InvalidGroupId
;
81 byte[] groupId
, String name
, List
<String
> members
, String avatar
82 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
84 boolean isRegistered();
87 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
88 ) throws Error
.Failure
;
92 List
<String
> listNumbers();
94 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
96 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
98 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
100 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
102 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
104 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
106 class MessageReceived
extends DBusSignal
{
108 private final long timestamp
;
109 private final String sender
;
110 private final byte[] groupId
;
111 private final String message
;
112 private final List
<String
> attachments
;
114 public MessageReceived(
120 List
<String
> attachments
121 ) throws DBusException
{
122 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
123 this.timestamp
= timestamp
;
124 this.sender
= sender
;
125 this.groupId
= groupId
;
126 this.message
= message
;
127 this.attachments
= attachments
;
130 public long getTimestamp() {
134 public String
getSender() {
138 public byte[] getGroupId() {
142 public String
getMessage() {
146 public List
<String
> getAttachments() {
151 class ReceiptReceived
extends DBusSignal
{
153 private final long timestamp
;
154 private final String sender
;
156 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
157 super(objectpath
, timestamp
, sender
);
158 this.timestamp
= timestamp
;
159 this.sender
= sender
;
162 public long getTimestamp() {
166 public String
getSender() {
171 class SyncMessageReceived
extends DBusSignal
{
173 private final long timestamp
;
174 private final String source
;
175 private final String destination
;
176 private final byte[] groupId
;
177 private final String message
;
178 private final List
<String
> attachments
;
180 public SyncMessageReceived(
187 List
<String
> attachments
188 ) throws DBusException
{
189 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
190 this.timestamp
= timestamp
;
191 this.source
= source
;
192 this.destination
= destination
;
193 this.groupId
= groupId
;
194 this.message
= message
;
195 this.attachments
= attachments
;
198 public long getTimestamp() {
202 public String
getSource() {
206 public String
getDestination() {
210 public byte[] getGroupId() {
214 public String
getMessage() {
218 public List
<String
> getAttachments() {
225 class AttachmentInvalid
extends DBusExecutionException
{
227 public AttachmentInvalid(final String message
) {
232 class Failure
extends DBusExecutionException
{
234 public Failure(final String message
) {
239 class GroupNotFound
extends DBusExecutionException
{
241 public GroupNotFound(final String message
) {
246 class InvalidGroupId
extends DBusExecutionException
{
248 public InvalidGroupId(final String message
) {
253 class InvalidNumber
extends DBusExecutionException
{
255 public InvalidNumber(final String message
) {
260 class UntrustedIdentity
extends DBusExecutionException
{
262 public UntrustedIdentity(final String message
) {