Clover icon

sunshower-sdk

  1. Project Clover database Wed Apr 4 2018 21:39:43 UTC
  2. Package io.sunshower.sdk.kernel

File DefaultExtensionEndpoint.java

 

Coverage histogram

../../../../img/srcFileCovDistChart3.png
29% of files have more coverage

Code metrics

0
3
5
1
57
43
5
1.67
0.6
5
1

Classes

Class Line # Actions
DefaultExtensionEndpoint 17 3 5
0.2525%
 

Contributing tests

This file is covered by 1 test. .

Source view

1    package io.sunshower.sdk.kernel;
2   
3    import io.sunshower.common.Identifier;
4    import io.sunshower.kernel.api.PluginManager;
5    import io.sunshower.sdk.core.model.Extensions;
6    import io.sunshower.sdk.kernel.model.ExtensionPointDescriptorElement;
7    import io.sunshower.sdk.kernel.model.PluginState;
8    import io.sunshower.sdk.kernel.model.PluginUploadFault;
9    import org.springframework.security.access.prepost.PreAuthorize;
10   
11    import javax.inject.Inject;
12    import javax.servlet.http.HttpServletRequest;
13    import javax.servlet.http.HttpServletResponse;
14    import java.util.List;
15    import java.util.stream.Collectors;
16   
 
17    public class DefaultExtensionEndpoint implements ExtensionEndpoint {
18   
19    @Inject
20    private Extensions extensions;
21   
22    @Inject
23    private PluginManager pluginManager;
24   
25   
 
26  1 toggle @Override
27    @PreAuthorize("hasAuthority('admin')")
28    public List<ExtensionPointDescriptorElement> list() {
29  1 return pluginManager
30    .getExtensionPoints()
31    .stream()
32    .map(extensions::toElement)
33    .collect(Collectors.toList());
34   
35    }
36   
 
37  0 toggle @Override
38    @PreAuthorize("hasAuthority('admin')")
39    public ExtensionPointDescriptorElement get(Identifier id) {
40  0 return list().get(0);
41    }
42   
 
43  0 toggle @Override
44    public void deploy(HttpServletRequest req, HttpServletResponse res) throws PluginUploadFault {
45   
46    }
47   
 
48  0 toggle @Override
49    public void setState(String pluginId, PluginState state) {
50   
51    }
52   
 
53  0 toggle @Override
54    public PluginState getState(String id) {
55  0 return null;
56    }
57    }