1 msenproviderpolicy.h |
1 /* |
|
2 * Copyright (c) 2002-2005 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This abstract class defines provider policy interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef M_SEN_PROVIDER_POLICY_H |
|
26 #define M_SEN_PROVIDER_POLICY_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32base.h> // for CActive |
|
30 #include <badesca.h> |
|
31 #include <SenDomFragment.h> |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CSenIdentityProviderIdArray8; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * This abstract class defines provider policy interface. |
|
40 * The provider policy sets the conditions in which some service provider |
|
41 * is capable to operate in. It is defining context, through which these |
|
42 * (possibly remote) services may be contacted and used. |
|
43 * The actual properties may include transport layer settings, like |
|
44 * predefined Internet Access Point (IAP) ID. In addition, provider policy |
|
45 * may declare, that certain service should only be contacted using certain |
|
46 * identity provider (in ID-WSF). This can be achieved by mapping certain |
|
47 * list of IDP IDs to a provider policy. |
|
48 * Provider Policies are WSF wide settings, which are stored in WSF |
|
49 * databases, and thus they are shared with all the actual Web Service |
|
50 * Consumers (WSCs) accessing same services. |
|
51 * |
|
52 * Example structure of ProviderPolicy XML fragment: |
|
53 * |
|
54 * <ProviderPolicy> |
|
55 * <Transport> |
|
56 * <IapId> |
|
57 * 1 |
|
58 * </IapId> |
|
59 * </Transport> |
|
60 * <IdentityProviderIDs strict="true"> |
|
61 * <IdentityProviderID> |
|
62 * urn:first.id.example.com |
|
63 * </IdentityProviderID> |
|
64 * <IdentityProviderID> |
|
65 * urn:second.id.example.com |
|
66 * </IdentityProviderID> |
|
67 * </IdentityProviderIDs> |
|
68 * </ProviderPolicy> |
|
69 * @lib SenServDesc.lib |
|
70 * @since Series60 3.0 |
|
71 */ |
|
72 class MSenProviderPolicy |
|
73 { |
|
74 public: // New functions |
|
75 /** |
|
76 * Setter for Internet Access Point (IAP) ID. |
|
77 * Method is used to define default access point |
|
78 * to avoid IAP selection dialog prompt. |
|
79 * @since Series60 3.0 |
|
80 * @param aIapId is the ID found from CommDB. |
|
81 */ |
|
82 virtual void SetIapIdL(TUint32 aIapId) = 0; |
|
83 |
|
84 /** |
|
85 * Getter for IAP ID |
|
86 * @since Series60 3.0 |
|
87 * @param aCurrentIapId will contain the current |
|
88 * Internet Access Point ID |
|
89 * @return |
|
90 * - KErrNone if <IapId> element is found and has valid content |
|
91 * - KErrNotFound if no <IapId> element has been found or it has |
|
92 * no content |
|
93 * - TLex error codes, if <IapId> element has non-numeric value, |
|
94 * which cannot be resolved |
|
95 */ |
|
96 virtual TInt IapId(TUint32& aCurrentIapId) = 0; |
|
97 |
|
98 /** |
|
99 * Setter for IdentityProvider IDs. Overrides |
|
100 * current values with the given values from the array. |
|
101 * When initiating a new service connection, this list of |
|
102 * ProviderIDs define, which IdentityProviders are preferred |
|
103 * OR which are strictly acceptable ones. |
|
104 * @since Series60 3.0 |
|
105 * @param aList list of IdentityProvider IDs. |
|
106 */ |
|
107 virtual void SetIdentityProviderIdsL( |
|
108 CSenIdentityProviderIdArray8& aList) = 0; |
|
109 |
|
110 /** |
|
111 * Adds a new IdentityProviderID value at the end of the current list |
|
112 * values. |
|
113 * @since Series60 3.0 |
|
114 * @param aProviderID defines, which IdentityProvider is preferred |
|
115 * OR which is strictly acceptable one, when initiating a new |
|
116 * service connection. |
|
117 * @return KErrAlreadyExists, if a duplicate is tried to add |
|
118 * KErrArgument if a zero-length descriptor is tried to add |
|
119 * (aProviderId.Length() == 0) |
|
120 */ |
|
121 virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId) = 0; |
|
122 |
|
123 /** |
|
124 * Method reads provider policy class instance values from given |
|
125 * template. Values may include an IAP ID, preferred IdentityProvider |
|
126 * IDs etc. |
|
127 * @since Series60 3.0 |
|
128 * @param aTemplate from which the values are read. |
|
129 * @return KErrNone Everything went ok. |
|
130 * KErrAlreadyExists Duplicates were found |
|
131 * KErrArgument Invalid providerIds were found |
|
132 * Other error codes are system-wide Symbian error codes. |
|
133 */ |
|
134 virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate) = 0; |
|
135 |
|
136 /** |
|
137 * Getter for IdentityProvider IDs. |
|
138 * @since Series60 3.0 |
|
139 * @return a list of IDP arrays if such value(s) have been set |
|
140 * or an empty array if no IDP:s have been specified. |
|
141 */ |
|
142 virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0; |
|
143 |
|
144 /** |
|
145 * Checks if some policy is accepted by current policy. |
|
146 * @since Series60 3.0 |
|
147 * @param aPolicyPattern is the policy being compared |
|
148 * with this instance. |
|
149 * @return ETrue if policy candidate is accepted by current policy |
|
150 * definition, EFalse if not. |
|
151 */ |
|
152 virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern) = 0; |
|
153 |
|
154 void SetSnapIdL(TUint32 /*aSnapId*/) |
|
155 { |
|
156 } |
|
157 TInt SnapId(TUint32& /*aCurrentSnapId*/) |
|
158 { |
|
159 return KErrNotFound; |
|
160 } |
|
161 }; |
|
162 |
|
163 #endif //M_SEN_PROVIDER_POLICY_H |
|
164 |
|
165 // End of File |