Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

ClientActivity.h

00001 /*
00002  * Copyright 2003 Michael A. Marsh, Cornell University. All rights reserved.
00003  * This software is released under the modified BSD license.
00004  * See the file LICENSE in the top-level directory for details.
00005  */
00006 //
00007 // $Id: ClientActivity.h,v 1.3 2004/05/19 15:56:50 mmarsh Exp $
00008 //
00009 // $Log: ClientActivity.h,v $
00010 // Revision 1.3  2004/05/19 15:56:50  mmarsh
00011 // *** empty log message ***
00012 //
00013 // Revision 1.2  2003/11/04 22:15:00  mmarsh
00014 // General code cleanup and reorganization.  The signed ElGamal public key
00015 // was moved to CODEX_Server, decoupling that package from CODEX_Client.
00016 // Since CODEX_Server no longer knows about the cryptosystem used by
00017 // the client, switching between cryptosystems is handled locally by
00018 // CODEX_KeyService.
00019 //
00020 //
00021 
00022 #ifndef __CODEX_KEYSERVICE_CLIENTACTIVITY_H__
00023 #define __CODEX_KEYSERVICE_CLIENTACTIVITY_H__
00024 
00025 #include "ClientResponseHandler.h"
00026 #include "CODEX_Events/Activity.h"
00027 #include "CODEX_Quorum/LocalServer.h"
00028 
00029 #include "timing.h"
00030 
00031 class CODEX_Quorum::SocketBase;
00032 
00033 namespace CODEX_KeyService
00034 {
00035    class ClientMessageHandler;
00036 
00046 //   class ClientActivity : public CODEX_Events::Activity,
00047 //                          public CODEX_Quorum::LocalServer
00048    class ClientActivity : public ClientResponseHandler,
00049                           public CODEX_Quorum::LocalServer
00050    {
00051       public :
00053          typedef CODEX_Events::DeadPileType DeadPileType;
00055          typedef CODEX_Events::QType QType;
00056 
00075          ClientActivity( int port,
00076                          const CODEX_Quorum::SocketBuilder& socketBuilder,
00077                          DeadPileType& deadPile,
00078                          QType& eventQueue,
00079                          ClientMessageHandler* destination,
00080                          CODEX_Quorum::SocketBase* socket=NULL );
00081 
00083          virtual ~ClientActivity();
00084 
00094          void processRequest( CODEX_Quorum::SocketBase::StateType s );
00095 
00101          bool handler( CODEX_Events::EventAck& event );
00102 
00103          bool handler( CODEX_Events::CloseEvent& event );
00104 
00105          bool handler( ClientResponseEvent< SignedPublicKeyMsg >& event );
00106 
00107          bool handler( ClientResponseEvent< SignedBoundNameMsg >& event );
00108 
00109          bool handler( ClientResponseEvent< SignedKeyStoredMsg >& event );
00110 
00111          bool handler( ClientResponseEvent< SignedBlindKeyMsg >& event );
00112 
00114          void close();
00115 
00116       private :
00117          void respond( const CODEX_ASN1::Base& message, unsigned char mtype );
00118 
00119 #ifdef TIMING
00120          Timer*  m_timer;
00121 #endif
00122          ClientMessageHandler*   m_destination;
00123          int                     m_bufferToRead;
00124          CODEX_Quorum::Message*  m_buffer;
00125 
00126    };
00127 
00128 }
00129 
00130 #endif /* __CODEX_KEYSERVICE_CLIENTACTIVITY_H__ */

Generated on Wed Jun 2 16:32:54 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18