00001 // Copyright (C) 2001, Compaq Computer Corporation 00002 // 00003 // This file is part of Vesta. 00004 // 00005 // Vesta is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // Vesta is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with Vesta; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 // Last modified on Wed Nov 19 18:37:29 EST 2003 by ken@xorian.net 00020 // modified on Fri Nov 7 16:59:49 PST 1997 by heydon 00021 00022 // DebugC -- the debugging client interface to the Vesta-2 cache server 00023 00024 /* The class "DebugC" provides a client connection to one or more running 00025 instances of the Vesta-2 cache server. It provides non-standard debugging 00026 operations not required by most clients. */ 00027 00028 #ifndef _DEBUG_C_H 00029 #define _DEBUG_C_H 00030 00031 #include <Basics.H> 00032 00033 // from vesta/srpc 00034 #include <SRPC.H> 00035 #include <MultiSRPC.H> 00036 00037 // from vesta/fp 00038 #include <FP.H> 00039 00040 // from vesta/cache-src/common 00041 #include <CacheIntf.H> 00042 #include <CacheState.H> 00043 00044 class DebugC { 00045 public: 00046 // constructor: initialize the client 00047 DebugC(CacheIntf::DebugLevel debug = CacheIntf::None, 00048 bool use_rt = false, unsigned int rt_secs = 60) throw (); 00049 00050 // destructor: close and free any open connections to servers 00051 ~DebugC() throw(); 00052 00053 void FlushAll() const throw (SRPC::failure); 00054 /* Flush all VMultiPKFiles in the cache, even if they don't have 00055 any new entries to be flushed. */ 00056 00057 void GetCacheId(/*OUT*/ CacheId &id) const throw (SRPC::failure); 00058 /* Set "id" to the identifying information of the cache server. */ 00059 00060 void GetCacheState(/*OUT*/ CacheState &state) const throw (SRPC::failure); 00061 /* Set "state" to the current state information of the cache server. */ 00062 00063 void GetCacheInstance(/*OUT*/ FP::Tag &instance_fp) const 00064 throw (SRPC::failure); 00065 /* Set "instance_fp" to the unique instance fingerprint of the 00066 cache server. */ 00067 00068 protected: 00069 // The client maintains a cache of connections in a "Connections" object 00070 MultiSRPC *conns; 00071 00072 // Read-only after initialization 00073 CacheIntf::DebugLevel debug; 00074 00075 // Configuraiton for the read timeout feature. 00076 bool use_read_timeout; 00077 unsigned int read_timeout_seconds; 00078 00079 private: 00080 void NullCall(CacheIntf::ProcIds id, char *name, 00081 CacheIntf::DebugLevel level) const throw (SRPC::failure); 00082 /* Make the remote call to procedure "id" with no arguments or return 00083 value. */ 00084 00085 // hide copy constructor from clients 00086 DebugC(const DebugC&); 00087 }; 00088 00089 #endif // _DEBUG_C_H