]>
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 sendNoteToSelfMessage(
25 String message
, List
<String
> attachments
26 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
28 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
30 long sendGroupMessage(
31 String message
, List
<String
> attachments
, byte[] groupId
32 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
;
34 String
getContactName(String number
) throws Error
.InvalidNumber
;
36 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
38 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
40 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
;
42 List
<byte[]> getGroupIds();
44 String
getGroupName(byte[] groupId
);
46 List
<String
> getGroupMembers(byte[] groupId
);
49 byte[] groupId
, String name
, List
<String
> members
, String avatar
50 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
;
52 boolean isRegistered();
55 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
56 ) throws Error
.Failure
;
58 public String
version();
60 public List
<String
> listNumbers();
62 public List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
64 public void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
;
66 public boolean isContactBlocked(final String number
);
68 public boolean isGroupBlocked(final byte[] groupId
);
70 public boolean isMember(final byte[] groupId
);
72 public void joinGroup(final String groupLink
) throws Error
.Failure
;
74 class MessageReceived
extends DBusSignal
{
76 private final long timestamp
;
77 private final String sender
;
78 private final byte[] groupId
;
79 private final String message
;
80 private final List
<String
> attachments
;
82 public MessageReceived(
88 List
<String
> attachments
89 ) throws DBusException
{
90 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
91 this.timestamp
= timestamp
;
93 this.groupId
= groupId
;
94 this.message
= message
;
95 this.attachments
= attachments
;
98 public long getTimestamp() {
102 public String
getSender() {
106 public byte[] getGroupId() {
110 public String
getMessage() {
114 public List
<String
> getAttachments() {
119 class ReceiptReceived
extends DBusSignal
{
121 private final long timestamp
;
122 private final String sender
;
124 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
125 super(objectpath
, timestamp
, sender
);
126 this.timestamp
= timestamp
;
127 this.sender
= sender
;
130 public long getTimestamp() {
134 public String
getSender() {
139 class SyncMessageReceived
extends DBusSignal
{
141 private final long timestamp
;
142 private final String source
;
143 private final String destination
;
144 private final byte[] groupId
;
145 private final String message
;
146 private final List
<String
> attachments
;
148 public SyncMessageReceived(
155 List
<String
> attachments
156 ) throws DBusException
{
157 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
158 this.timestamp
= timestamp
;
159 this.source
= source
;
160 this.destination
= destination
;
161 this.groupId
= groupId
;
162 this.message
= message
;
163 this.attachments
= attachments
;
166 public long getTimestamp() {
170 public String
getSource() {
174 public String
getDestination() {
178 public byte[] getGroupId() {
182 public String
getMessage() {
186 public List
<String
> getAttachments() {
193 class AttachmentInvalid
extends DBusExecutionException
{
195 public AttachmentInvalid(final String message
) {
200 class Failure
extends DBusExecutionException
{
202 public Failure(final String message
) {
207 class GroupNotFound
extends DBusExecutionException
{
209 public GroupNotFound(final String message
) {
214 class InvalidNumber
extends DBusExecutionException
{
216 public InvalidNumber(final String message
) {
221 class UntrustedIdentity
extends DBusExecutionException
{
223 public UntrustedIdentity(final String message
) {