rasdaman complete source
rasserver_config.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 #ifndef RASSERVER_CONFIG_HH
24 #define RASSERVER_CONFIG_HH
25 
26 
27 #include "commline/cmlparser.hh"
28 
33 {
34 public:
35  Configuration();
36 
37  bool parseCommandLine(int argc, char** argv);
38 
39  const char* getServerName();
40  int getListenPort();
41  bool isHttpServer();
42  bool isRnpServer();
43 
44  const char* getRasmgrHost();
45  int getRasmgrPort();
46  bool isLogToStdOut();
47 
49  int getTimeout();
50  const char* getDbConnectionID();
51  const char* getDbUser();
52  const char* getDbPasswd();
53 
54  int getDefaultTileSize();
55  int getDefaultPCTMin();
56  int getDefaultPCTMax();
57 
58  int getDefaultIndexSize();
59 
60 #ifdef RMANDEBUG
61  int getDebugLevel();
62 #endif
63 
64  const char* getDefaultTileConfig();
65  const char* getTilingScheme();
66  const char* getIndexType();
67  bool useTileContainer();
68 
69 
70 private:
71  void printHelp();
72 
73  void initParameters();
74  void checkParameters();
75  void initLogFiles();
76  void deprecated(CommandLineParameter*);
77 
78  const char* makeLogFileName(const char *srvName,const char *desExt);
79 
80  // Parameters
81  CommandLineParameter *cmlHelp;
82  CommandLineParameter *cmlRsn;
83  CommandLineParameter *cmlPort;
84  CommandLineParameter *cmlMgr;
85  CommandLineParameter *cmlMgrPort;
86  CommandLineParameter *cmlMgrSync;
87 
88  CommandLineParameter *cmlTransBuffer;
89  CommandLineParameter *cmlTimeOut;
90  CommandLineParameter *cmlMgmntInt;
91  CommandLineParameter *cmlHttp;
92  CommandLineParameter *cmlRnp;
93 
94  CommandLineParameter *cmlOptLevel;
95  CommandLineParameter *cmlConnectStr;
96  CommandLineParameter *cmlUserStr;
97  CommandLineParameter *cmlPasswdStr;
98  CommandLineParameter *cmlLog;
99 
100  CommandLineParameter *cmlTileSize;
101  CommandLineParameter *cmlPctMin;
102  CommandLineParameter *cmlPctMax;
103  CommandLineParameter *cmlUseTC;
104  CommandLineParameter *cmlTileConf;
105  CommandLineParameter *cmlTiling;
106  CommandLineParameter *cmlIndex;
107  CommandLineParameter *cmlIndexSize;
108 #ifdef RMANDEBUG
109  CommandLineParameter *cmlDbg;
110  CommandLineParameter *cmlDbgLevel;
111 #endif
112  const char* myExecutable;
113 
114  const char* serverName;
115  int listenPort;
116 
117  const char* rasmgrHost;
118  int rasmgrPort;
119 
120  bool logToStdOut;
121  const char* logFileName; // == 0 if stdout
122 
123  int maxTransferBufferSize;
124  int timeout;
125  bool httpServ;
126  bool rnpServ;
127  const char* dbConnection;
128  const char* dbUser;
129  const char* dbPasswd;
130 
131  int tileSize;
132  int pctMin;
133  int pctMax;
134  bool useTC;
135  const char* tileConf;
136  const char* tilingName;
137  const char* indexType;
138  int indexSize;
139 #ifdef RMANDEBUG
140  int dbgLevel;
141 #endif
142 };
143 
145 
146 #endif
const char * getDefaultTileConfig()
int getRasmgrPort()
bool parseCommandLine(int argc, char **argv)
const char * getDbConnectionID()
const char * getServerName()
int getDefaultIndexSize()
bool isLogToStdOut()
int getMaxTransferBufferSize()
bool isHttpServer()
int getListenPort()
bool useTileContainer()
int getDefaultTileSize()
const char * getRasmgrHost()
int getDebugLevel()
const char * getTilingScheme()
const char * getIndexType()
Definition: rasserver_config.hh:32
int getDefaultPCTMax()
bool isRnpServer()
const char * getDbUser()
Configuration configuration
int getDefaultPCTMin()
const char * getDbPasswd()