|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Name : CSIPRegistrationRefreshBinding.h |
|
16 * Part of : Registration |
|
17 * Version : SIP/6.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef CSIPREGISTRATIONREFRESHBINDING_H |
|
29 #define CSIPREGISTRATIONREFRESHBINDING_H |
|
30 |
|
31 #include <e32base.h> |
|
32 #include "CSIPRegistrationBindingBase.h" |
|
33 #include "MRefreshOwner.h" |
|
34 |
|
35 class MSipRefreshMgr; |
|
36 |
|
37 /** |
|
38 * Class contains registration refreshing binding for information. |
|
39 */ |
|
40 class CSIPRegistrationRefreshBinding : public CSIPRegistrationBindingBase, |
|
41 public MRefreshOwner |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 static CSIPRegistrationRefreshBinding* NewLC( |
|
46 CSIPRequest* aSIPRequest, |
|
47 MTransactionUser& aTransactionUser, |
|
48 MSigComp& aSigComp, |
|
49 CSIPSec& aSIPSec, |
|
50 MSipRefreshMgr& aRefreshMgr, |
|
51 CSIPRegistrationBindingStore& aBindingStore, |
|
52 MRegistrationOwner* aRegistrationOwner, |
|
53 MSIPSecUser& aSIPSecUser, |
|
54 MSIPTransportMgr& aTransportMgr, |
|
55 CURIContainer& aRemoteTarget, |
|
56 TBool aSendWithExpires, |
|
57 TBool aCacheOutboundProxyIP); |
|
58 |
|
59 ~CSIPRegistrationRefreshBinding(); |
|
60 |
|
61 |
|
62 public: // From MSIPSecUser |
|
63 |
|
64 void RequestCredentialsL(CSIPResponse& aResponse, |
|
65 TTransactionId aTransactionId, |
|
66 TRefreshId aRefreshId); |
|
67 |
|
68 public: // From CSIPRegistrationBindingBase |
|
69 |
|
70 TRefreshId RefreshId() const; |
|
71 |
|
72 TBool IsRefresh() const; |
|
73 |
|
74 void DoRegisterL(TTransactionId& aTransactionId, |
|
75 CSIPRequest* aRequest, |
|
76 CSIPRouteHeader* aOutboundProxy); |
|
77 |
|
78 void DoUpdateL(TTransactionId& aTransactionId, |
|
79 CSIPRequest* aRequest); |
|
80 |
|
81 void DoUnregisterL(TTransactionId& aTransactionId, |
|
82 CSIPRequest* aRequest); |
|
83 |
|
84 void SetOutboundProxyL(CSIPRouteHeader* aOutboundProxy); |
|
85 |
|
86 |
|
87 public: // From MRefreshOwner: |
|
88 |
|
89 void RefreshReceivedL (TTransactionId aTransactionId, |
|
90 TRefreshId aRefreshId, |
|
91 CSIPResponse* aSIPResponse); |
|
92 |
|
93 TInt RefreshError (TRefreshId aRefreshId, |
|
94 TTransactionId aTransactionId, |
|
95 TInt aReason); |
|
96 |
|
97 TInt NextRefreshCSeq (TUint& aCSeq); |
|
98 |
|
99 TSIPTransportParams TransportParams(const TRegistrationId& aRegistrationId); |
|
100 |
|
101 const MSIPSecUser* SIPSecUser(const TRegistrationId& aRegistrationId); |
|
102 |
|
103 TUint RefreshDurationL(); |
|
104 |
|
105 public: // New functions |
|
106 |
|
107 void SetRefreshId(TRefreshId aRefreshId); |
|
108 |
|
109 void ClearRefreshOwner (); |
|
110 |
|
111 |
|
112 private: |
|
113 |
|
114 CSIPRegistrationRefreshBinding( |
|
115 MTransactionUser& aTransactionUser, |
|
116 MSigComp& aSigComp, |
|
117 CSIPSec& aSIPSec, |
|
118 CSIPRegistrationBindingStore& aBindingStore, |
|
119 MRegistrationOwner* aRegistrationOwner, |
|
120 MSIPSecUser& aSIPSecUser, |
|
121 MSIPTransportMgr& aTransportMgr, |
|
122 MSipRefreshMgr& aRefreshMgr, |
|
123 TBool aSendWithExpires, |
|
124 TBool aCacheOutboundProxyIP); |
|
125 |
|
126 private: // Data |
|
127 |
|
128 MSipRefreshMgr& iRefreshMgr; |
|
129 TRefreshId iRefreshId; |
|
130 TBool iIsSubsequentResponse; |
|
131 |
|
132 private: // For testing purposes |
|
133 |
|
134 void __DbgTestInvariant() const; |
|
135 |
|
136 |
|
137 UNIT_TEST(CSIPRegistrationBindingTest) |
|
138 }; |
|
139 |
|
140 #endif // CSIPREGISTRATIONREFRESHBINDING_H |
|
141 |
|
142 // End of File |