![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /********************************************************************* 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: ehsHttpConnMgr.h,v $ $Revision: 1.10 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef DtEhsHttpConnectionMgr_H_ 00009 #define DtEhsHttpConnectionMgr_H_ 00010 00011 #include <rtiMsConfig.h> 00012 #include "wwwSpyHttpConnMgr.h" 00013 #include "lrcConsoleLogXmlBlock.h" 00014 #include <vlMutex__rti__.h> 00015 #include <vlutil/vlThreadSafe.h> 00016 #include <vlutil/vlTime.h> 00017 #include <deque> 00018 #include <map> 00019 00020 //Forward References 00021 class DtWwwDocRoot; 00022 class DtWebSpyServer; 00023 00024 // The DtEhsHttpConnectionMgr manages the http connection side of the DtWebSpyServer. 00025 // It implements the DtWebSpyHttpConnectionMgr interface using the EHS web server. 00026 class DT_DLL_WWWEHS DtEhsHttpConnectionMgr : public DtWebSpyHttpConnectionMgr 00027 { 00028 private: 00029 // Copy and Assignment unimplemented 00030 DtEhsHttpConnectionMgr( const DtEhsHttpConnectionMgr& ); 00031 // Copy and Assignment unimplemented 00032 DtEhsHttpConnectionMgr& operator=( DtEhsHttpConnectionMgr& ); 00033 00034 public: 00035 00036 // Virtual constructor 00037 static DtWebSpyHttpConnectionMgr* create( DtWebSpyServer& parent ); 00038 00039 public: 00040 00041 // Ctor 00042 DtEhsHttpConnectionMgr( DtWebSpyServer& parent ); 00043 // Dtor 00044 virtual ~DtEhsHttpConnectionMgr(); 00045 00046 // Offer the web server processing time and Gets command messages from the HTTP server 00047 // - commands from the HTTP server are simple xml command messages encoded by the client 00048 // - commands must be decoded by the wwwSpyServer decoder 00049 virtual void tick( unsigned int timeout = 0 ); 00050 00051 // Post a new command (called by the HTTP server to add a command to the queue) 00052 virtual void postCommand( const DtWebSpyUtils::ConnectionIdentifier& connInfo, 00053 std::auto_ptr<DtString> command ); 00054 00055 // Add a new RTI object with associated connection information 00056 virtual void addConnection( const DtWebSpyUtils::ConnectionIdentifier& connInfo ); 00057 00058 // Update the state of an individual component behind an existing web server connection 00059 // - this may be the first update of the component 00060 // - in connections with forwarding disabled there is only one component behind the connection 00061 virtual void updateConnection( const DtWebSpyUtils::ConnectionIdentifier& connInfo, 00062 std::auto_ptr< DtWebSpyUtils::ConnectionState > connState, bool appendToExisting ); 00063 00064 // Update the event log of an individual component behind an existing web server connection 00065 // - events are timestamped so that client may request a sub-set of the logged events ( i.e. - 00066 // the 50 most recent events ) 00067 virtual void appendConnectionLogEvent( const DtWebSpyUtils::ConnectionIdentifier& connInfo, 00068 unsigned long componentId, DtLrcConsoleLogXmlBlockSP logSegmentSP ); 00069 00070 // Remove a connection and replace it with a disconnect message when its 00071 // corresponding connection is dropped 00072 // Caller may specify additional information about the reason for the drop 00073 // via the optional dropNotificationMsg (accepts HTML) 00074 virtual void removeConnection( const DtWebSpyUtils::ConnectionIdentifier& connInfo, 00075 const DtString& dropNotificationMsg = "" ); 00076 00077 protected: 00078 00079 typedef std::pair< DtWebSpyUtils::ConnectionIdentifier, DtString* > WebSpyCommand; 00080 00081 // Type to hold a list of Commands from the attached web clients and the 00082 // the source/destination page ID 00083 // (since there may be multiple simultaneous clients attached via different 00084 // threads, the queue must be made thread-safe) 00085 typedef DtThreadSafe< std::deque< WebSpyCommand > > WebSpyCommandQ; 00086 00087 protected: 00088 00089 // Get the next command message from the HTTP server 00090 // - commands from the HTTP server are simple xml command messages 00091 // - commands must be decoded by the wwwSpyServer decoder 00092 virtual WebSpyCommand getNextCommand(); 00093 00094 protected: 00095 00096 // A list of commands posted by various web clients 00097 WebSpyCommandQ myWebCommandQ; 00098 00099 // The WebSpy Client Application Page 00100 std::auto_ptr<DtWwwDocRoot> myDocumentRoot; 00101 00102 }; 00103 00104 00105 #endif // DtEhsHttpConnectionMgr_H_