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