aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/hub/hubservice.h
blob: 1a5a8c57c87e071f395363f2aed8d80c9421e5fe (plain) (blame)
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
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <zenhttp/httpserver.h>

#include "hydration.h"

namespace zen {

/** ZenServer Hub Service
 *
 *  Manages a set of storage servers on the behalf of external clients. For
 *  use in UEFN content worker style scenarios.
 *
 */
class HttpHubService : public zen::HttpService
{
public:
	HttpHubService(std::filesystem::path HubBaseDir, std::filesystem::path ChildBaseDir);
	~HttpHubService();

	HttpHubService(const HttpHubService&) = delete;
	HttpHubService& operator=(const HttpHubService&) = delete;

	virtual const char* BaseUri() const override;
	virtual void		HandleRequest(zen::HttpServerRequest& Request) override;

	void SetNotificationEndpoint(std::string_view UpstreamNotificationEndpoint, std::string_view InstanceId);

private:
	HttpRequestRouter m_Router;

	struct Impl;

	std::unique_ptr<Impl> m_Impl;

	void HandleModuleGet(HttpServerRequest& Request, std::string_view ModuleId);
	void HandleModuleDelete(HttpServerRequest& Request, std::string_view ModuleId);
};

}  // namespace zen