00001 /*========================================================================== 00002 * Copyright (c) 2004 University of Massachusetts. All Rights Reserved. 00003 * 00004 * Use of the Lemur Toolkit for Language Modeling and Information Retrieval 00005 * is subject to the terms of the software license set forth in the LICENSE 00006 * file included with this software, and also available at 00007 * http://www.lemurproject.org/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 00012 00013 // 00014 // NetworkServerStub 00015 // 00016 // 23 March 2004 -- tds 00017 // 00018 00019 #ifndef INDRI_NETWORKSERVERSTUB_HPP 00020 #define INDRI_NETWORKSERVERSTUB_HPP 00021 00022 #include "indri/XMLNode.hpp" 00023 #include "indri/NetworkMessageStream.hpp" 00024 #include "indri/QueryServer.hpp" 00025 #include "indri/QueryResponsePacker.hpp" 00026 00027 class NetworkServerStub : public MessageStreamHandler { 00028 private: 00029 QueryServer* _server; 00030 NetworkMessageStream* _stream; 00031 00032 void _handleDocuments( XMLNode* input ); 00033 void _handleDocumentMetadata( XMLNode* request ); 00034 void _handleDocumentVectors( XMLNode* request ); 00035 00036 void _handleQuery( XMLNode* input ); 00037 00038 void _handleTermCount( XMLNode* request ); 00039 void _handleStemCountText( XMLNode* request ); 00040 void _handleTermCountText( XMLNode* request ); 00041 void _handleTermCountID( XMLNode* request ); 00042 00043 void _handleTermName( XMLNode* request ); 00044 void _handleTermID( XMLNode* request ); 00045 00046 void _handleTermFieldCount( XMLNode* request ); 00047 void _handleStemFieldCount( XMLNode* request ); 00048 void _handleDocumentCount( XMLNode* request ); 00049 void _handleDocumentTermCount( XMLNode* request ); 00050 void _handleDocumentLength( XMLNode* request ); 00051 void _handleFieldList( XMLNode* request ); 00052 00053 public: 00054 NetworkServerStub( QueryServer* server, NetworkMessageStream* stream ); 00055 void request( XMLNode* input ); 00056 void reply( XMLNode* input ); 00057 void reply( const std::string& name, const void* buffer, unsigned int length ); 00058 void replyDone(); 00059 void error( const std::string& error ); 00060 void run(); 00061 }; 00062 00063 #endif // INDRI_NETWORKSERVERSTUB_HPP