1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.linecorp.centraldogma.server.plugin;
18
19 import static java.util.Objects.requireNonNull;
20
21 import java.util.concurrent.ScheduledExecutorService;
22 import java.util.function.Function;
23
24 import com.linecorp.armeria.server.HttpService;
25 import com.linecorp.armeria.server.ServerBuilder;
26 import com.linecorp.armeria.server.auth.AuthService;
27 import com.linecorp.centraldogma.server.CentralDogmaConfig;
28 import com.linecorp.centraldogma.server.command.CommandExecutor;
29 import com.linecorp.centraldogma.server.mirror.MirrorAccessController;
30 import com.linecorp.centraldogma.server.storage.project.InternalProjectInitializer;
31 import com.linecorp.centraldogma.server.storage.project.ProjectManager;
32
33 import io.micrometer.core.instrument.MeterRegistry;
34
35
36
37
38 public final class PluginInitContext extends PluginContext {
39
40 private final ServerBuilder serverBuilder;
41 private final Function<? super HttpService, AuthService> authService;
42
43
44
45
46 public PluginInitContext(CentralDogmaConfig config,
47 ProjectManager projectManager,
48 CommandExecutor commandExecutor,
49 MeterRegistry meterRegistry,
50 ScheduledExecutorService purgeWorker, ServerBuilder serverBuilder,
51 Function<? super HttpService, AuthService> authService,
52 InternalProjectInitializer projectInitializer,
53 MirrorAccessController mirrorAccessController) {
54 super(config, projectManager, commandExecutor, meterRegistry, purgeWorker, projectInitializer,
55 mirrorAccessController);
56 this.serverBuilder = requireNonNull(serverBuilder, "serverBuilder");
57 this.authService = requireNonNull(authService, "authService");
58 }
59
60
61
62
63 public ServerBuilder serverBuilder() {
64 return serverBuilder;
65 }
66
67
68
69
70 public Function<? super HttpService, AuthService> authService() {
71 return authService;
72 }
73 }