|
1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Server-side representation of a target client, which may have multiple |
|
15 // server-side sessions open |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef MESSAGESENDOBSERVER_H |
|
24 #define MESSAGESENDOBSERVER_H |
|
25 |
|
26 class MRemConMessageSendObserver |
|
27 { |
|
28 public: |
|
29 |
|
30 /** |
|
31 Called by CRemConServer to provide the result of an attempt to send a given message to a single remote. |
|
32 This should be used in cases where a command can only be delivered to zero or one remotes (e.g. a notify command) |
|
33 AND the observer does not require notification in advance of the number of remotes. |
|
34 The observer should complete its client request with the error given here. |
|
35 @param aMessage The CRemConMessage whose send was attempted. |
|
36 @param aError The result of the send attempt (KErrNone in success). |
|
37 */ |
|
38 virtual void MrcmsoMessageSendResult(const CRemConMessage& aMessage, TInt aError)=0; |
|
39 |
|
40 /** |
|
41 Called by CRemConServer to notify the observer that an attempt is about to be made to send a particular message |
|
42 to one or more remotes. |
|
43 This allows CRemConServer to notify the session in advance of the number of remotes to which the send will be attempted. |
|
44 If the number of remotes is 1, this method can still be used to provide the session with notification of the number of remotes. |
|
45 MrcmsoMessageSendOneOrMoreResult() will be invoked for each remote to which an attempt is made to send the message. |
|
46 The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client |
|
47 request once all remotes have been tried. |
|
48 @param aMessage The CRemConMessage whose send is about to be attempted. |
|
49 @param aNumRemotes The number of remotes that the message is to be sent to. |
|
50 */ |
|
51 virtual void MrcmsoMessageSendOneOrMoreAttempt(const CRemConMessage& aMessage, TUint aNumRemotes)=0; |
|
52 |
|
53 /** |
|
54 Called by CRemConServer to notify the observer that an attempt is about to be made to send a particular message to n |
|
55 further remotes. |
|
56 This can be used when the exact number of remotes is not known at first. This should not be invoked after the first |
|
57 attempt to send the message has been made. |
|
58 The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client |
|
59 request once all remotes have been tried. |
|
60 @param aMessage The CRemConMessage whose send is about to be attempted. |
|
61 @param aNumRemotes The number of additional remotes that this message is to be sent to. |
|
62 */ |
|
63 virtual void MrcmsoMessageSendOneOrMoreIncremental(const CRemConMessage& aMessage, TUint aNumRemotes)=0; |
|
64 |
|
65 /** |
|
66 Called by CRemConServer to indicate that a message send attempt to one or more remotes could not be made. |
|
67 For example, the send attempt may have failed because as the message could not be addressed. |
|
68 The observer should complete its client request immediately with the given error. |
|
69 @param aMessage The CRemConMessage whose send was attempted. |
|
70 @param aError An error preventing the attempt from being made. |
|
71 */ |
|
72 virtual void MrcmsoMessageSendOneOrMoreAttemptFailed(const CRemConMessage& aMessage, TInt aError)=0; |
|
73 |
|
74 /** |
|
75 Called by CRemConServer to provide the result of an attempt to send a given message to one of a number of remotes. |
|
76 A call is made to this method for each remote for which an attempted send was made. |
|
77 The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client |
|
78 request once all remotes have been tried. |
|
79 If the message send result is unexpected (i.e. the observer believes that no remotes should have been tried), then the observer |
|
80 may ignore this result. For example, the observers client may have cancelled its send request for this message. |
|
81 @param aMessage The CRemConMessage whose send was attempted. |
|
82 @param aError The result of the send attempt (KErrNone in success). |
|
83 */ |
|
84 virtual void MrcmsoMessageSendOneOrMoreResult(const CRemConMessage& aMessage, TInt aError)=0; |
|
85 |
|
86 /** |
|
87 Called by CRemConServer to indicate that the sending of a given message to a remote was abandoned. |
|
88 This provides a mechanism whereby CRemConServer may drop a message without sending an error back |
|
89 to the client. For example, if the message is not permitted by the TSP for the remote, or fails to match a |
|
90 command, then the attempt for this remote should be abandoned but the client may still be completed |
|
91 without error. If a message cannot be sent because of an error, then MrcmsoMessageSendResult() should be used. |
|
92 The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client |
|
93 request once all remotes have been tried. |
|
94 If the message send result is unexpected (i.e. the observer believes that no remotes should have been tried), then the observer |
|
95 may ignore this result. For example, the observers client may have cancelled its send request for this message. |
|
96 @param aMessage The CRemConMessage whose send was attempted. |
|
97 */ |
|
98 virtual void MrcmsoMessageSendOneOrMoreAbandoned(const CRemConMessage& aMessage)=0; |
|
99 |
|
100 }; |
|
101 |
|
102 #endif // MESSAGESENDOBSERVER_H |