webservices/wsframework/inc/msenserviceinvocationframework.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 M_SEN_SERVICE_INVOCATION_FRAMEWORK_H
       
    26 #define M_SEN_SERVICE_INVOCATION_FRAMEWORK_H
       
    27 
       
    28 // INCLUDES
       
    29 #include "msencoreservicemanager.h"
       
    30 #include "MSenServiceDescription.h"
       
    31 #include "MSenServiceDescription.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CSenServiceSession;
       
    35 class CSenCredential2;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 * The core (father) interface for all Service Invocation Frameworks
       
    41 */
       
    42 class MSIF
       
    43     {
       
    44     public:
       
    45         
       
    46         // New functions
       
    47         
       
    48         /**
       
    49          * @return TDesC8& that indicates the TYPE of this framework (like ID-WSF, WS-STAR, ATOM, REST, OVI).
       
    50          *         Typically it is a relaxed "binding" to either propriatary or well known and/or open 
       
    51          *         spesification(s) that the framework implements.
       
    52          */
       
    53         virtual const TDesC8& Id() = 0;
       
    54 
       
    55         /**
       
    56          * Create a ServiceSession based upon the given ServiceDescription.
       
    57          * The ServiceSession is expected to be "valid", i.e. ready for use
       
    58          * by a client.
       
    59          * @param aServiceDescription is the service description that was found
       
    60          * (match) with given service invokation paramaters ("service pattern")
       
    61          * @param aPattern contains the invokation parameters defined by the
       
    62          * consumer who wishes to connect to a service. At minimum, this SD
       
    63          * includes and endpoint and/or contract (service type).
       
    64          * @param aNewSession is a ref-to-pointer that is used to "return"
       
    65          * a valid sessions. Important note: in case that this method fails,
       
    66          * it is ILLEGAL to put orphan object into this ref-to-ptr. Only in
       
    67          * case of success, the ownership of aNewSession is transferred to caller(!)
       
    68          * @param    aErrorMsg will be allocated to provide detailed
       
    69          *           information about error, if available (like SOAP fault)
       
    70          * @return KErrNone if successful (aNewSession ownership is transferred to
       
    71          * caller) or some of the system-wide errorcodes (aNewSession should be NULL)
       
    72          */
       
    73         virtual TInt CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
       
    74                                             MSenServiceDescription& aPattern,
       
    75                                             CSenServiceSession*& aNewSession,
       
    76                                             MSenRemoteServiceConsumer& aRemoteConsumer,
       
    77                                             HBufC8*& aErrorMsg ) = 0;
       
    78 
       
    79 
       
    80         /**
       
    81          * @return a new instance of a framework specific class that
       
    82          * implements the ServiceDesccription interface.
       
    83          */
       
    84         virtual CSenWSDescription* NewServiceDescriptionL() = 0;
       
    85 
       
    86         /**
       
    87          * @return the CoreServiceManager for which this instance is working.
       
    88          * This is used by the ServiceSession instances created by this
       
    89          * framework.
       
    90          * Note, in WSF, ServiceManager IS SINGLETON(!), so all Frameworks
       
    91          * return their "owner" - that is - the only service manager in
       
    92          * SenFramework
       
    93          */
       
    94         virtual MSenCoreServiceManager& Manager() = 0;
       
    95 
       
    96         /**
       
    97          * Attempt to register the ServiceDescription to the CoreServiceManager
       
    98          * that owns the framework.
       
    99          * This is a callback used by the ServiceManager to give frameworks
       
   100          * a chance to replace a generic ServiceDescription into something
       
   101          * that is more specific, and more useful, to the
       
   102          * ServiceInvocationFramework.
       
   103          * @param aServiceDescription A ServiceDescription
       
   104          * @return TInt aError - indicates the error or KErrNone if successful
       
   105          */
       
   106         virtual TInt RegisterServiceDescriptionL( MSenServiceDescription& aServiceDescription ) = 0;
       
   107 
       
   108 
       
   109         /**
       
   110          * Attempts to unregister the ServiceDescription from the
       
   111          * CoreServiceManager that owns the framework.
       
   112          * This is a callback used by the ServiceManager.
       
   113          * @param aServiceDescription A ServiceDescription
       
   114          * @return TInt aError - indicates the error or KErrNone if successful
       
   115          */
       
   116         virtual TInt UnregisterServiceDescriptionL( MSenServiceDescription& aServiceDescription ) = 0;
       
   117 
       
   118         /**
       
   119          * Logging method intended for the use of Service Invocation Frameworks
       
   120          * and their component classes.
       
   121          */
       
   122         //virtual RFileLogger* Log() const = 0; 
       
   123         
       
   124         /**
       
   125         * SIF should set any framework specific transport properties via this method.
       
   126         * @param aTransport is the transport plug-in where the (framework layer)
       
   127         * properties transport properties can be applied
       
   128         * @return KErrNone if success, or othewise a system-wide error code 
       
   129         */
       
   130         virtual TInt SetTransportPropertiesL( MSenTransport& aTransport ) = 0;
       
   131         
       
   132         /**
       
   133          * @return a string that is the unique for this implementation. Note that there might be multiple
       
   134          * frameworks, which all implement same TYPE (framework ID is the same), but which have different
       
   135          * design. This might mean that they implement different VERSION of the framework. It is recommended
       
   136          * that framework CUE is the ECOM cue of the framework, and that it is in form of URN (unique resource
       
   137          * name).
       
   138          */
       
   139         virtual TPtrC8 Cue() const = 0;
       
   140     };
       
   141 
       
   142 #endif // M_SEN_SERVICE_INVOCATION_FRAMEWORK_H
       
   143 
       
   144 // End of File