]>
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 class MessageReceived
extends DBusSignal
{
60 private final long timestamp
;
61 private final String sender
;
62 private final byte[] groupId
;
63 private final String message
;
64 private final List
<String
> attachments
;
66 public MessageReceived(
72 List
<String
> attachments
73 ) throws DBusException
{
74 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
75 this.timestamp
= timestamp
;
77 this.groupId
= groupId
;
78 this.message
= message
;
79 this.attachments
= attachments
;
82 public long getTimestamp() {
86 public String
getSender() {
90 public byte[] getGroupId() {
94 public String
getMessage() {
98 public List
<String
> getAttachments() {
103 class ReceiptReceived
extends DBusSignal
{
105 private final long timestamp
;
106 private final String sender
;
108 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
109 super(objectpath
, timestamp
, sender
);
110 this.timestamp
= timestamp
;
111 this.sender
= sender
;
114 public long getTimestamp() {
118 public String
getSender() {
123 class SyncMessageReceived
extends DBusSignal
{
125 private final long timestamp
;
126 private final String source
;
127 private final String destination
;
128 private final byte[] groupId
;
129 private final String message
;
130 private final List
<String
> attachments
;
132 public SyncMessageReceived(
139 List
<String
> attachments
140 ) throws DBusException
{
141 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
142 this.timestamp
= timestamp
;
143 this.source
= source
;
144 this.destination
= destination
;
145 this.groupId
= groupId
;
146 this.message
= message
;
147 this.attachments
= attachments
;
150 public long getTimestamp() {
154 public String
getSource() {
158 public String
getDestination() {
162 public byte[] getGroupId() {
166 public String
getMessage() {
170 public List
<String
> getAttachments() {
177 class AttachmentInvalid
extends DBusExecutionException
{
179 public AttachmentInvalid(final String message
) {
184 class Failure
extends DBusExecutionException
{
186 public Failure(final String message
) {
191 class GroupNotFound
extends DBusExecutionException
{
193 public GroupNotFound(final String message
) {
198 class InvalidNumber
extends DBusExecutionException
{
200 public InvalidNumber(final String message
) {
205 class UntrustedIdentity
extends DBusExecutionException
{
207 public UntrustedIdentity(final String message
) {