|
1 /* |
|
2 * Copyright (c) 2006-2006 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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 #ifndef WSSTAR_HTTP_CLIENT_H |
|
28 #define WSSTAR_HTTP_CLIENT_H |
|
29 |
|
30 // INCLUDES |
|
31 #include <e32base.h> |
|
32 #include <flogger.h> |
|
33 #include <e32math.h> |
|
34 |
|
35 #include "wsstarservicesession.h" |
|
36 #include "seninternalserviceconsumer.h" |
|
37 #include "SenXmlElement.h" |
|
38 #include "sentransportbase.h" |
|
39 /* |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 /** |
|
43 * Class: CWSStarHttpClient |
|
44 * |
|
45 * Description: Consumer which communicate with real STS. |
|
46 * Client will try obtain credentail based on WS-Trust specification. |
|
47 */ |
|
48 class CWSStarHttpClient : public CSenInternalServiceConsumer |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Standard 2 phase constructor |
|
54 * @param aSIF SIF implementation used in contructor of internal consumer |
|
55 * @param aLogger logger used for logs in debug mode |
|
56 * @return new instance of trust client |
|
57 */ |
|
58 static CWSStarHttpClient* NewL( CSIF& aSIF, |
|
59 CSenWSDescription* aInitializer, |
|
60 RFileLogger& aLogger ); |
|
61 /** |
|
62 * Standard 2 phase constructor |
|
63 * @since Series60 4.0 |
|
64 * @param aSIF SIF implementation used in contructor of internal consumer |
|
65 * @param aLogger logger used for logs in debug mode |
|
66 * @return new instance of trust client which is pushed into CleanupStack |
|
67 */ |
|
68 static CWSStarHttpClient* NewLC( CSIF& aSIF, |
|
69 CSenWSDescription* aInitializer, |
|
70 RFileLogger& aLogger ); |
|
71 |
|
72 /** |
|
73 * Normal destructor. Destroy STS session. |
|
74 */ |
|
75 ~CWSStarHttpClient(); |
|
76 |
|
77 |
|
78 /** |
|
79 * The most siginificant method of this class. Gets the policy from URi via HTTPS |
|
80 * @param aSession session which is validated |
|
81 */ |
|
82 TInt GetHttpL( const TDesC8& aRequest, HBufC8*& apPolicyResponse, CSenWSDescription* apSD ); |
|
83 |
|
84 void SetStatus(TInt aStatus); |
|
85 /** |
|
86 * Sets identyProvider for trust client |
|
87 * @param aIdentityProvider identity provider representation of STS |
|
88 */ |
|
89 void SetAccount(CSenIdentityProvider* aIdentityProvicer); |
|
90 |
|
91 //-----derived from CSenWSDescription, |
|
92 //in fact we expose info from stssession which is holded by that client. |
|
93 // Method have to overwrited becouse of core, which use those methods during registering |
|
94 TPtrC8 Endpoint(); |
|
95 TPtrC8 Contract(); |
|
96 TPtrC8 ProviderID(); |
|
97 void WriteAsXMLToL(RWriteStream& aWriteStream); |
|
98 |
|
99 /** |
|
100 * Getter for validate session |
|
101 */ |
|
102 virtual CSenServiceSession* ServiceSession(); |
|
103 |
|
104 /** |
|
105 * Getter for transport (taken from remote consumer of validated session) |
|
106 */ |
|
107 virtual MSenTransport& TransportL(); |
|
108 |
|
109 /** |
|
110 * Sets session, |
|
111 * |
|
112 * @param aSession - clear session assign |
|
113 */ |
|
114 void SetClientSessionL(CWSStarServiceSession* aSession); |
|
115 |
|
116 void SetVersion(const TDesC8* aVersion); |
|
117 |
|
118 TBool HasSuperClass( TDescriptionClassType aType ); |
|
119 |
|
120 virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; |
|
121 void DataTrafficDetails( TSenDataTrafficDetails& aDetails); |
|
122 protected://methods |
|
123 |
|
124 /** |
|
125 * C++ default constructor. |
|
126 */ |
|
127 CWSStarHttpClient( CSIF& aSIF, |
|
128 TDescriptionClassType aType, |
|
129 CSenWSDescription* aInitializer, |
|
130 RFileLogger& aLogger); |
|
131 /** |
|
132 * By default Symbian 2nd phase constructor is private. |
|
133 */ |
|
134 void BaseConstructL(); |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 private: // Data |
|
140 CWSStarServiceSession* iPolicySession; //Policy session, owned |
|
141 const TDesC8* iVersion; |
|
142 CSenTransportBase* ipTransport;//owned |
|
143 CSenWSDescription* iInitializer; |
|
144 RFileLogger& iLog; //not owned |
|
145 TSenDataTrafficDetails iHttpDetails; |
|
146 |
|
147 }; |
|
148 |
|
149 #endif // WSSTAR_POLICY_HTTP_CLIENT_H |
|
150 |
|
151 // End of File |