|
1 // Copyright (c) 2008-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // @file |
|
15 // @internalComponent |
|
16 // System Includes |
|
17 // |
|
18 // |
|
19 |
|
20 #include<ss_glob.h> |
|
21 #include <ecom/ecom.h> |
|
22 |
|
23 //Local Includes |
|
24 #include "upnppint.h" |
|
25 #include "upnpflowbase.h" |
|
26 #include "upnpflowfactory.h" |
|
27 #include "httpserver.h" |
|
28 #include "app_protintf_msgs.h" |
|
29 |
|
30 using namespace ESock; |
|
31 using namespace Messages; |
|
32 |
|
33 CUPnPProtocolIntfBase* CUPnPProtocolIntfBase::NewL(CProtocolIntfFactoryBase& aFactory,const TNodeId& aId) |
|
34 { |
|
35 CUPnPProtocolIntfBase* protProv = new(ELeave) CUPnPProtocolIntfBase(aFactory, aId); |
|
36 CleanupStack::PushL(protProv); |
|
37 protProv->ConstructL(); |
|
38 CleanupStack::Pop(protProv); |
|
39 return protProv; |
|
40 } |
|
41 |
|
42 CUPnPProtocolIntfBase::CUPnPProtocolIntfBase ( CProtocolIntfFactoryBase& aFactory,const TNodeId& aId ) |
|
43 : CProtocolIntfBase ( aFactory, aId ) |
|
44 { } |
|
45 |
|
46 void CUPnPProtocolIntfBase::ConstructL() |
|
47 { |
|
48 //The genreric listener. Should be moved to seperate library once EC120 is done. |
|
49 iAppProtIntfFactoryContainer = CAppProtIntfFactoryContainer::NewL(); |
|
50 TAppProtIntfMessage::RegisterL(); |
|
51 } |
|
52 |
|
53 CUPnPProtocolIntfBase::~CUPnPProtocolIntfBase () |
|
54 { |
|
55 delete iAppProtIntfFactoryContainer; |
|
56 TAppProtIntfMessage::DeRegister(); |
|
57 } |
|
58 |
|
59 void CUPnPProtocolIntfBase::AddServiceUriL ( const TDesC8& aUri, MHttpEventObserver& aObserver, TNodeCtxId aServiceId, TNodeCtxId aControlProviderId ) |
|
60 { |
|
61 if ( !iHttpServer ) |
|
62 iHttpServer = CHttpServer::NewL (this); |
|
63 |
|
64 iHttpServer->AddServiceUriL( aUri, aObserver, aServiceId, aControlProviderId ); |
|
65 } |
|
66 |
|
67 void CUPnPProtocolIntfBase::RemoveServiceUri ( const TDesC8& aUri, TNodeCtxId aServiceId, TNodeCtxId aControlProviderId ) |
|
68 { |
|
69 if ( iHttpServer->RemoveServiceUri( aUri, aServiceId, aControlProviderId ) ) |
|
70 { |
|
71 iHttpServer = NULL; // httpserver makes self deletion, once listener leave completes |
|
72 } |
|
73 } |
|
74 |
|
75 void CUPnPProtocolIntfBase::SetChunkManager(CChunkManager* aChunkManager) |
|
76 { |
|
77 iMemChunkManager = aChunkManager; |
|
78 } |
|
79 |
|
80 CChunkManager* CUPnPProtocolIntfBase::GetMemoryChunkManager() |
|
81 { |
|
82 return iMemChunkManager; |
|
83 } |
|
84 |
|
85 const TNodeId& CUPnPProtocolIntfBase::GetAppProtIntfContainerId() |
|
86 { |
|
87 return iAppProtIntfFactoryContainer->Id(); |
|
88 } |
|
89 |
|
90 |