2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This abstract class defines consumer policy interface.
25 #ifndef M_SEN_CONSUMER_POLICY_H
26 #define M_SEN_CONSUMER_POLICY_H
29 #include <e32base.h> // for CActive
31 #include <SenDomFragment.h>
33 // FORWARD DECLARATIONS
34 class CSenIdentityProviderIdArray8;
39 * This abstract class defines consumer policy interface.
40 * The consumer 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, consumer 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 consumer policy.
48 * A consumer policy is effective only for a single session, and thus it
49 * applies to one service connection only. This means, that this policy
50 * information is "private", and not shared between different WSC applications
51 * using WSF, event though they might be using the same (remote) service at the
52 * same time. Consumer policy properties are not serialized in any WSF
53 * database, but resides in memory only.
55 * Example structure of ConsumerPolicy XML fragment:
63 * <IdentityProviderIDs strict="false">
64 * <IdentityProviderID>
65 * urn:first.example.idp.com
66 * </IdentityProviderID>
67 * <IdentityProviderID>
68 * urn:second.example.idp.com
69 * </IdentityProviderID>
70 * </IdentityProviderIDs>
73 * @lib SenServDesc.lib
76 class MSenConsumerPolicy
78 public: // New functions
81 * Setter for Internet Access Point (IAP) ID existing in CommDB.
83 * @param aIapId IAP ID
85 virtual void SetConsumerIapIdL(TUint32 aIapId) = 0;
90 * @param aCurrentIapId will contain the current
91 * Internet Access Point ID
93 * - KErrNone if <IapId> element is found and has valid content
94 * - KErrNotFound if no <IapId> element has been found or it has
96 * - TLex error codes, if <IapId> element has non-numeric value,
97 * which cannot be resolved
99 virtual TInt ConsumerIapId(TUint32& aCurrentIapId) = 0;
102 * Setter for consumer identity provider IDs. Overrides current values
103 * with the given values from the array. If an ID does not exist, it
105 * @since Series60 3.0
106 * @param aList list of identity provider IDs.
108 virtual void SetConsumerIdentityProviderIdsL(
109 CSenIdentityProviderIdArray8& aList) = 0;
112 * Adds a new Identity provider ID value at the end of the current list
114 * @since Series60 3.0
115 * @param aProviderId unique ProviderID as UTF-8 descriptor
116 * @return KErrAlreadyExists, if a duplicate is tried to add
117 * KErrArgument if a zero-length descriptor is tried to add
118 * (aProviderId.Length() == 0)
120 virtual TInt AddConsumerIdentityProviderIdL(const TDesC8& aProviderId) = 0;
123 * Rebuilds the consumer policy of this service pattern from the given
125 * @since Series60 3.0
126 * @param aTemplate the consumer policy to rebuild from.
127 * @return KErrNone or other system-wide Symbian error codes.
129 virtual TInt RebuildFromConsumerPolicy(MSenConsumerPolicy& aTemplate) = 0;
132 * Getter for Identity provider IDs.
133 * @since Series60 3.0
134 * @return a list of IDP arrays if such value(s) have been set
135 * or an empty array if no IDP:s have been specified.
137 virtual const CSenIdentityProviderIdArray8&
138 ConsumerIdentityProviderIds8L() = 0;
141 * Checks if the policy of this service pattern accepts given policy.
142 * @since Series60 3.0
143 * @param aPolicyPattern the consumer policy to check.
144 * @return ETrue if accepts, EFalse if not
146 virtual TBool AcceptsConsumerPolicy(MSenConsumerPolicy& aPolicyPattern) = 0;
149 #endif //M_SEN_CONSUMER_POLICY_H