CSenServicePattern Class Reference

API published in: S60 3rd Ed

Link against: senservdesc.lib

Capability Information

Required Capabilities

NetworkServices ReadUserData WriteUserData


#include <
senservicepattern.h>

Inherits CSenXmlServiceDescription, and MSenConsumerPolicy.


Detailed Description

Class derives the XML service description and further extends it by implementing consumer policy interface.

Service pattern is typically used by Basic Web Service consumers, which often know, which policy to use in the communication with certain Web Service Provider (WSP).

For example, a Basic Web Service consumer application might want strictly define certain Internet Access Point (IAP) to be used when initializing new service connection. Such an application can simply instantiate new ServicePattern and set pre-known IAP ID into it.

The main purpose of this class is to simplify the initialization of service connections for Basic Web Services.

It is important to note, that all the consumer policy information entered via ServicePattern extending the MSenConsumerPolicy is treated in "policy-per-client" terms. In other words, any consumer policy information will not be stored for latter use of other applications (even they might happen to use same WSP and contract!).

This is due the nature of Service Pattern: it acts as a consumer originated filter, after which a service will be resolved.

Any service which "meets" the Service Pattern "constraints", is considered as a "match", because such service accepts this (search) pattern.


Public Member Functions

virtual IMPORT_C ~CSenServicePattern ()
 Destructor.
IMPORT_C HBufC8 * ConsumerPolicyAsXmlL ()
 Convenience method for writing out the consumer policy as XML in UTF-8 form.
IMPORT_C TBool Matches (MSenServiceDescription &aServicePattern)
 Compares that both service description and possible policy inside of it matches with this instance.
IMPORT_C void StartElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttributes)
 Callback function which implements the XML content handler interface.
virtual IMPORT_C void SetConsumerIapIdL (TUint32 aIapId)
 Setter for Internet Access Point (IAP) ID existing in CommDB.
virtual IMPORT_C TInt ConsumerIapId (TUint32 &aCurrentIapId)
 Getter for IAP ID.
virtual IMPORT_C void SetConsumerIdentityProviderIdsL (CSenIdentityProviderIdArray8 &aList)
 Setter for consumer identity provider IDs.
virtual IMPORT_C TInt AddConsumerIdentityProviderIdL (const TDesC8 &aProviderId)
 Adds a new Identity provider ID value at the end of the current list values.
virtual IMPORT_C const CSenIdentityProviderIdArray8ConsumerIdentityProviderIds8L ()
 Getter for Identity provider IDs.
virtual IMPORT_C TBool AcceptsConsumerPolicy (MSenConsumerPolicy &aPolicyPattern)
 Checks if the policy of this service pattern accepts given policy.
virtual IMPORT_C TInt RebuildFromConsumerPolicy (MSenConsumerPolicy &aTemplate)
 Rebuilds the consumer policy of this service pattern from the given consumer policy.

Static Public Member Functions

static IMPORT_C CSenServicePatternNewL ()
 Standard 2 phase constructors.
static IMPORT_C CSenServicePatternNewLC ()
 Standard 2 phase constructors.
static IMPORT_C CSenServicePatternNewL (const TDesC8 &aNamespaceURI)
 Standard 2 phase constructor.
static IMPORT_C CSenServicePatternNewLC (const TDesC8 &aNamespaceURI)
 Standard 2 phase constructor.
static IMPORT_C CSenServicePatternNewL (const TDesC8 &aEndPoint, const TDesC8 &aContract)
 Standard 2 phase constructor.
static IMPORT_C CSenServicePatternNewLC (const TDesC8 &aEndPoint, const TDesC8 &aContract)
 Standard 2 phase constructor.

Protected Member Functions

IMPORT_C CSenServicePattern (MSenServiceDescription::TDescriptionClassType aType)
 C++ constructor.
IMPORT_C void BaseConstructL ()
 Base constructor offered to sub class implementations.
IMPORT_C void BaseConstructL (const TDesC8 &aNamespaceURI)
 Base constructor offered to sub class implementations.
IMPORT_C void BaseConstructL (const TDesC8 &aEndPoint, const TDesC8 &aContract)
 Base constructor offered to sub class implementations.

Protected Attributes

CSenConsumerPolicy * iConsumerPolicy

Constructor & Destructor Documentation

virtual IMPORT_C CSenServicePattern::~CSenServicePattern  )  [virtual]
 

Destructor.

IMPORT_C CSenServicePattern::CSenServicePattern MSenServiceDescription::TDescriptionClassType  aType  )  [protected]
 

C++ constructor.

Parameters:
aType enumeration defininng the type of this class.

Member Function Documentation

virtual IMPORT_C TBool CSenServicePattern::AcceptsConsumerPolicy MSenConsumerPolicy aPolicyPattern  )  [virtual]
 

Checks if the policy of this service pattern accepts given policy.

Parameters:
aPolicyPattern the consumer policy to check.
Returns:
ETrue if accepts, EFalse if not

Implements MSenConsumerPolicy.

virtual IMPORT_C TInt CSenServicePattern::AddConsumerIdentityProviderIdL const TDesC8 &  aProviderId  )  [virtual]
 

Adds a new Identity provider ID value at the end of the current list values.

Parameters:
aProviderId unique ProviderID as UTF-8 descriptor
Returns:
KErrAlreadyExists, if a duplicate is tried to add KErrArgument if a zero-length descriptor is tried to add (aProviderId.Length() == 0)

