dmpservermanager.h
2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**************************************************************************
* file: dmpservermanager.h
* Author: wanzhongping
* Date: 2021-07-27 21:59:36
* Email: zhongpingw@chinadci.com
* copyright: 广州城市信息研究所有限公司
***************************************************************************/
#ifndef __dmpservermanager_h__
#define __dmpservermanager_h__
#include <iostream>
#include <string>
#include <map>
#include <memory>
#include "dmpserver.h"
#include "dmpserverutils.h"
#include "dmpserverrequest.h"
#include "dmpserverregistry.h"
#define URI_RELOAD ("/API/Service/Reload") //加载已注册服务接口
#define URL_VACUATE ("/API/Manager/TableVacuateDetail?table_guids=") //加载矢量数据抽稀图层
class SERVER_EXPORT DmpServerManager
{
public:
DmpServerManager();
~DmpServerManager();
void init( const boost::filesystem::path& modulePath);
std::shared_ptr<DmpServer> serverForRequest(const DmpServerRequest& request);
std::shared_ptr<DmpServerApi> apiForRequest(const DmpServerRequest& request);
bool publish(const std::string& serverName, const std::string& serviceName, const std::string& title, int capabilities, const std::string& projectData);
bool deleteService(const std::string& serverName, const std::string& serviceName);
bool startService(const std::string& serverName, const std::string& serviceName);
bool stopService(const std::string& serverName, const std::string& serviceName);
DmpProject* getProject(const std::string& serviceName);
bool removeProject(const std::string& serviceName);
std::string getCapabilities();
bool loadServices();
//初始化加载服务
bool initServices(const std::string& serverName, const std::string& serviceName, const std::string& title, int capabilities, const std::string& projectData);
private:
typedef std::map<std::string, DmpProject*, ci_less> ProjectMap;
//存储工程文档实例
ProjectMap projects_;
DmpServerRegistry *serverRegistry_;
};
struct ServicesData
{
std::string name;
std::string title;
std::string type;
std::string capabilities;
std::string project;
};
#endif // __dmpservermanager_h__