os/security/cryptoservices/filebasedcertificateandkeystores/source/generic/server/fsserver.h
First public contribution.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
24 #ifndef __FSSERVER_H__
25 #define __FSSERVER_H__
27 #define FILECERTSTORE_SERVER
30 #include "fstokencliserv.h"
31 #include "tokentypesenum.h"
33 class CFSKeyStoreServer;
34 class CFSCertStoreServer;
35 class CFSCertAppsServer;
38 * Implements shutdown of the server. When the last client disconnects, this
39 * class is activated, and when the timer expires, causes the server to
42 class CShutdown : public CTimer
44 enum {KServerShutdownDelay=0x200000}; // approx 2s
47 inline void ConstructL();
54 /** Filetokens server class, manages sessions. */
55 class CTokenServer : public CServer2
58 static CServer2* NewLC();
64 CFSKeyStoreServer& KeyStoreServerL() const;
65 CFSCertStoreServer& CertStoreServerL() const;
66 CFSCertAppsServer& CertAppsServerL() const;
69 virtual CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
77 // Ah, I knew there was a good use for that mutable keyword...
78 mutable CFSKeyStoreServer* iKeyStoreServer;
79 mutable CFSCertStoreServer* iCertStoreServer;
80 mutable CFSCertAppsServer* iCertAppsServer;
84 * Base class for session objects.
86 class CTokenServerSession : public CSession2
89 CTokenServerSession();
90 virtual ~CTokenServerSession();
92 inline CTokenServer& Server();
94 virtual void DoServiceL(const RMessage2& aMessage) = 0;
96 virtual void CreateL();
97 virtual void ServiceError(const RMessage2& aMessage, TInt aError);
98 virtual void ServiceL(const RMessage2& aMessage);
102 #endif // __FSSERVER_H__