]>
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 class MessageReceived
extends DBusSignal
{
56 private final long timestamp
;
57 private final String sender
;
58 private final byte[] groupId
;
59 private final String message
;
60 private final List
<String
> attachments
;
62 public MessageReceived(
68 List
<String
> attachments
69 ) throws DBusException
{
70 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
71 this.timestamp
= timestamp
;
73 this.groupId
= groupId
;
74 this.message
= message
;
75 this.attachments
= attachments
;
78 public long getTimestamp() {
82 public String
getSender() {
86 public byte[] getGroupId() {
90 public String
getMessage() {
94 public List
<String
> getAttachments() {
99 class ReceiptReceived
extends DBusSignal
{
101 private final long timestamp
;
102 private final String sender
;
104 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
105 super(objectpath
, timestamp
, sender
);
106 this.timestamp
= timestamp
;
107 this.sender
= sender
;
110 public long getTimestamp() {
114 public String
getSender() {
119 class SyncMessageReceived
extends DBusSignal
{
121 private final long timestamp
;
122 private final String source
;
123 private final String destination
;
124 private final byte[] groupId
;
125 private final String message
;
126 private final List
<String
> attachments
;
128 public SyncMessageReceived(
135 List
<String
> attachments
136 ) throws DBusException
{
137 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
138 this.timestamp
= timestamp
;
139 this.source
= source
;
140 this.destination
= destination
;
141 this.groupId
= groupId
;
142 this.message
= message
;
143 this.attachments
= attachments
;
146 public long getTimestamp() {
150 public String
getSource() {
154 public String
getDestination() {
158 public byte[] getGroupId() {
162 public String
getMessage() {
166 public List
<String
> getAttachments() {
173 class AttachmentInvalid
extends DBusExecutionException
{
175 public AttachmentInvalid(final String message
) {
180 class Failure
extends DBusExecutionException
{
182 public Failure(final String message
) {
187 class GroupNotFound
extends DBusExecutionException
{
189 public GroupNotFound(final String message
) {
194 class InvalidNumber
extends DBusExecutionException
{
196 public InvalidNumber(final String message
) {
201 class UntrustedIdentity
extends DBusExecutionException
{
203 public UntrustedIdentity(final String message
) {