1
|
|
|
# -*- coding: utf-8 -*- |
2
|
|
|
from __future__ import unicode_literals |
3
|
|
|
from abc import ABCMeta, abstractmethod |
4
|
|
|
from six import with_metaclass |
5
|
|
|
|
6
|
|
|
|
7
|
|
|
class EjabberdAPIContract(with_metaclass(ABCMeta, object)): # pragma: no cover |
8
|
|
|
@abstractmethod |
9
|
|
|
def echo(self, sentence): |
10
|
|
|
pass |
11
|
|
|
|
12
|
|
|
@abstractmethod |
13
|
|
|
def registered_users(self, host): |
14
|
|
|
pass |
15
|
|
|
|
16
|
|
|
@abstractmethod |
17
|
|
|
def register(self, user, host, password): |
18
|
|
|
pass |
19
|
|
|
|
20
|
|
|
@abstractmethod |
21
|
|
|
def unregister(self, user, host): |
22
|
|
|
pass |
23
|
|
|
|
24
|
|
|
@abstractmethod |
25
|
|
|
def change_password(self, user, host, newpass): |
26
|
|
|
pass |
27
|
|
|
|
28
|
|
|
@abstractmethod |
29
|
|
|
def check_password_hash(self, user, host, password): |
30
|
|
|
pass |
31
|
|
|
|
32
|
|
|
@abstractmethod |
33
|
|
|
def set_nickname(self, user, host, nickname): |
34
|
|
|
pass |
35
|
|
|
|
36
|
|
|
@abstractmethod |
37
|
|
|
def connected_users(self): |
38
|
|
|
pass |
39
|
|
|
|
40
|
|
|
@abstractmethod |
41
|
|
|
def connected_users_info(self): |
42
|
|
|
pass |
43
|
|
|
|
44
|
|
|
@abstractmethod |
45
|
|
|
def connected_users_number(self): |
46
|
|
|
pass |
47
|
|
|
|
48
|
|
|
@abstractmethod |
49
|
|
|
def user_sessions_info(self, user, host): |
50
|
|
|
pass |
51
|
|
|
|
52
|
|
|
@abstractmethod |
53
|
|
|
def muc_online_rooms(self, host=None): |
54
|
|
|
pass |
55
|
|
|
|
56
|
|
|
@abstractmethod |
57
|
|
|
def create_room(self, name, service, host): |
58
|
|
|
pass |
59
|
|
|
|
60
|
|
|
@abstractmethod |
61
|
|
|
def destroy_room(self, name, service): |
62
|
|
|
pass |
63
|
|
|
|
64
|
|
|
@abstractmethod |
65
|
|
|
def get_room_options(self, name, service): |
66
|
|
|
pass |
67
|
|
|
|
68
|
|
|
@abstractmethod |
69
|
|
|
def change_room_option(self, name, service, option, value): |
70
|
|
|
pass |
71
|
|
|
|
72
|
|
|
@abstractmethod |
73
|
|
|
def set_room_affiliation(self, name, service, jid, affiliation): |
74
|
|
|
pass |
75
|
|
|
|
76
|
|
|
@abstractmethod |
77
|
|
|
def get_room_affiliations(self, name, service): |
78
|
|
|
pass |
79
|
|
|
|
80
|
|
|
@abstractmethod |
81
|
|
|
def add_rosteritem(self, localuser, localserver, user, server, nick, group, subs): |
82
|
|
|
pass |
83
|
|
|
|
84
|
|
|
@abstractmethod |
85
|
|
|
def delete_rosteritem(self, localuser, localserver, user, server): |
86
|
|
|
pass |
87
|
|
|
|
88
|
|
|
@abstractmethod |
89
|
|
|
def get_roster(self, user, server): |
90
|
|
|
pass |
91
|
|
|
|
92
|
|
|
@abstractmethod |
93
|
|
|
def check_account(self, user, host): |
94
|
|
|
pass |
95
|
|
|
|
96
|
|
|
@abstractmethod |
97
|
|
|
def kick_user(self, user, host): |
98
|
|
|
pass |
99
|
|
|
|
100
|
|
|
@abstractmethod |
101
|
|
|
def kick_session(self, user, host, resource, reason): |
102
|
|
|
pass |
103
|
|
|
|