diff -r 000000000000 -r 094583676ce7 PECengine/PresenceServer2/ServerSrc/CPEngSession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PECengine/PresenceServer2/ServerSrc/CPEngSession.h Thu Dec 17 08:41:52 2009 +0200 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Presence Server session handler implementation +* All clients request are handler here, +* or forwarded to the sub-session +* +*/ + + +#ifndef __CPENGSESSION_H__ +#define __CPENGSESSION_H__ + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MPEngServer; +class RPEngMessage; +class CPEngSubSession; + +// CLASS DECLARATION +/** + * Presence Server session handler implementation + * All clients request are handler here, + * or forwarded to the sub-session + * + * @lib PEngServer2 + * @since 3.0 + */ +NONSHARABLE_CLASS( CPEngSession ): + public CSession2 + { +public: // Constructors and destructors + + /** + * Two-phased constructor. + * @param aServer server instance + * @return instance of the session + */ + static CPEngSession* NewL( MPEngServer& aServer ); + + /** + * Destructor. + */ + virtual ~CPEngSession(); + +public: // Methods derived from CSession + + /** + * Service clients request + * @see + * @since 3.0 + * @param aMessage message with request details + */ + void ServiceL( const RMessage2 &aMessage ); + + /** + * Handles the service error + * @since 3.0 + * @see + * @param aMessage message with request details + * @param aError error + */ + void ServiceError( const RMessage2& aMessage, TInt aError ); + +private: // New methods + + /** + * Dispatch clients message + * + * @since 3.0 + * @param aMessage clients message + */ + TBool DispatchMessageL( const RPEngMessage& aMessage ); + + /** + * Create new sub-session + * + * @since 3.0 + * @param aMessage clients message + */ + void CreateNewSubSessionL( const RPEngMessage& aMessage ); + + /** + * Remove sub-session + * @since 3.0 + * @param aHandle handle of the subsession + */ + void RemoveSubSessionL( TUint aHandle ); + + /** + * Find Subsession + * @since 3.0 + * @param aHandle handle of the subsession to find + * @return sub-session instance + */ + CPEngSubSession& FindSubSessionL( TUint aHandle ) const; + + + /* + * Panic client + * @since 3.0 + * @param aMessage clients message + * @param aPanic panic reason + */ + void PanicClient( const RPEngMessage& aMessage, + const TInt aPanic ) const; + + +protected: // Constructors and destructors + + /** + * C++ default constructor. + */ + CPEngSession( MPEngServer& aServer );// Default constructor, protected to allow derivation + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // Data + + /// OWN: Collection of the Sub Sessions + CObjectIx* iSubSessions; + + /// REF: server clas + MPEngServer& iMainServer; + }; + +#endif // __CPEngSession_H__