Implements MSenConsumerPolicy.

IMPORT_C void CSenServicePattern::BaseConstructL const TDesC8 &  aEndPoint,
const TDesC8 &  aContract
[protected]
 

Base constructor offered to sub class implementations.

Parameters:
aEndPoint is the actual endpoint to the service
aContract of the service, typically some URI

Reimplemented from CSenDomFragment.

IMPORT_C void CSenServicePattern::BaseConstructL const TDesC8 &  aNamespaceURI  )  [protected]
 

Base constructor offered to sub class implementations.

Parameters:
aNamespaceURI the localname for XML element representation of this class.

Reimplemented from CSenDomFragment.

IMPORT_C void CSenServicePattern::BaseConstructL  )  [protected]
 

Base constructor offered to sub class implementations.

virtual IMPORT_C TInt CSenServicePattern::ConsumerIapId TUint32 &  aCurrentIapId  )  [virtual]
 

Getter for IAP ID.

Parameters:
aCurrentIapId will contain the current Internet Access Point ID
Returns:
  • KErrNone if <IapId> element is found and has valid content
  • KErrNotFound if no <IapId> element has been found or it has no content
  • TLex error codes, if <IapId> element has non-numeric value, which cannot be resolved

Implements MSenConsumerPolicy.

virtual IMPORT_C const CSenIdentityProviderIdArray8& CSenServicePattern::ConsumerIdentityProviderIds8L  )  [virtual]
 

Getter for Identity provider IDs.

Returns:
a list of IDP arrays if such value(s) have been set or an empty array if no IDP:s have been specified.

Implements MSenConsumerPolicy.

IMPORT_C HBufC8* CSenServicePattern::ConsumerPolicyAsXmlL  ) 
 

Convenience method for writing out the consumer policy as XML in UTF-8 form.

Returns:
consumer policy as UTF-8 form XML, which ownership is transferred to the caller.
IMPORT_C TBool CSenServicePattern::Matches MSenServiceDescription aServicePattern  )  [virtual]
 

Compares that both service description and possible policy inside of it matches with this instance.

Parameters:
aPattern the service description to compare to
Returns:
ETrue both service description and policy information matches, otherwise EFalse. If some value is not set in current instance, it is not compared.

Reimplemented from CSenXmlServiceDescription.

static IMPORT_C CSenServicePattern* CSenServicePattern::NewL const TDesC8 &  aEndPoint,
const TDesC8 &  aContract
[static]
 

Standard 2 phase constructor.

Parameters:
aEndPoint service pattern endpoint.
aContract service pattern contract.

Reimplemented from CSenXmlServiceDescription.

static IMPORT_C CSenServicePattern* CSenServicePattern::NewL const TDesC8 &  aNamespaceURI  )  [static]
 

Standard 2 phase constructor.

Parameters:
aNamespaceURI namespace URI for the service pattern.

Reimplemented from CSenXmlServiceDescription.

static IMPORT_C CSenServicePattern* CSenServicePattern::NewL  )  [static]
 

Standard 2 phase constructors.

Reimplemented from CSenXmlServiceDescription.

static IMPORT_C CSenServicePattern* CSenServicePattern::NewLC const TDesC8 &  aEndPoint,
const TDesC8 &  aContract
[static]
 

Standard 2 phase constructor.

Parameters:
aEndPoint service pattern endpoint.
aContract service pattern contract.

Reimplemented from CSenXmlServiceDescription.

static IMPORT_C CSenServicePattern* CSenServicePattern::NewLC const TDesC8 &  aNamespaceURI  )  [static]
 

Standard 2 phase constructor.

Parameters:
aNamespaceURI namespace URI for the service pattern.

Reimplemented from CSenXmlServiceDescription.

static IMPORT_C CSenServicePattern* CSenServicePattern::NewLC  )  [static]
 

Standard 2 phase constructors.

Reimplemented from CSenXmlServiceDescription.

virtual IMPORT_C TInt CSenServicePattern::RebuildFromConsumerPolicy MSenConsumerPolicy aTemplate  )  [virtual]
 

Rebuilds the consumer policy of this service pattern from the given consumer policy.

Parameters:
aTemplate the consumer policy to rebuild from.
Returns:
KErrNone or other system-wide Symbian error codes.

Implements MSenConsumerPolicy.

virtual IMPORT_C void CSenServicePattern::SetConsumerIapIdL TUint32  aIapId  )  [virtual]
 

Setter for Internet Access Point (IAP) ID existing in CommDB.

Parameters:
aIapId IAP ID

Implements MSenConsumerPolicy.

virtual IMPORT_C void CSenServicePattern::SetConsumerIdentityProviderIdsL CSenIdentityProviderIdArray8 aList  )  [virtual]
 

Setter for consumer identity provider IDs.

Overrides current values with the given values from the array. If an ID does not exist, it will be added.

Parameters:
aList list of identity provider IDs.

Implements MSenConsumerPolicy.

IMPORT_C void CSenServicePattern::StartElementL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  aAttributes
[virtual]
 

Callback function which implements the XML content handler interface.

Parses the consumer policies independently.

Parameters:
aNsUri The namespace URI of the new element
aLocalName The local name of the new element
aQName The qualified name of the new element
aAttributes The attributes of the new element

Reimplemented from CSenXmlServiceDescription.


Field Documentation

CSenConsumerPolicy* CSenServicePattern::iConsumerPolicy [protected]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top