webservices/wsoviplugin/src/wsoviregisterhandler.cpp
branchRCL_3
changeset 20 32ab7ae9ec94
parent 1 272b002df977
equal deleted inserted replaced
19:9e96e2676219 20:32ab7ae9ec94
    49     }
    49     }
    50 
    50 
    51 // Destructor
    51 // Destructor
    52 CWSOviRegisterHandler::~CWSOviRegisterHandler()
    52 CWSOviRegisterHandler::~CWSOviRegisterHandler()
    53     {
    53     {
       
    54     TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviRegisterHandler::~CWSOviRegisterHandler()");
    54     }
    55     }
    55 
    56 
    56 // Second phase construction.
    57 // Second phase construction.
    57 void CWSOviRegisterHandler::ConstructL()
    58 void CWSOviRegisterHandler::ConstructL()
    58     {
    59     {
       
    60     TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviRegisterHandler::ConstructL()");
    59     }
    61     }
    60     
    62     
    61 TInt CWSOviRegisterHandler::InvokeL(MSenSessionContext& aCtx)
    63 TInt CWSOviRegisterHandler::InvokeL(MSenSessionContext& aCtx)
    62     {
    64     {
       
    65     TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviRegisterHandler::InvokeL()");
    63     MSenServiceDescription& pServiceDescription = *(MSenServiceDescription*)aCtx.GetSenWSDescriptionL(WSOviContextKeys::KServiceDescription());
    66     MSenServiceDescription& pServiceDescription = *(MSenServiceDescription*)aCtx.GetSenWSDescriptionL(WSOviContextKeys::KServiceDescription());
    64     const TDesC8* action = aCtx.GetDesC8L(WSOviContextKeys::KRegisterAction());
    67     const TDesC8* action = aCtx.GetDesC8L(WSOviContextKeys::KRegisterAction());
    65     TInt result(KErrNone);
    68     TInt result(KErrNone);
    66     if (*action == WSOviContextValues::KActionRegister())
    69     if (*action == WSOviContextValues::KActionRegister())
    67         {
    70         {
   146 //---------------------------------------------------------------------------
   149 //---------------------------------------------------------------------------
   147 //
   150 //
   148 TInt CWSOviRegisterHandler::UnregisterServiceDescriptionL(
   151 TInt CWSOviRegisterHandler::UnregisterServiceDescriptionL(
   149     MSenServiceDescription& aServiceDescription)
   152     MSenServiceDescription& aServiceDescription)
   150     {
   153     {
       
   154     TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviRegisterHandler::UnregisterServiceDescriptionL()");
   151     TInt retval(KErrNone);
   155     TInt retval(KErrNone);
   152     CWSOviServiceSession *pSession = NULL;
   156     CWSOviServiceSession *pSession = NULL;
   153     TPtrC8 contract = aServiceDescription.Contract();
   157     TPtrC8 contract = aServiceDescription.Contract();
   154 
   158 
   155     if(contract == KWSOviAuthenticationServiceContract)
   159     if(contract == KWSOviAuthenticationServiceContract)
   266     CWSOviOAuthClient* pAuthClient = NULL;
   270     CWSOviOAuthClient* pAuthClient = NULL;
   267 
   271 
   268     if(aServiceDescription->DescriptionClassType() ==
   272     if(aServiceDescription->DescriptionClassType() ==
   269                 MSenServiceDescription::EOviOAuthClient)
   273                 MSenServiceDescription::EOviOAuthClient)
   270         {
   274         {
   271         TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviRegisterHandler::CWSOviRegisterHandler - This ServiceDescription is already an NAUTH Client")));
   275         TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviRegisterHandler::UnRegisterAuthClientL - This ServiceDescription is already an NAUTH Client")));
   272         pAuthClient = (CWSOviOAuthClient*)aServiceDescription;
   276         pAuthClient = (CWSOviOAuthClient*)aServiceDescription;
   273         retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pAuthClient);
   277         retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pAuthClient);
   274         }
   278         }
   275     else
   279     else
   276         {
   280         {
   277         
   281         TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviRegisterHandler::UnRegisterAuthClientL - This ServiceDescription is not NAUTH Client")));
   278         pSession = CWSOviServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));
   282         pSession = CWSOviServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));
   279         retval = pSession->InitializeFromL(*aServiceDescription);
   283         retval = pSession->InitializeFromL(*aServiceDescription);
   280         if(retval != KErrNone)
   284         if(retval != KErrNone)
   281             {
   285             {
   282             CleanupStack::PopAndDestroy(pSession);
   286             CleanupStack::PopAndDestroy(pSession);