contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h
branchRCL_3
changeset 14 15e4dd19031c
parent 0 79c6a41cd166
child 19 edd621764147
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:  Server Session
    14  * Description:  Server Session
    15  *
    15  *
    16 */
    16  */
    17 
       
    18 
    17 
    19 #ifndef C_CCPSERVERSESSION_H
    18 #ifndef C_CCPSERVERSESSION_H
    20 #define C_CCPSERVERSESSION_H
    19 #define C_CCPSERVERSESSION_H
    21 
    20 
    22 // INCLUDES
    21 // INCLUDES
    49     // New methods
    48     // New methods
    50 
    49 
    51     /**
    50     /**
    52      * Two-phased constructor.
    51      * Two-phased constructor.
    53      */
    52      */
    54     static CCPServerSession* NewL( TPointersForSession& aPasser );
    53     static CCPServerSession* NewL(TPointersForSession& aPasser);
    55 
    54 
    56     /**
    55     /**
    57      * Two-phased constructor.
    56      * Two-phased constructor.
    58      */
    57      */
    59     static CCPServerSession* NewLC( TPointersForSession& aPasser );
    58     static CCPServerSession* NewLC(TPointersForSession& aPasser);
    60 
    59 
    61     /**
    60     /**
    62      * Destroy the object and release all memory objects
    61      * Destroy the object and release all memory objects
    63      */
    62      */
    64     virtual ~CCPServerSession();
    63     virtual ~CCPServerSession();
    69     /**
    68     /**
    70      * Called after a service request from client
    69      * Called after a service request from client
    71      * @param aMessage message from client (containing requested operation 
    70      * @param aMessage message from client (containing requested operation 
    72      * and any data)
    71      * and any data)
    73      */
    72      */
    74     void ServiceL( const RMessage2& aMessage );
    73     void ServiceL(const RMessage2& aMessage);
    75 
    74 
    76     /**
    75     /**
    77      * Selects correct function from message
    76      * Selects correct function from message
    78      * @param aMessage message from client (containing requested operation 
    77      * @param aMessage message from client (containing requested operation 
    79      * and any data)
    78      * and any data)
    80      */
    79      */
    81     void DispatchMessageL( const RMessage2& aMessage, TBool& aPanicedClient );
    80     void DispatchMessageL(const RMessage2& aMessage, TBool& aPanicedClient);
    82 
    81 
    83 private:
    82 private:
    84     // New methods
    83     // New methods
    85 
    84 
    86     /**
    85     /**
    89     CCPServerSession();
    88     CCPServerSession();
    90 
    89 
    91     /**
    90     /**
    92      * Perform the second phase construction of a CCPServerSession object
    91      * Perform the second phase construction of a CCPServerSession object
    93      */
    92      */
    94     void ConstructL( TPointersForSession& aPasser );
    93     void ConstructL(TPointersForSession& aPasser);
    95 
    94 
    96     /**
    95     /**
    97      * Add Data request
    96      * Add Data request
    98      * @param Message from client
    97      * @param Message from client
    99      */
    98      */
   100     void AddDataL( const RMessage2& aMessage );
    99     void AddDataL(const RMessage2& aMessage);
   101 
   100 
   102     /**
   101     /**
   103      * Specific add data request - data is not actually added to database
   102      * Specific add data request - data is not actually added to database
   104      * but notification is send.
   103      * but notification is send.
   105      * @param Message from client
   104      * @param Message from client
   106      */
   105      */
   107     void AddDataNonPersistentL( const RMessage2& aMessage );
   106     void AddDataNonPersistentL(const RMessage2& aMessage);
   108 
   107 
   109     /**
   108     /**
   110      * Get data request - first phase
   109      * Get data request - first phase
   111      * @param Message from client
   110      * @param Message from client
   112      */
   111      */
   113     void GetListSizeL( const RMessage2& aMessage );
   112     void GetListSizeL(const RMessage2& aMessage);
   114 
   113 
   115     /**
   114     /**
   116      * Get data request - second phase
   115      * Get data request - second phase
   117      * @param Message from client
   116      * @param Message from client
   118      */
   117      */
   119     void GetListDataL( const RMessage2& aMessage );
   118     void GetListDataL(const RMessage2& aMessage);
   120 
   119 
   121     /**
   120     /**
   122      * Remove data request
   121      * Remove data request
   123      * @param Message from client
   122      * @param Message from client
   124      */
   123      */
   125     void RemoveDataL( const RMessage2& aMessage );
   124     void RemoveDataL(const RMessage2& aMessage);
   126 
   125 
   127     /**
   126     /**
   128      * Executes action request
   127      * Executes action request
   129      * @param Message from client
   128      * @param Message from client
   130      */
   129      */
   131     void ExecuteActionL( const RMessage2& aMessage );
   130     void ExecuteActionL(const RMessage2& aMessage);
       
   131 
       
   132     /**
       
   133      * Executes actions and sends notifications
       
   134      * @param aMap input map from client
       
   135      * @param aEnableCache indicates if action data should be cached
       
   136      * @param aOptions command options
       
   137      */
       
   138     void ExecuteActionL(const CCPLiwMap* aMap,
       
   139             TBool aEnableCache, TUint aOptions);
       
   140     
       
   141     /**
       
   142      * Executes multiple actions request
       
   143      * @param Message from client
       
   144      */
       
   145     void ExecuteMultipleActionsL(const RMessage2& aMessage);
   132 
   146 
   133     /**
   147     /**
   134      * Executes action request
   148      * Executes action request
   135      * @param aActionParams list with actions
   149      * @param aActionParams list with actions
   136      */
   150      */
   137     void ExecuteL( const CLiwGenericParamList& aActionParams );
   151     void ExecuteL(const CLiwGenericParamList& aActionParams);
   138 
   152 
   139     /**
   153     /**
   140      * Register for notification request
   154      * Register for notification request
   141      * @param Message from client
   155      * @param Message from client
   142      */
   156      */
   143     void RegisterObserverL( const RMessage2& aMessage );
   157     void RegisterObserverL(const RMessage2& aMessage);
   144 
   158 
   145     /**
   159     /**
   146      * Adds new observer
   160      * Adds new observer
   147      * @param Message from client
   161      * @param Message from client
   148      */
   162      */
   149     void AddObserverL( const RMessage2& aMessage );
   163     void AddObserverL(const RMessage2& aMessage);
   150 
   164 
   151     /**
   165     /**
   152      * Removes observer
   166      * Removes observer
   153      * @param Message from client
   167      * @param Message from client
   154      */
   168      */
   155     void RemoveObserverL( const RMessage2& aMessage );    
   169     void RemoveObserverL(const RMessage2& aMessage);
   156     
   170 
   157     /**
   171     /**
   158      * Unregister from notification request
   172      * Unregister from notification request
   159      * @param Message from client
   173      * @param Message from client
   160      */
   174      */
   161     void UnregisterObserverL();
   175     void UnregisterObserverL();
   162 
   176 
   163     /**
   177     /**
   164      * Send information about change in database to client
   178      * Send information about change in database to client
   165      * @param Message from client
   179      * @param Message from client
   166      */
   180      */
   167     void GetChangeInfoDataL( const RMessage2& aMessage );
   181     void GetChangeInfoDataL(const RMessage2& aMessage);
   168 
   182 
   169     /**
   183     /**
   170      * Converts CLiwGenericParamList to descriptor and
   184      * Converts CLiwGenericParamList to descriptor and
   171      * sends to client
   185      * sends to client
   172      * @param Message to complete 
   186      * @param Message to complete 
   173      * @param Parameters for message
   187      * @param Parameters for message
   174      */
   188      */
   175     void ExternalizeAndWriteToClientL( const RMessage2& aMessage,
   189     void ExternalizeAndWriteToClientL(const RMessage2& aMessage,
   176         const CLiwGenericParamList* outParamList );
   190             const CLiwGenericParamList* outParamList);
   177     
   191 
   178      /**
   192     /**
   179       * Unpacks message from client to map
   193      * Unpacks message from client to map
   180       * @param Message to complete 
   194      * @param Message to complete 
   181       * @return CCPLiwMap with data from client
   195      * @return CCPLiwMap with data from client
   182       */
   196      */
   183     CCPLiwMap* UnpackFromClientLC( const RMessage2& aMessage );
   197     CCPLiwMap* UnpackFromClientLC(const RMessage2& aMessage);
   184 
   198 
   185      /**
   199     /**
   186       * Send notification
   200      * Send notification
   187       * @param aNotificationList
   201      * @param aNotificationList
   188       */
   202      */
   189     void SendNotificationL( CCPLiwMap* aMap,
   203     void SendNotificationL(CCPLiwMap* aMap,
   190     		CLiwDefaultList* aNotificationList ); 
   204             CLiwDefaultList* aNotificationList);
   191 
   205 
   192     /**
   206     /**
   193      * Get and Execute Activate or Deactivate action from the DB 
   207      * Get and Execute Activate or Deactivate action from the DB 
   194      * @param Map containing ids of item
   208      * @param Map containing ids of item
   195      */
   209      */
   196     void GetAndExecuteActionL( CCPLiwMap* aMap, CLiwDefaultList* aNotificationList,
   210     void GetAndExecuteActionL( CCPLiwMap* aMap, CLiwDefaultList* aNotificationList,
   197     		TBool aInsertTrigger = EFalse );
   211     		TBool aInsertTrigger = EFalse );
   198     
   212 
   199     /**
   213     /**
   200      * Get Server Lock
   214      * Get Server Lock
   201      * @return ETrue if aMessege cannot be processed
   215      * @return ETrue if aMessege cannot be processed
   202      * because Backup or Restore is running 
   216      * because Backup or Restore is running 
   203      **/
   217      **/
   204     TBool GetServerLock( const RMessage2& aMessage );
   218     TBool GetServerLock(const RMessage2& aMessage);
   205        
   219 
       
   220     /**
       
   221      * Unpacks data for ExecuteMultipleActions from client
       
   222      * @param Message from client
       
   223      * @return list containing input data from the client
       
   224      **/
       
   225     CLiwGenericParamList* UnpackForMultiExecuteLC(const RMessage2& aMessage);
       
   226 
       
   227     /**
       
   228      * Checks map validity of input data and returns list 
       
   229      * that can be used to call execute
       
   230      * @param aMaps input data
       
   231      * @return list containing input maps for Execute
       
   232      **/
       
   233     CLiwDefaultList* CheckValidityLC(const CLiwList* aMaps);
       
   234     
   206 private:
   235 private:
   207 
   236 
   208     /*
   237     /*
   209      * Own.
   238      * Own.
   210      * Handler for asynchronous request for notifications
   239      * Handler for asynchronous request for notifications