Clover icon

sunshower-sdk

  1. Project Clover database Sat May 12 2018 05:15:40 UTC
  2. Package io.sunshower.sdk.v1

File SdkConfiguration.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
13
12
1
98
83
12
0.92
1.08
12
1

Classes

Class Line # Actions
SdkConfiguration 33 13 12
0.9292%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.sdk.v1;
2   
3    import io.sunshower.kernel.api.PluginManager;
4    import io.sunshower.sdk.common.jaxb.CachingJAXBContextAwareMOxyJSONProvider;
5    import io.sunshower.sdk.common.jaxb.DefaultJAXBContextResolver;
6    import io.sunshower.sdk.core.ActivationEndpoint;
7    import io.sunshower.sdk.core.IdentifierEndpoint;
8    import io.sunshower.sdk.core.model.Extensions;
9    import io.sunshower.sdk.kernel.DefaultExtensionEndpoint;
10    import io.sunshower.sdk.kernel.ExtensionEndpoint;
11    import io.sunshower.sdk.v1.core.FlakeIdentifierEndpoint;
12    import io.sunshower.sdk.v1.core.OctetStreamWriter;
13    import io.sunshower.sdk.v1.core.security.DefaultActivationEndpoint;
14    import io.sunshower.sdk.v1.core.security.DefaultSecurityEndpoint;
15    import io.sunshower.sdk.v1.core.security.DefaultSignupEndpoint;
16    import io.sunshower.sdk.v1.core.security.DefaultUserEndpoint;
17    import io.sunshower.sdk.v1.endpoints.core.security.SecurityEndpoint;
18    import io.sunshower.sdk.v1.endpoints.core.security.SignupEndpoint;
19    import io.sunshower.sdk.v1.endpoints.core.security.UserEndpoint;
20    import io.sunshower.service.serialization.DynamicJaxrsProviders;
21    import io.sunshower.service.serialization.DynamicResolvingMoxyJsonProvider;
22    import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
23    import org.springframework.context.annotation.Bean;
24    import org.springframework.context.annotation.Configuration;
25    import org.springframework.context.annotation.Import;
26    import org.springframework.context.annotation.Primary;
27   
28    import javax.naming.InitialContext;
29    import javax.naming.NamingException;
30   
31    @Configuration
32    @Import(MappingConfiguration.class)
 
33    public class SdkConfiguration {
34   
 
35  7 toggle @Bean
36    public ExtensionEndpoint extensionEndpoint() {
37  7 return new DefaultExtensionEndpoint();
38    }
39   
 
40  7 toggle @Bean
41    public Extensions extensionsTransformer() {
42  7 return new Extensions() {};
43    }
44   
 
45  0 toggle @Bean
46    public PluginManager pluginManager() throws NamingException {
47  0 return InitialContext.doLookup("java:global/sunshower/kernel/plugin-manager");
48    }
49   
 
50  7 toggle @Bean
51    public ActivationEndpoint activationEndpoint() {
52  7 return new DefaultActivationEndpoint();
53    }
54   
 
55  7 toggle @Bean
56    public OctetStreamWriter octetStreamWriter() {
57  7 return new OctetStreamWriter();
58    }
59   
 
60  7 toggle @Bean
61    public IdentifierEndpoint identifierEndpoint() {
62  7 return new FlakeIdentifierEndpoint();
63    }
64   
 
65  7 toggle @Bean
66    public UserEndpoint userEndpoint() {
67  7 return new DefaultUserEndpoint();
68    }
69   
 
70  7 toggle @Bean
71    public SignupEndpoint signupEndpoint() {
72  7 return new DefaultSignupEndpoint();
73    }
74   
 
75  7 toggle @Bean
76    public SecurityEndpoint securityEndpoint() {
77  7 return new DefaultSecurityEndpoint();
78    }
79   
 
80  7 toggle @Bean
81    public ExceptionMappings exceptionMappings() {
82  7 return new ExceptionMappings();
83    }
84   
 
85  7 toggle @Bean
86    @Primary
87    public DynamicResolvingMoxyJsonProvider configurableMoxyJsonProvider(
88    DynamicJaxrsProviders providers) {
89  7 CachingJAXBContextAwareMOxyJSONProvider cachingJAXBContextAwareMOxyJSONProvider =
90    new CachingJAXBContextAwareMOxyJSONProvider(providers);
91  7 return cachingJAXBContextAwareMOxyJSONProvider;
92    }
93   
 
94  7 toggle @Bean
95    public DefaultJAXBContextResolver jaxbContextResolver(final MOXyJsonProvider provider) {
96  7 return new DefaultJAXBContextResolver(((CachingJAXBContextAwareMOxyJSONProvider) provider));
97    }
98    }