OpenClovis Logo

clTmsApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : gms
21  * File : clTmsApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * This client API extends the SA Forum compliant cluster membership
28  * query and tracking API with group view management.
29  *
30  * Special applications can use this service to create and manage
31  * group (views) on top of the cluster (views).
32  *
33  *
34  * Synchronization of the group with the cluster group view is provided
35  * by the implementation of this service and it works as follows:
36  * An application can create a group and join the group if its node is also
37  * part of the cluster group. If a cluster node leaves (or is removed) from
38  * the cluster, any process on the removed node that participates in any
39  * group(s) is also removed from the respective group(s).
40  *
41  * An instance of this service (instantiated by the clTmsInitialize()
42  * API and identified by the svcHandle) can view and manage any group.
43  *
44  *
45  * FIXME/TODO:
46  * - Need to make sure all error codes are defined (here or in clCommon.h)
47  * - Need to address group address synchronization issue. If this service
48  * is to synchronize group address with group membership, then this has
49  * to be requested explicitely (and the address provided too).
50  *
51  *
52  *****************************************************************************/
53 
65 #ifndef _CL_TMS_API_H
66 #define _CL_TMS_API_H
67 
68 # ifdef __cplusplus
69 extern "C" {
70 # endif
71 
72 #include <clCommon.h>
73 #include <clClmApi.h>
74 #include <clTmsApi.h>
75 
76 /*=========================================================================
77  * Type/constant definitions:
78  *=======================================================================*/
79 
83 #define clTmsInitialize clGmsInitialize
84 #define clTmsFinalize clGmsFinalize
85 
86 typedef ClGmsHandleT ClTmsHandleT;
88 typedef ClGmsGroupIdT ClTmsGroupIdT;
90 typedef ClGmsMemberIdT ClTmsMemberIdT;
92 typedef ClGmsLeadershipCredentialsT ClTmsLeadershipCredentialsT;
97 
98 /*=========================================================================
99  * Callback Functions:
100  *=======================================================================*/
101 typedef void (*ClTmsGroupMessageDeliveryCallbackT) (ClTmsGroupIdT groupId,
102  ClTmsMemberIdT senderId,
103  ClUint32T messageSize,
104  void *message);
105 
106 
107 /*=========================================================================
108  * API Functions:
109  *=======================================================================*/
110 
138  CL_IN ClTmsHandleT svcHandle,
139  CL_IN ClTmsGroupNameT *groupName,
140  CL_INOUT ClTmsGroupParamsT *groupParams,
141  CL_OUT ClTmsGroupIdT *groupId);
142 
143 
164  CL_IN ClTmsHandleT svcHandle,
165  CL_IN ClTmsGroupIdT groupId);
166 
192  CL_IN ClTmsHandleT svcHandle,
193  CL_IN ClTmsGroupIdT groupId,
194  CL_IN ClTmsMemberIdT memberId,
195  CL_IN ClTmsMemberNameT *memberName,
196  CL_IN ClTmsLeadershipCredentialsT credentials,
197  CL_IN ClTmsGroupMessageDeliveryCallbackT msgDeliveryCallback,
198  CL_IN ClTimeT timeout);
199 
200 
223  CL_IN ClTmsHandleT svcHandle,
224  CL_IN ClTmsGroupIdT groupId,
225  CL_IN ClTmsMemberIdT memberId,
226  CL_IN ClTimeT timeout);
227 
255  CL_IN ClGmsHandleT svcHandle,
256  CL_IN ClGmsGroupIdT groupId,
257  CL_IN ClGmsMemberIdT memberId,
258  CL_IN ClTimeT timeout,
259  CL_IN ClUint32T dataSize,
260  CL_IN ClPtrT data);
261 
286  CL_IN ClTmsHandleT svcHandle,
287  CL_IN ClTmsGroupIdT groupId,
288  CL_IN ClUint8T trackFlags,
289  CL_INOUT ClTmsGroupNotificationBufferT *notificationBuffer);
290 
312  CL_IN ClTmsHandleT svcHandle,
313  CL_IN ClTmsGroupIdT groupId);
314 
344  CL_IN ClTmsHandleT svcHandle,
345  CL_IN ClTimeT timeout,
346  CL_INOUT ClTmsGroupInfoListT *groups);
347 
348 
382  CL_IN ClTmsHandleT svcHandle,
383  CL_IN ClTmsGroupNameT *groupName,
384  CL_IN ClTimeT timeout,
385  CL_INOUT ClTmsGroupInfoT *groupInfo);
386 
387 #ifdef __cplusplus
388 }
389 #endif
390 
391 #endif /* _CL_TMS_API_H_ */
392 
Typical defines found in any software project.
Header file of SA Forum compliant Group Membership Service.
Header file of Group Membership Service APIs.
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_INOUT
CL_INOUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:108
ClInt64T ClTimeT
Time duration specified in nanoseconds.
Definition: clCommon.h:154
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
ClRcT clTmsGroupJoin(CL_IN ClTmsHandleT svcHandle, CL_IN ClTmsGroupIdT groupId, CL_IN ClTmsMemberIdT memberId, CL_IN ClTmsMemberNameT *memberName, CL_IN ClTmsLeadershipCredentialsT credentials, CL_IN ClTmsGroupMessageDeliveryCallbackT msgDeliveryCallback, CL_IN ClTimeT timeout)
Join the group as a member.
ClHandleT ClGmsHandleT
Handle for using the GMS API.
Definition: clClmTmsCommon.h:137
ClRcT clTmsSendAll(CL_IN ClGmsHandleT svcHandle, CL_IN ClGmsGroupIdT groupId, CL_IN ClGmsMemberIdT memberId, CL_IN ClTimeT timeout, CL_IN ClUint32T dataSize, CL_IN ClPtrT data)
Send a Totally ordered multicast messages to all members of a given group.
ClUint32T ClGmsGroupIdT
System-wide unique ID of the group.
Definition: clClmTmsCommon.h:380
ClRcT clTmsGroupTrackStop(CL_IN ClTmsHandleT svcHandle, CL_IN ClTmsGroupIdT groupId)
Stops all the group tracking.
ClRcT clTmsGroupLeave(CL_IN ClTmsHandleT svcHandle, CL_IN ClTmsGroupIdT groupId, CL_IN ClTmsMemberIdT memberId, CL_IN ClTimeT timeout)
Leave the group.
ClUint32T ClGmsLeadershipCredentialsT
Credentials for leader election.
Definition: clClmTmsCommon.h:150
ClRcT clTmsListGroups(CL_IN ClTmsHandleT svcHandle, CL_IN ClTimeT timeout, CL_INOUT ClTmsGroupInfoListT *groups)
Returns the information on all the groups.
ClRcT clTmsGroupCreate(CL_IN ClTmsHandleT svcHandle, CL_IN ClTmsGroupNameT *groupName, CL_INOUT ClTmsGroupParamsT *groupParams, CL_OUT ClTmsGroupIdT *groupId)
Create a group.
ClRcT clTmsGetGroupInfo(CL_IN ClTmsHandleT svcHandle, CL_IN ClTmsGroupNameT *groupName, CL_IN ClTimeT timeout, CL_INOUT ClTmsGroupInfoT *groupInfo)
Returns the information of a group specified by the groupName.
ClRcT clTmsGroupTrack(CL_IN ClTmsHandleT svcHandle, CL_IN ClTmsGroupIdT groupId, CL_IN ClUint8T trackFlags, CL_INOUT ClTmsGroupNotificationBufferT *notificationBuffer)
Configures the group tracking mode.
ClUint32T ClGmsMemberIdT
Group-unique ID of a member.
Definition: clClmTmsCommon.h:392
ClRcT clTmsGroupDestroy(CL_IN ClTmsHandleT svcHandle, CL_IN ClTmsGroupIdT groupId)
Destroy a group.
A name.
Definition: clCommon.h:197
Parameters for group provided during group creation.
Definition: clClmTmsCommon.h:402
Structure containing attributes of a group member.
Definition: clClmTmsCommon.h:416
Buffer to convey the view: the list of group member attributes.
Definition: clClmTmsCommon.h:511
Structure used to hold the metadata of a group.
Definition: clClmTmsCommon.h:549
Structure used to pass the meta data on all the existing groups.
Definition: clClmTmsCommon.h:596

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen