![]() |
MAK RTIspy API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: federationDocs.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef DtFederationDocs_H_ 00009 #define DtFederationDocs_H_ 00010 00011 #include <rtiMsConfig.h> 00012 #include "basicEhsDoc.h" 00013 #include "webSpyUtils.h" 00014 #include <vlutil/vlString.h> 00015 #include <vlutil/vlTime.h> 00016 00017 class DtEhsHttpConnectionMgr; 00018 class HttpRequest; 00019 class HttpResponse; 00020 00021 // The XML representation of the Federation's state 00022 // Since the RTI Exec allows forwarding of web requests, the DtFederationXML 00023 // class must provide the state of any RTI component on demand. 00024 class DT_DLL_WWWEHS DtFederationXML : public DtBasicEhsDoc 00025 { 00026 private: 00027 00028 // Copy Constructor not implimented : Copy not allowed 00029 DtFederationXML(const DtFederationXML&); 00030 // Copy Constructor not implimented : Copy not allowed 00031 DtFederationXML& operator=(const DtFederationXML&); 00032 00033 public: 00034 00035 DtFederationXML( DtEhsHttpConnectionMgr& parent, 00036 const DtWebSpyUtils::ConnectionIdentifier& connInfo ); 00037 virtual ~DtFederationXML(); 00038 00039 protected: 00040 00041 // Serve requests for this page 00042 virtual ResponseCode HandleNonFileRequest( HttpRequest * ipoHttpRequest, 00043 HttpResponse * ipoHttpResponse ); 00044 00045 // Load an initial empty response until first update is available 00046 void initializePage(); 00047 00048 // Send an update request to the WebSpy for the Federation 00049 virtual void requestStateUpdate(); 00050 00051 00052 // WWW Request Handlers 00053 00054 // Handler for state requests from the web client 00055 std::auto_ptr< DtString > handleStateRequest( unsigned long connId, 00056 DtWwwRequestXmlBlockSP requestSP, std::auto_ptr< DtString > requestString ); 00057 00058 // Handler for log requests from the web client 00059 std::auto_ptr< DtString > handleLogRequest( unsigned long connId, 00060 DtWwwRequestXmlBlockSP requestSP, std::auto_ptr< DtString > requestString ); 00061 00062 // Handler for direct commands to the RTI Exec from the Web Client 00063 // - just verifies the command structure and passes it on (better to crash the www server 00064 // than the RTI Exec) 00065 std::auto_ptr< DtString > handleRtiExecCommand( unsigned long connId, 00066 DtWwwRequestXmlBlockSP requestSP, std::auto_ptr< DtString > requestString ); 00067 00068 protected: 00069 00070 typedef std::pair< unsigned long, DtWebSpyUtils::StateComponentType > ComponentIdStateTypePair; 00071 00072 DtEhsHttpConnectionMgr& myParent; 00073 DtWebSpyUtils::ConnectionIdentifier myConnInfo; 00074 00075 // Cache Status - these determine when to request a cache update 00076 // ( and when to wait for the current request to complete ) 00077 std::map< ComponentIdStateTypePair, DtTime > myPendingRequests; 00078 std::map< unsigned long, DtTime > myPendingLrcLogRequests; 00079 00080 }; 00081 00082 00083 00084 00085 #endif // DtFederationDocs_H_