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 |
|
package info.magnolia.rest; |
35 |
|
|
36 |
|
import info.magnolia.config.source.ConfigurationSourceFactory; |
37 |
|
import info.magnolia.module.ModuleLifecycle; |
38 |
|
import info.magnolia.module.ModuleLifecycleContext; |
39 |
|
import info.magnolia.objectfactory.Components; |
40 |
|
import info.magnolia.rest.provider.AdditionalProviderDefinition; |
41 |
|
import info.magnolia.rest.registry.ConfiguredEndpointDefinitionManager; |
42 |
|
import info.magnolia.rest.registry.EndpointDefinitionRegistry; |
43 |
|
|
44 |
|
import java.util.ArrayList; |
45 |
|
import java.util.List; |
46 |
|
|
47 |
|
import javax.inject.Inject; |
48 |
|
|
49 |
|
|
50 |
|
@link |
51 |
|
|
52 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 5 |
Complexity Density: 0.71 |
|
53 |
|
public class RestIntegrationModule implements ModuleLifecycle { |
54 |
|
|
55 |
|
private final ConfigurationSourceFactory cfgSourceFactory; |
56 |
|
private final EndpointDefinitionRegistry endpointRegistry; |
57 |
|
|
58 |
|
private List<AdditionalProviderDefinition> additionalProviders = new ArrayList<>(); |
59 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
60 |
0 |
@Inject... |
61 |
|
public RestIntegrationModule(ConfigurationSourceFactory cfgSourceFactory, EndpointDefinitionRegistry endpointRegistry) { |
62 |
0 |
this.endpointRegistry = endpointRegistry; |
63 |
0 |
this.cfgSourceFactory = cfgSourceFactory; |
64 |
|
} |
65 |
|
|
66 |
|
|
67 |
|
@deprecated@link |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
0 |
@Deprecated... |
70 |
|
public RestIntegrationModule(ConfiguredEndpointDefinitionManager configuredEndpointDefinitionManager) { |
71 |
0 |
this(Components.getComponent(ConfigurationSourceFactory.class), Components.getComponent(EndpointDefinitionRegistry.class)); |
72 |
|
} |
73 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
74 |
0 |
@Override... |
75 |
|
public void start(ModuleLifecycleContext ctx) { |
76 |
0 |
if (ctx.getPhase() == ModuleLifecycleContext.PHASE_SYSTEM_STARTUP) { |
77 |
|
|
78 |
|
|
79 |
0 |
cfgSourceFactory.jcr() |
80 |
|
.withModulePath("rest-endpoints") |
81 |
|
.bindTo(endpointRegistry); |
82 |
|
|
83 |
|
|
84 |
0 |
cfgSourceFactory.jcr().bindWithDefaults(endpointRegistry); |
85 |
0 |
cfgSourceFactory.yaml().bindWithDefaults(endpointRegistry); |
86 |
|
} |
87 |
|
} |
88 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
89 |
0 |
@Override... |
90 |
|
public void stop(ModuleLifecycleContext moduleLifecycleContext) { |
91 |
|
} |
92 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
93 |
|
public List<AdditionalProviderDefinition> getAdditionalProviders() {... |
94 |
|
return additionalProviders; |
95 |
|
} |
96 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
97 |
|
public void setAdditionalProviders(List<AdditionalProviderDefinition> additionalProviders) {... |
98 |
|
this.additionalProviders = additionalProviders; |
99 |
|
} |
100 |
|
} |