1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__SS_CONNSELECT_H__)
17 #define __SS_CONNSELECT_H__
19 #include <ss_select.h>
20 #include <comms-infras/ss_mcprnodemessages.h>
21 #include <comms-infras/ss_platsec_apiext.h>
22 #include <comms-infras/ss_nodemessages_serviceprovider.h>
27 class CSelectionRequest : public CBase,
28 public Messages::ASimpleNodeIdBase,
29 public MPlatsecApiExt,
30 protected NetInterfaces::TInterfaceControl,
31 public ITFHIERARCHY_1(CSelectionRequest,MPlatsecApiExt)
34 Connection selection request.
40 typedef ITFHIERARCHY_1(CSelectionRequest,MPlatsecApiExt) TIfStaticFetcherNearestInHierarchy;
43 static CSelectionRequest* NewL(const Messages::TRuntimeCtxId& aRequestingClient, const Messages::TNodeId& aTierManagerId);
44 virtual ~CSelectionRequest();
46 void Select(const TSelectionPrefs& aSelectionPreferences);
47 void SelectConnPrefList(const RConnPrefList& aConnPrefList);
48 void Provision(const Meta::SMetaData* aProvisionConfig);
49 void Cancel(); //Cancels all active requests
51 void JoinComplete(const Messages::TNodeId& aSender, TCFPeer::TJoinComplete& aCFMessage);
52 void CommsBinderResponse(const TCFServiceProvider::TCommsBinderResponse& aMsg);
53 void SelectComplete(const Messages::TNodeId& aSenderId, const Messages::TNodeId& aMcprId, const TProviderInfo& aMcprInfo);
55 // from MPlatsecApiExt
56 virtual TInt SecureId(TSecureId& aResult) const;
57 virtual TInt VendorId(TVendorId& aResult) const;
58 virtual TBool HasCapability(const TCapability aCapability) const;
59 virtual TInt CheckPolicy(const TSecurityPolicy& aPolicy) const;
61 void ReturnInterfacePtrL(MPlatsecApiExt*& aInterface);
62 virtual NetInterfaces::TInterfaceControl* FetchNodeInterfaceControlL(TInt aInterfaceId);
65 explicit CSelectionRequest(const Messages::TRuntimeCtxId& aRequestingClient, const Messages::TNodeId& aTierManagerId);
66 virtual void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage);
69 TInt FindActiveRequest(const Messages::TRuntimeCtxId& aMcprId);
70 void HandleProviderSelection(const Messages::TNodeId& aMcprId);
71 void ProviderSelectionFinished(const Messages::TRuntimeCtxId& aMcprId); //Our selection request (SP or SNL) has been fully served -> SelectComplete(NULL).
72 void SelectionFinished(); //The whole selection has finished.
73 void PostError(const Messages::TNodeSignal::TMessageId& aMessageId, TInt aError);
74 void InitialiseDestroy();
77 void SelectionError(const Messages::TRuntimeCtxId& aSenderId, TInt aError); //Selection error
78 void CommsBinderRequestError(const Messages::TRuntimeCtxId& aSenderId, Messages::TEBase::TError& aCFMessage); //CommsBinderRequest returned error
81 enum {EIdle = 0x00, ESelecting = 0x01, ECancelling = 0x02, ERequestingCommsBinder = 0x04}; //Selection Status
83 TSelectionPrefs iSelectionPreferences;
84 Messages::TNodeId iTierManagerId;
85 Messages::TNodeId iTopMcprId;
86 TProviderInfo iTopMcprInfo;
87 Messages::RNodeInterface iRequestingNode;
88 Messages::RRequestOriginator iRequest;
89 RArray<Messages::RNodeInterface> iActiveRequests; //List of all service providers (mcprs) currently processing our selection requests
90 TUint iSelectionStatus : 4;
91 TUint iDestroying : 1;
93 ASubSessionPlatsecApiExt* iPlatsecApiExt;
94 const Meta::SMetaData* iProvision;
95 RConnPrefList iConnPrefList;
101 #endif //__SS_CONNSELECT_H__