]>
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
{
16 long sendMessage(String message
, List
<String
> attachments
, String recipient
) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
;
18 long sendMessage(String message
, List
<String
> attachments
, List
<String
> recipients
) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
20 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
22 long sendGroupMessage(String message
, List
<String
> attachments
, byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
24 String
getContactName(String number
) throws Error
.InvalidNumber
;
26 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
28 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
30 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
;
32 List
<byte[]> getGroupIds();
34 String
getGroupName(byte[] groupId
);
36 List
<String
> getGroupMembers(byte[] groupId
);
38 byte[] updateGroup(byte[] groupId
, String name
, List
<String
> members
, String avatar
) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.UnregisteredUser
, Error
.UntrustedIdentity
;
40 boolean isRegistered();
42 class MessageReceived
extends DBusSignal
{
44 private final long timestamp
;
45 private final String sender
;
46 private final byte[] groupId
;
47 private final String message
;
48 private final List
<String
> attachments
;
50 public MessageReceived(String objectpath
, long timestamp
, String sender
, byte[] groupId
, String message
, List
<String
> attachments
) throws DBusException
{
51 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
52 this.timestamp
= timestamp
;
54 this.groupId
= groupId
;
55 this.message
= message
;
56 this.attachments
= attachments
;
59 public long getTimestamp() {
63 public String
getSender() {
67 public byte[] getGroupId() {
71 public String
getMessage() {
75 public List
<String
> getAttachments() {
80 class ReceiptReceived
extends DBusSignal
{
82 private final long timestamp
;
83 private final String sender
;
85 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
86 super(objectpath
, timestamp
, sender
);
87 this.timestamp
= timestamp
;
91 public long getTimestamp() {
95 public String
getSender() {
100 class SyncMessageReceived
extends DBusSignal
{
102 private final long timestamp
;
103 private final String source
;
104 private final String destination
;
105 private final byte[] groupId
;
106 private final String message
;
107 private final List
<String
> attachments
;
109 public SyncMessageReceived(String objectpath
, long timestamp
, String source
, String destination
, byte[] groupId
, String message
, List
<String
> attachments
) throws DBusException
{
110 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
111 this.timestamp
= timestamp
;
112 this.source
= source
;
113 this.destination
= destination
;
114 this.groupId
= groupId
;
115 this.message
= message
;
116 this.attachments
= attachments
;
119 public long getTimestamp() {
123 public String
getSource() {
127 public String
getDestination() {
131 public byte[] getGroupId() {
135 public String
getMessage() {
139 public List
<String
> getAttachments() {
146 class AttachmentInvalid
extends DBusExecutionException
{
148 public AttachmentInvalid(final String message
) {
153 class Failure
extends DBusExecutionException
{
155 public Failure(final String message
) {
160 class GroupNotFound
extends DBusExecutionException
{
162 public GroupNotFound(final String message
) {
167 class InvalidNumber
extends DBusExecutionException
{
169 public InvalidNumber(final String message
) {
174 class UnregisteredUser
extends DBusExecutionException
{
176 public UnregisteredUser(final String message
) {
181 class UntrustedIdentity
extends DBusExecutionException
{
183 public UntrustedIdentity(final String message
) {