ServerConf.h
1 /*
2  * Copyright © (2011-2013) Institut national de l'information
3  * géographique et forestière
4  *
5  * Géoportail SAV <contact.geoservices@ign.fr>
6  *
7  * This software is a computer program whose purpose is to publish geographic
8  * data using OGC WMS and WMTS protocol.
9  *
10  * This software is governed by the CeCILL-C license under French law and
11  * abiding by the rules of distribution of free software. You can use,
12  * modify and/ or redistribute the software under the terms of the CeCILL-C
13  * license as circulated by CEA, CNRS and INRIA at the following URL
14  * "http://www.cecill.info".
15  *
16  * As a counterpart to the access to the source code and rights to copy,
17  * modify and redistribute granted by the license, users are provided only
18  * with a limited warranty and the software's author, the holder of the
19  * economic rights, and the successive licensors have only limited
20  * liability.
21  *
22  * In this respect, the user's attention is drawn to the risks associated
23  * with loading, using, modifying and/or developing or reproducing the
24  * software by the user in light of its specific status of free software,
25  * that may mean that it is complicated to manipulate, and that also
26  * therefore means that it is reserved for developers and experienced
27  * professionals having in-depth computer knowledge. Users are therefore
28  * encouraged to load and test the software's suitability as regards their
29  * requirements in conditions enabling the security of their systems and/or
30  * data to be ensured and, more generally, to use and operate it in the
31  * same conditions as regards security.
32  *
33  * The fact that you are presently reading this means that you have had
34  *
35  * knowledge of the CeCILL-C license and that you accept its terms.
36  */
37 
38 class ServerConf;
39 
40 #ifndef SERVERXML_H
41 #define SERVERXML_H
42 
43 #include <vector>
44 #include <string>
45 #include <map>
46 #include "Rok4Server.h"
47 #include <rok4/utils/TileMatrixSet.h>
48 
49 #include <rok4/utils/Configuration.h>
50 #include "Layer.h"
51 #include <rok4/style/Style.h>
52 
53 #include "config.h"
54 
55 class ServerConf : public Configuration
56 {
57  friend class Rok4Server;
58 
59  public:
60  ServerConf(std::string path);
61  ~ServerConf();
62 
63  std::string getLogOutput() ;
64  int getLogFilePeriod() ;
65  std::string getLogFilePrefix() ;
66  boost::log::v2_mt_posix::trivial::severity_level getLogLevel() ;
67 
68  std::string getServicesConfigFile() ;
69 
70  std::string getLayersList() ;
71  void addLayer(Layer* l) ;
72  void removeLayer(std::string id) ;
73  int getNbLayers() ;
74  Layer* getLayer(std::string id) ;
75 
76 
77  int getNbThreads() ;
78  std::string getSocket() ;
79 
80  protected:
81 
82  std::string serverConfigFile;
83  std::string servicesConfigFile;
84 
85  std::string logOutput;
86  std::string logFilePrefix;
87  int logFilePeriod;
88  boost::log::v2_mt_posix::trivial::severity_level logLevel;
89 
90  int nbThread;
91 
96  int cacheSize;
102 
107  std::string layerList;
112  std::map<std::string, Layer*> layersList;
113 
118  std::string socket;
123  int backlog;
124 
125 
131 
132 
137  bool enabled;
138 
139  private:
140 
141  bool parse(json11::Json& doc);
142 
143 };
144 
145 #endif // SERVERXML_H
146 
ServerConf::enabled
bool enabled
Définit si le serveur doit honorer les requêtes de consultation.
Definition: ServerConf.h:137
Layer.h
Définition de la classe Layer modélisant les couches de données.
Rok4Server.h
Definition de la classe Rok4Server et du programme principal.
ServerConf::layerList
std::string layerList
Fichier ou objet contenant la liste des descipteurs de couche.
Definition: ServerConf.h:107
Layer
Gestion des couches.
Definition: Layer.h:95
ServerConf::backlog
int backlog
Profondeur de la file d'attente du socket.
Definition: ServerConf.h:123
ServerConf::socket
std::string socket
Adresse du socket d'écoute (vide si lancement géré par un tiers)
Definition: ServerConf.h:118
ServerConf::layersList
std::map< std::string, Layer * > layersList
Liste des couches disponibles.
Definition: ServerConf.h:112
ServerConf
Definition: ServerConf.h:55
ServerConf::cacheValidity
int cacheValidity
Temps de validité du cache en minutes.
Definition: ServerConf.h:101
ServerConf::cacheSize
int cacheSize
Taille du cache des index des dalles.
Definition: ServerConf.h:96
Rok4Server
Gestion du programme principal, lien entre les modules.
Definition: Rok4Server.h:78
ServerConf::supportAdmin
bool supportAdmin
Définit si le serveur doit honorer les requêtes d'administration.
Definition: ServerConf.h:130