Service manager
| 107 | |
| 108 | // Service manager |
| 109 | class Service : public Firebird::UtilSvc, public TypedHandle<type_svc> |
| 110 | { |
| 111 | public: // utilities interface with service |
| 112 | // output to svc_stdout verbose info |
| 113 | void outputVerbose(const char* text) override; |
| 114 | // outpur error text |
| 115 | void outputError(const char* text) override; |
| 116 | // output some data to service |
| 117 | void outputData(const void* data, FB_SIZE_T len) override; |
| 118 | // printf() to svc_stdout |
| 119 | void printf(bool err, const SCHAR* format, ...) override; |
| 120 | // returns true - it's service :) |
| 121 | bool isService() override; |
| 122 | // client thread started |
| 123 | void started() override; |
| 124 | // put various info items in info buffer |
| 125 | void putLine(char tag, const char* val) override; |
| 126 | void putSLong(char tag, SLONG val) override; |
| 127 | void putSInt64(char tag, SINT64 val) override; |
| 128 | void putChar(char tag, char val) override; |
| 129 | // put raw bytes to svc_stdout |
| 130 | void putBytes(const UCHAR*, FB_SIZE_T) override; |
| 131 | // get raw bytes from svc_stdin |
| 132 | ULONG getBytes(UCHAR*, ULONG) override; |
| 133 | |
| 134 | private: |
| 135 | // append status_vector to service's status |
| 136 | void setServiceStatus(const ISC_STATUS* status_vector) override; |
| 137 | // append error message to service's status |
| 138 | void setServiceStatus(const USHORT facility, const USHORT errcode, const MsgFormat::SafeArg& args) override; |
| 139 | |
| 140 | public: |
| 141 | // no-op for services |
| 142 | void hidePasswd(ArgvType&, int) override; |
| 143 | // return service status |
| 144 | StatusAccessor getStatusAccessor() override; |
| 145 | // no-op for services |
| 146 | void checkService() override; |
| 147 | // add address path and utf8 flag (taken from spb) to dpb if present |
| 148 | void fillDpb(Firebird::ClumpletWriter& dpb) override; |
| 149 | // encoding for string parameters passed to utility |
| 150 | bool utf8FileNames() override; |
| 151 | // get database encryption key transfer callback routine |
| 152 | Firebird::ICryptKeyCallback* getCryptCallback() override; |
| 153 | int getParallelWorkers() override { return svc_parallel_workers; } |
| 154 | |
| 155 | TraceManager* getTraceManager() |
| 156 | { |
| 157 | return svc_trace_manager; |
| 158 | } |
| 159 | |
| 160 | bool finished() override |
| 161 | { |
| 162 | return ((svc_flags & (SVC_finished | SVC_detached)) != 0) |
| 163 | || checkForShutdown(); |
| 164 | } |
| 165 | |
| 166 | // Get authentication block if present |
no outgoing calls
no test coverage detected