All Classes Files Functions Variables Enumerations Enumerator Groups Pages
DistributedDomain.idl
Go to the documentation of this file.
1 /**
2  * @file DistributedDomain.idl
3  * @brief Set domain distributed among several Kerio Connect servers.
4  *
5  * @author Dusan Juhas
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 #import <kerio/web/idl/SharedStructures.idl>
11 
12 module kerio {
13 module jsonapi {
14 module admin {
15 
16 /**
17  * User's home server in a distributed domain.
18  */
19 struct HomeServer {
20  kerio::web::KId id; ///< server's id
21  string name; ///< server's Internet hostname
22 };
23 
24 typedef sequence<HomeServer> HomeServerList;
25 
26 enum ClusterErrorType {
27  clSuccess,
28  clError, ///< Generic cluster error, see ClusterError.errorMessage for details
29  clSelfConnectError, ///< The master cannot be the same as slave
30  clConnectToSlaveError, ///< Connection to slave is not allowed
31  clInaccessibleHost, ///< Cannot connect to the specified host
32  clInvalidUserOrPassword, ///< User name or password are invalid or has insufficient rights
33  clIncorrectClusterVersion, ///< Remote server has incompatible implementation of cluster services
34  clDataConflict, ///< There are multiple resources/aliases or mailing lists with the same name, server cannot be connected to cluster
35  clDirServiceRemoteEmpty, ///< Specified distributed domain has no Directory Service configured on remote distributed domain host
36  clDirServiceLocalEmpty, ///< Specified distributed domain has no Directory Service configured on local distributed domain host
37  clDirServiceDifferent ///< Specified distributed domain has different Directory Service configured on local and remote distributed domain host
38 };
39 
40 enum ClusterConflictTarget {
41  clResource,
42  clAlias,
43  clMailingList,
44  clDomainAlias,
45  clDomain
46 };
47 
49  ClusterConflictTarget type;
50  string name;
51  string domain;
52  string homeServer;
53 };
54 
55 typedef sequence<ClusterConflict> ClusterConflictList;
56 
57 struct ClusterError {
58  ClusterErrorType type;
59  kerio::web::LocalizableMessage errorMessage; ///< is assigned if type is clError
60  ClusterConflictList conflictList; ///< List of Resources/Aliases/MLists which are already defined in cluster. The conflictList is empty if type is different from dataConflict.
61 };
62 
63 /**
64  * Role of the server in cluster
65  */
66 enum ClusterRole {
67  clStandalone,
68  clMaster,
69  clSlave
70 };
71 
72 enum ClusterStatus {
73  csReady, ///< Server in claster work well.
74  csError ///< Server in claster don't work with some error, see errorMessages for details
75 };
76 
77 typedef sequence<kerio::web::LocalizableMessage> LocalizableMessageList;
78 
79 enum ClusterDomainStatus {
80  csDomainNotChecked,
81  csDomainExists,
82  csDomainDoesNotExist
83 };
84 
85 struct ClusterServer {
86  string hostname;
87  boolean isPrimary;
88  boolean isLocal;
89  ClusterStatus status;
90 
91  LocalizableMessageList errorMessages; ///< is assigned if type is clError
92 
93  ClusterDomainStatus domainStatus;
94 };
95 
97  string hostName;
98  string adminUser;
99  string password;
100 };
101 
102 typedef sequence<ClusterServer> ClusterServerList;
103 
104 interface DistributedDomain {
105  /**
106  * Connect server to cluster as slave.
107  *
108  * @param result - if ClusterErrorType is not clSuccess, error argument contains additional error info
109  * @param hostName - name of the master server
110  * @param adminUser - username of administrator on the master server
111  * @param password - administrator's password
112  */
113  void connect(out ClusterError result, in string hostName, in string adminUser, in string password);
114 
115  /**
116  * Copy domain from the master server.
117  *
118  * @param domainName - name of the domain on the master server that you want to copy. Name can be obtained by using method getDomainsFromServer.
119  */
120  void copy(in string domainName);
121 
122  /**
123  * Disconnect server from the cluster.
124  */
125  void disconnect();
126 
127  /**
128  * Retrieve domains, which can be distributed, from the master server as a standalone server.
129  *
130  * @param domainNames - List of domains which can be distributed (they have a directory service set).
131  * @param connected - true means the caller is connected to cluster
132  * @param authentication - Structure with a credential. Credential will be used when connected is false.
133  */
134  void getDistributable(out kerio::web::StringList domainNames, in ClusterAuthentication authentication, in boolean connected);
135 
136  /**
137  * Return server role in the cluster.
138  */
139  void getRole(out ClusterRole role, out boolean isMultiServer);
140 
141  /**
142  * Retrieve information about servers in the cluster.
143  *
144  * @param servers - List of all servers in cluster.
145  */
146  void getServerList(out ClusterServerList servers);
147 
148  /**
149  * Retrieve information about servers in the cluster.
150  *
151  * @param servers - List of all servers in cluster.
152  */
153  void getHomeServerList(out HomeServerList servers);
154 
155  /**
156  * Retrieve true if the same server in cluster has an error.
157  *
158  * Notes: This method fails if caller has not admin rights; This method fails if there is no cluster
159  *
160  * @param isInCluster true if server is not standalone
161  * @param isError status of error in cluster
162  */
163  void getStatus(out boolean isInCluster, out boolean isError);
164 };
165 
166 }; }; };//end of namespace