]>
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();
54 void updateProfile(String name
,String about
,String aboutEmoji
,String avatarPath
,boolean removeAvatar
) throws Error
.Failure
;
56 class MessageReceived
extends DBusSignal
{
58 private final long timestamp
;
59 private final String sender
;
60 private final byte[] groupId
;
61 private final String message
;
62 private final List
<String
> attachments
;
64 public MessageReceived(
70 List
<String
> attachments
71 ) throws DBusException
{
72 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
73 this.timestamp
= timestamp
;
75 this.groupId
= groupId
;
76 this.message
= message
;
77 this.attachments
= attachments
;
80 public long getTimestamp() {
84 public String
getSender() {
88 public byte[] getGroupId() {
92 public String
getMessage() {
96 public List
<String
> getAttachments() {
101 class ReceiptReceived
extends DBusSignal
{
103 private final long timestamp
;
104 private final String sender
;
106 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
107 super(objectpath
, timestamp
, sender
);
108 this.timestamp
= timestamp
;
109 this.sender
= sender
;
112 public long getTimestamp() {
116 public String
getSender() {
121 class SyncMessageReceived
extends DBusSignal
{
123 private final long timestamp
;
124 private final String source
;
125 private final String destination
;
126 private final byte[] groupId
;
127 private final String message
;
128 private final List
<String
> attachments
;
130 public SyncMessageReceived(
137 List
<String
> attachments
138 ) throws DBusException
{
139 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
140 this.timestamp
= timestamp
;
141 this.source
= source
;
142 this.destination
= destination
;
143 this.groupId
= groupId
;
144 this.message
= message
;
145 this.attachments
= attachments
;
148 public long getTimestamp() {
152 public String
getSource() {
156 public String
getDestination() {
160 public byte[] getGroupId() {
164 public String
getMessage() {
168 public List
<String
> getAttachments() {
175 class AttachmentInvalid
extends DBusExecutionException
{
177 public AttachmentInvalid(final String message
) {
182 class Failure
extends DBusExecutionException
{
184 public Failure(final String message
) {
189 class GroupNotFound
extends DBusExecutionException
{
191 public GroupNotFound(final String message
) {
196 class InvalidNumber
extends DBusExecutionException
{
198 public InvalidNumber(final String message
) {
203 class UntrustedIdentity
extends DBusExecutionException
{
205 public UntrustedIdentity(final String message
) {