webservices/wsstar/wsstarplugin/inc/wsstarregisterhandler.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef WSSTAR_REGISTER_HANDLER_H
       
    26 #define WSSTAR_REGISTER_HANDLER_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <e32std.h>
       
    30 #include <flogger.h>
       
    31 #include "sensessionhandler.h"
       
    32 #include "wsstarhandlercontext.h"
       
    33 #include "wsstarsessioncontext.h"
       
    34 #include "wsstarcons.h"
       
    35 #include "wsstarservicesession.h"
       
    36 #include "SenServiceConnection.h"
       
    37 
       
    38 
       
    39 /**
       
    40  * Class:CWSStarRegisterHandler
       
    41  *
       
    42  * An implementation of the CWSStarSessionHandler definition. This is concrete
       
    43  * class, instance of which ECOM framework gives to ECOM clients.
       
    44  *
       
    45  * Class represent phase related to session, before discovering and validation.
       
    46  *      Main goal is to indirectly implement (by passing session context) SIF method:
       
    47  *          -registegr/unregister service description
       
    48  */
       
    49 class CWSStarRegisterHandler : public CSenSessionHandler
       
    50     {
       
    51 
       
    52     public:
       
    53         /**
       
    54          * Function:    NewL
       
    55          *
       
    56          * Description: Create instance of concrete implementation. Note that ECOM
       
    57          *              interface implementations can only have two signatures for
       
    58          *              NewL:
       
    59          *               - NewL without parameters (used here)
       
    60          *               - NewL with TAny* pointer, which may provide some client
       
    61          *                 data
       
    62          *
       
    63          * Returns:    Instance of this class.
       
    64          *
       
    65          * Note:       The interface, which is abstract base class of this
       
    66          *             implementation, also provides NewL method. Normally abstract
       
    67          *             classes do not provide NewL, because they cannot create
       
    68          *             instances of themselves.
       
    69          */
       
    70 
       
    71         static CWSStarRegisterHandler* NewL(TAny* aHandlerCtx);
       
    72         virtual TInt InvokeL(MSenSessionContext& aCtx);
       
    73         ~CWSStarRegisterHandler();
       
    74         
       
    75         virtual SenHandler::THandlerDirection Direction() const;
       
    76         virtual SenHandler::THandlerPhase Phase();
       
    77         virtual TInt InitL(MSenHandlerContext& aCtx);
       
    78         
       
    79             
       
    80     protected:
       
    81         /**
       
    82          * Function:   CWSStarRegisterHandler
       
    83          *
       
    84          * Discussion: Perform the first phase of two phase construction
       
    85          */
       
    86         CWSStarRegisterHandler(MSenHandlerContext& aCtx);
       
    87         
       
    88         
       
    89         /**
       
    90          * Function:   ConstructL
       
    91          *
       
    92          * Discussion: Perform the second phase construction of a
       
    93          *             CImplementationClassPlus object.
       
    94          */
       
    95         void ConstructL();
       
    96 
       
    97 
       
    98     private:
       
    99         /**
       
   100          * Attempt to register the ServiceDescription. 
       
   101          *   In fact session is created but not vaidated and added into CoreManager.
       
   102          *   So registering different to adding that it doesnt validate, just register.
       
   103          *   Common issue is increase core database by one session (validated or not)
       
   104          *
       
   105          * @param aServiceDescription A ServiceDescription
       
   106          *
       
   107          *  return TInt aError - indicates the error or KErrNone if successful
       
   108          */
       
   109         virtual TInt RegisterServiceDescriptionL(
       
   110                                     MSenServiceDescription& aServiceDescription);
       
   111 
       
   112 
       
   113         /**
       
   114          * Attempt to unregister the ServiceDescription from the ServiceManager
       
   115          * that owns the framework.
       
   116          * This is a callback used by the ServiceManager.
       
   117          *
       
   118          * @param aServiceDescription A ServiceDescription
       
   119          *
       
   120          *  return TInt aError - indicates the error or KErrNone if successful
       
   121          */
       
   122         virtual TInt UnregisterServiceDescriptionL(
       
   123                                     MSenServiceDescription& aServiceDescription);
       
   124 
       
   125         /**
       
   126          * Register specific description (STS contract)
       
   127          */
       
   128         TInt RegisterSTSClientL(MSenServiceDescription *aServiceDescription);
       
   129         
       
   130         /**
       
   131          * Unregister specific description (STS contract)
       
   132          */
       
   133         TInt UnRegisterSTSClientL(MSenServiceDescription* aServiceDescription);
       
   134         RFileLogger* Log() const;
       
   135     };
       
   136 
       
   137 
       
   138 #endif // WSSTAR_HANDLER_REGISTER_PLUGIN_H
       
   139