webservices/wsprovider/inc/senhostletrequest.h
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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_HOSTLET_REQUEST_H
       
    26 #define SEN_HOSTLET_REQUEST_H
       
    27 
       
    28 #include <e32base.h>
       
    29 
       
    30 #include "MSenHostletRequest.h"
       
    31 #include "MSenProperties.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CSenIdentifier;
       
    35 class CSenChunk;
       
    36 
       
    37 class CSenHostletRequest : public CBase, public MSenHostletRequest
       
    38     {
       
    39     
       
    40     public:
       
    41         /**
       
    42         * Static 2-phased constructor
       
    43         *
       
    44         * Descriptors are not copied, it will only be referenced
       
    45         * by the provider processing this request.
       
    46         * @param aRequestUtf8 must contains reference to the actual
       
    47         * request message (body, or complete message with one or more
       
    48         * headers, depending on whether or not the hostlet wishes to
       
    49         * receive complete client messages). Note that the caller of
       
    50         * this static constructor needs to keep this reference alive
       
    51         * as long as hostlet request object exists, since *no* copy
       
    52         * of original descriptor is made, but direct reference is 
       
    53         * stored instead.
       
    54         * @param aThreadId pointing to requester thread (typically full
       
    55         * name of that thread). Note that descriptor is not copied, but
       
    56         * it needs to be kept alive by the caller instead (mandatory).
       
    57         * @param aConsumerId pointing to requester service consumer 
       
    58         * (typically some URN). Note that descriptor is not copied, but
       
    59         * it needs to be kept alive by the caller instead (mandatory).
       
    60         * @return pointer to new hostler request instance
       
    61         */
       
    62         IMPORT_C static CSenHostletRequest* NewL(const TInt aRequestId,
       
    63                                                  const TDesC8& aRequestUtf8,
       
    64                                                  RThread aThread,
       
    65                                                  const CSenIdentifier& aConsumerId,
       
    66                                                  CSenChunk* apChunk);
       
    67         /**
       
    68         * Static 2-phased constructor
       
    69         *
       
    70         * Descriptor are not copied, it will only be referenced
       
    71         * by the provider processing this request.
       
    72         * @param aRequestUtf8 must contains reference to the actual
       
    73         * request message (body, or complete message with one or more
       
    74         * headers, depending on whether or not the hostlet wishes to
       
    75         * receive complete client messages). Note that the caller of
       
    76         * this static constructor needs to keep this reference alive
       
    77         * as long as hostlet request object exists, since *no* copy
       
    78         * of original descriptor is made, but direct reference is 
       
    79         * stored instead.
       
    80         * @param aThreadId pointing to requester thread (typically full
       
    81         * name of that thread). Note that descriptor is not copied, but
       
    82         * it needs to be kept alive by the caller instead (mandatory).
       
    83         * @param aConsumerId pointing to requester service consumer 
       
    84         * (typically some URN). Note that descriptor is not copied, but
       
    85         * it needs to be kept alive by the caller instead (mandatory).
       
    86         * @param apChunk
       
    87         * @return pointer to new hostler request instance, which
       
    88         * has been left on cleanup stack.
       
    89         */
       
    90         IMPORT_C static CSenHostletRequest* NewLC(const TInt aRequestId,
       
    91                                                   const TDesC8& aRequestUtf8,
       
    92                                                   RThread aThread,
       
    93                                                   const CSenIdentifier& aConsumerId,
       
    94                                                   CSenChunk* apChunk);
       
    95         
       
    96     public:
       
    97         // From MSenHostletRequest
       
    98         IMPORT_C virtual TPtrC8 RequestUtf8() const;
       
    99 
       
   100         // Destructor
       
   101         IMPORT_C virtual ~CSenHostletRequest();
       
   102 
       
   103         /**
       
   104         * Getter for requester thread id
       
   105         */
       
   106         IMPORT_C virtual TPtrC ThreadId() const;
       
   107 
       
   108         /** 
       
   109         * Getter for requester consumer id
       
   110         */
       
   111         IMPORT_C virtual TPtrC8 ConsumerId() const;
       
   112         
       
   113         /** 
       
   114         * Getter for request id
       
   115         */
       
   116         IMPORT_C virtual TInt RequestId() const;
       
   117         
       
   118         /**
       
   119         * Getter for request properties and type
       
   120         */
       
   121         IMPORT_C virtual TPtrC8 Properties(MSenProperties::TSenPropertiesClassType& aType) const;
       
   122                 
       
   123 
       
   124     private:
       
   125         // C++ constructor
       
   126         CSenHostletRequest(const TInt aRequestId,
       
   127                            const TDesC8& aRequestUtf8, 
       
   128                            RThread aThread,
       
   129                            const CSenIdentifier& aConsumerId,
       
   130                            CSenChunk* apChunk);
       
   131                            
       
   132         void ConstructL();
       
   133         
       
   134     private: // Data
       
   135         TInt iRequestId;
       
   136         TPtrC8 iRequestUtf8;                        // not owned reference to the request
       
   137         RThread iThread;            
       
   138         const CSenIdentifier& iConsumerIdentifier;  // not owned reference to service consumer
       
   139         CSenChunk* ipChunk;                          // not owned
       
   140         
       
   141         TAny* ipReserved;                           // not used currently
       
   142     };
       
   143 
       
   144 #endif