]>
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
;
21 String message
, List
<String
> attachments
, List
<String
> recipients
22 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
24 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
26 long sendGroupMessage(
27 String message
, List
<String
> attachments
, byte[] groupId
28 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
30 String
getContactName(String number
) throws Error
.InvalidNumber
;
32 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
34 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
36 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
;
38 List
<byte[]> getGroupIds();
40 String
getGroupName(byte[] groupId
);
42 List
<String
> getGroupMembers(byte[] groupId
);
45 byte[] groupId
, String name
, List
<String
> members
, String avatar
46 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
48 boolean isRegistered();
50 class MessageReceived
extends DBusSignal
{
52 private final long timestamp
;
53 private final String sender
;
54 private final byte[] groupId
;
55 private final String message
;
56 private final List
<String
> attachments
;
58 public MessageReceived(
64 List
<String
> attachments
65 ) throws DBusException
{
66 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
67 this.timestamp
= timestamp
;
69 this.groupId
= groupId
;
70 this.message
= message
;
71 this.attachments
= attachments
;
74 public long getTimestamp() {
78 public String
getSender() {
82 public byte[] getGroupId() {
86 public String
getMessage() {
90 public List
<String
> getAttachments() {
95 class ReceiptReceived
extends DBusSignal
{
97 private final long timestamp
;
98 private final String sender
;
100 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
101 super(objectpath
, timestamp
, sender
);
102 this.timestamp
= timestamp
;
103 this.sender
= sender
;
106 public long getTimestamp() {
110 public String
getSender() {
115 class SyncMessageReceived
extends DBusSignal
{
117 private final long timestamp
;
118 private final String source
;
119 private final String destination
;
120 private final byte[] groupId
;
121 private final String message
;
122 private final List
<String
> attachments
;
124 public SyncMessageReceived(
131 List
<String
> attachments
132 ) throws DBusException
{
133 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
134 this.timestamp
= timestamp
;
135 this.source
= source
;
136 this.destination
= destination
;
137 this.groupId
= groupId
;
138 this.message
= message
;
139 this.attachments
= attachments
;
142 public long getTimestamp() {
146 public String
getSource() {
150 public String
getDestination() {
154 public byte[] getGroupId() {
158 public String
getMessage() {
162 public List
<String
> getAttachments() {
169 class AttachmentInvalid
extends DBusExecutionException
{
171 public AttachmentInvalid(final String message
) {
176 class Failure
extends DBusExecutionException
{
178 public Failure(final String message
) {
183 class GroupNotFound
extends DBusExecutionException
{
185 public GroupNotFound(final String message
) {
190 class InvalidNumber
extends DBusExecutionException
{
192 public InvalidNumber(final String message
) {
197 class UnregisteredUser
extends DBusExecutionException
{
199 public UnregisteredUser(final String message
) {
204 class UntrustedIdentity
extends DBusExecutionException
{
206 public UntrustedIdentity(final String message
) {