webservices/wsframework/src/seninternalserviceconsumer.cpp
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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 <w32std.h>
       
    30 
       
    31 #include "seninternalserviceconsumer.h"
       
    32 #include "senservicesession.h"
       
    33 #include "senidentifier.h"
       
    34 
       
    35 //#include "MSenPolicy.h" // internal ServiceDescription\inc 
       
    36 #include "senpolicy.h" // internal ServiceDescription\inc 
       
    37 #include "sendebug.h" // internal Utils\inc
       
    38 
       
    39 EXPORT_C CSenInternalServiceConsumer::CSenInternalServiceConsumer(
       
    40                                                 TDescriptionClassType aType,
       
    41                                                 CSIF& aSIF)
       
    42 :   CSenWSDescription(aType),
       
    43     iSIF(aSIF),
       
    44     //iPolicy(NULL), // deprecated, not in use
       
    45     ipConsumerId(NULL),
       
    46     ipIdentifier(NULL)
       
    47     {
       
    48     }
       
    49 
       
    50 
       
    51 EXPORT_C void CSenInternalServiceConsumer::ConstructL()
       
    52     {
       
    53     // Set the local name to "ServiceDescription"
       
    54     // and initialize the inner ipElement
       
    55     CSenWSDescription::ConstructL();
       
    56 
       
    57     // Construct an empty policy
       
    58     // iPolicy = CSenPolicy::NewL(); // deprecated, not in use
       
    59 
       
    60     ipConsumerId = iSIF.Manager().RandomGuidL();
       
    61     ipIdentifier = CSenIdentifier::NewL(SenIdentifier::ESession, 
       
    62                                         *ipConsumerId);
       
    63     }
       
    64 
       
    65 EXPORT_C CSenInternalServiceConsumer::~CSenInternalServiceConsumer()
       
    66     {
       
    67     //delete iPolicy; // deprecated, not in use
       
    68     delete ipConsumerId;
       
    69     delete ipIdentifier;
       
    70     }
       
    71 
       
    72 EXPORT_C TBool CSenInternalServiceConsumer::IsReadyL()
       
    73     {
       
    74     if(!ServiceSession())
       
    75         {
       
    76         return EFalse;
       
    77         }
       
    78     else
       
    79         {
       
    80         return ServiceSession()->IsReadyL();
       
    81         }
       
    82     }
       
    83 
       
    84 EXPORT_C const TDesC8& CSenInternalServiceConsumer::Id() const
       
    85     {
       
    86     if(ipConsumerId)
       
    87         {
       
    88         return *ipConsumerId;
       
    89         }
       
    90     else
       
    91         {
       
    92         return KNullDesC8();
       
    93         }
       
    94     }
       
    95 
       
    96 EXPORT_C TInt CSenInternalServiceConsumer::SetSessionL(MSenRemoteServiceSession& /* aServiceSession */)
       
    97     {
       
    98     return KErrNone;
       
    99     }
       
   100 
       
   101 EXPORT_C TInt CSenInternalServiceConsumer::HandleMessageL(HBufC8* apMessage,
       
   102                                                           const TInt /* aTxnId */,
       
   103                                                           MSenProperties* /* aResponseTransportProperties */)
       
   104     {
       
   105     delete apMessage;
       
   106     return KErrNone; // KErrNotImplemented
       
   107     }
       
   108 
       
   109 
       
   110 EXPORT_C TInt CSenInternalServiceConsumer::HandleErrorL(HBufC8* apError,
       
   111                                                         const TInt /* aErrorCode */,
       
   112                                                         const TInt /* aTxnId */,
       
   113                                                         MSenProperties* /* aResponseTransportProperties */)
       
   114     {
       
   115     delete apError;
       
   116     return KErrNone; // KErrNotImplemented
       
   117     }
       
   118 
       
   119 EXPORT_C void CSenInternalServiceConsumer::SetStatusL(const TInt /* aStatus */)
       
   120     {
       
   121     }
       
   122 
       
   123 EXPORT_C CSIF& CSenInternalServiceConsumer::Framework()
       
   124     {
       
   125     return iSIF;
       
   126     }
       
   127 
       
   128 /*
       
   129 EXPORT_C RFileLogger* CSenInternalServiceConsumer::Log() const
       
   130     {
       
   131     // logs all into the service invocation framework's log:
       
   132     return iSIF.Log();
       
   133 */
       
   134 
       
   135 EXPORT_C CSenIdentifier& CSenInternalServiceConsumer::Identifier() const
       
   136     {
       
   137     return *ipIdentifier;
       
   138     }
       
   139 
       
   140 EXPORT_C TInt CSenInternalServiceConsumer::ChunkByTxnIdL(TInt /* aTxnId */, CSenChunk*& /* aChunk */)
       
   141     {
       
   142     return KErrNotSupported;
       
   143     }
       
   144 
       
   145 EXPORT_C TBool CSenInternalServiceConsumer::HasSuperClass( TDescriptionClassType aType )
       
   146     {
       
   147     if( aType == MSenServiceDescription::EWSDescription ) // direct superclass!
       
   148         {
       
   149         // If asked type is the know *direct* father/mother, return true:
       
   150         return ETrue; 
       
   151         } 
       
   152     else
       
   153         {
       
   154         // Otherwise, ask from superclass (chain, recursively)
       
   155         return CSenWSDescription::HasSuperClass( aType ); 
       
   156         }
       
   157     }
       
   158 
       
   159 EXPORT_C void CSenInternalServiceConsumer::FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/, TBool /*aIsSoap*/,
       
   160                 const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/)
       
   161     {
       
   162     }
       
   163 EXPORT_C void CSenInternalServiceConsumer::SetDataTrafficDetails( TSenDataTrafficDetails& /* aDetails*/)  
       
   164 	{
       
   165 	}
       
   166 
       
   167 
       
   168 // End of File