webservices/wsoviplugin/src/wsovisessionconsumer.cpp
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2008 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 "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:           
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 // INCLUDE FILES
       
    29 #include <SenXmlUtils.h>
       
    30 
       
    31 #include "wsovisessionconsumer.h"
       
    32 #include "sendebug.h"
       
    33 #include <SenServiceConnection.h>
       
    34 #include "senlogger.h"
       
    35 #include "wsovicons.h"
       
    36 #include "SenHttpTransportProperties.h"
       
    37 
       
    38 CWSOviSessionConsumer* CWSOviSessionConsumer::NewL( MSenRemoteServiceConsumer& aServiceConsumer)
       
    39     {
       
    40     CWSOviSessionConsumer* pSelf =
       
    41         CWSOviSessionConsumer::NewLC(aServiceConsumer);
       
    42     CleanupStack::Pop(pSelf);
       
    43     return pSelf;
       
    44     }
       
    45 
       
    46 CWSOviSessionConsumer* CWSOviSessionConsumer::NewLC( MSenRemoteServiceConsumer& aServiceConsumer)
       
    47     {
       
    48     CWSOviSessionConsumer* pSelf =
       
    49                         new (ELeave) CWSOviSessionConsumer( aServiceConsumer);
       
    50     CleanupStack::PushL(pSelf);
       
    51     pSelf->ConstructL();
       
    52     return pSelf;
       
    53     }
       
    54 
       
    55 CWSOviSessionConsumer::~CWSOviSessionConsumer()
       
    56     {
       
    57     iSentMessages.Reset();
       
    58     iSendReplyTo.Reset();
       
    59     iTranspProp.Reset();
       
    60     }
       
    61 
       
    62 CWSOviSessionConsumer::CWSOviSessionConsumer( MSenRemoteServiceConsumer& aServiceConsumer)
       
    63 :   iConsumer(aServiceConsumer),
       
    64     iSentMessages(ETrue, ETrue),
       
    65     iSendReplyTo(ETrue, ETrue),
       
    66     iTranspProp(ETrue, ETrue)
       
    67     {
       
    68     }
       
    69 
       
    70 
       
    71 const TDesC8& CWSOviSessionConsumer::Id() const
       
    72     {
       
    73     return iConsumer.Id();
       
    74     }
       
    75 
       
    76 TInt CWSOviSessionConsumer::SetSessionL(MSenRemoteServiceSession& aServiceSession)
       
    77     {
       
    78     iConsumer.SetSessionL(aServiceSession);
       
    79     return KErrNone;
       
    80     }
       
    81 
       
    82 
       
    83 TInt CWSOviSessionConsumer::HandleMessageL( HBufC8* apMessage,
       
    84                                              const TInt aTxnId,
       
    85                                              MSenProperties* aResponseTransportProperties )
       
    86     {
       
    87     return iConsumer.HandleMessageL(apMessage, aTxnId, aResponseTransportProperties);
       
    88     }
       
    89 
       
    90 TInt CWSOviSessionConsumer::HandleErrorL( HBufC8* apError,
       
    91                                            const TInt aErrorCode,
       
    92                                            const TInt aTxnId,
       
    93                                            MSenProperties* aResponseTransportProperties )
       
    94     {
       
    95     return iConsumer.HandleErrorL(apError, aErrorCode, aTxnId, aResponseTransportProperties);
       
    96     }
       
    97 
       
    98 void CWSOviSessionConsumer::SetStatusL(const TInt status)
       
    99     {
       
   100     TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviSessionConsumer::SetStatusL");
       
   101     iConsumer.SetStatusL(status);
       
   102     }
       
   103 
       
   104 TInt CWSOviSessionConsumer::MessageForSendingL(CSenHttpTransportProperties*& /*aTP*/,
       
   105                                            CWSOviMessageContext*& /*aCtx*/)
       
   106     {
       
   107     TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviSessionConsumer::MessageForSendingL");
       
   108     return KErrNone;
       
   109     }
       
   110 
       
   111 void CWSOviSessionConsumer::ConstructL()
       
   112     {
       
   113     }
       
   114 
       
   115 
       
   116 const TDesC8& CWSOviSessionConsumer::TransportProperties(
       
   117         const TDesC8& aMessageID) const
       
   118     {
       
   119     TInt index = iTranspProp.Find(aMessageID);
       
   120     if (index != KErrNotFound)
       
   121         {
       
   122         const TDesC8* tp = iTranspProp.ValueAt(index);
       
   123         if (tp)
       
   124             {
       
   125             return *tp;
       
   126             }
       
   127         }
       
   128     return KNullDesC8;
       
   129     }
       
   130 
       
   131 MSenTransport& CWSOviSessionConsumer::TransportL()
       
   132     {
       
   133     return iConsumer.TransportL();
       
   134     }
       
   135     
       
   136 TInt CWSOviSessionConsumer::ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk)
       
   137     {
       
   138     return iConsumer.ChunkByTxnIdL(aTxnId, aChunk);
       
   139     }
       
   140 
       
   141 void CWSOviSessionConsumer::FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/, TBool /*aIsSoap*/,
       
   142                 const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/)
       
   143     {
       
   144     }
       
   145 
       
   146 CSenIdentifier& CWSOviSessionConsumer::Identifier() const
       
   147     {
       
   148     return iConsumer.Identifier();
       
   149     }
       
   150 
       
   151     
       
   152 TBool CWSOviSessionConsumer::HasAuthenticationCallback()
       
   153     {
       
   154     return iConsumer.HasAuthenticationCallback();
       
   155     }
       
   156 
       
   157 TInt CWSOviSessionConsumer::ReauthenticationNeededL(CSenIdentityProvider*& aIdp)
       
   158 	{
       
   159 	return iConsumer.ReauthenticationNeededL(aIdp);
       
   160 	}
       
   161 
       
   162 void CWSOviSessionConsumer::SetDataTrafficDetails( TSenDataTrafficDetails&  aDetails)  
       
   163 	{
       
   164 	iConsumer.SetDataTrafficDetails(aDetails);
       
   165 	}
       
   166 // End of file
       
   167