Clover icon

sunshower-core

  1. Project Clover database Fri Apr 6 2018 03:27:42 UTC
  2. Package io.sunshower.service

File CoreServiceConfiguration.java

 

Coverage histogram

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

Code metrics

0
17
15
1
129
112
15
0.88
1.13
15
1

Classes

Class Line # Actions
CoreServiceConfiguration 49 17 15
0.937593.8%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.service;
2   
3    import io.sunshower.persistence.annotations.Persistence;
4    import io.sunshower.service.application.DefaultApplicationService;
5    import io.sunshower.service.git.JGitRepositoryService;
6    import io.sunshower.service.git.RepositoryService;
7    import io.sunshower.service.graph.SpringGraphServiceResolver;
8    import io.sunshower.service.graph.service.GraphServiceResolver;
9    import io.sunshower.service.graph.service.TaskService;
10    import io.sunshower.service.io.DefaultConfigurableFileResolutionStrategy;
11    import io.sunshower.service.model.io.FileResolutionStrategy;
12    import io.sunshower.service.orchestration.JpaTemplateService;
13    import io.sunshower.service.orchestration.service.TemplateService;
14    import io.sunshower.service.security.*;
15    import io.sunshower.service.serialization.DynamicJaxrsProviders;
16    import io.sunshower.service.serialization.DynamicResolvingMoxyJsonProvider;
17    import io.sunshower.service.serialization.MOXyJsonGraphContext;
18    import io.sunshower.service.task.ElementContext;
19    import io.sunshower.service.task.exec.*;
20    import io.sunshower.service.tasks.EntityResolverTask;
21    import io.sunshower.service.workspace.JpaWorkspaceService;
22    import io.sunshower.service.workspace.service.WorkspaceService;
23    import java.util.concurrent.ExecutorService;
24    import org.springframework.cache.Cache;
25    import org.springframework.cache.CacheManager;
26    import org.springframework.context.ApplicationContext;
27    import org.springframework.context.annotation.Bean;
28    import org.springframework.context.annotation.Configuration;
29   
30    @Configuration
31    @Persistence(
32    id = "audit",
33    schema = "SUNSHOWER",
34    migrationLocations = "classpath:{dialect}",
35    scannedPackages = {
36    "io.sunshower.model.core",
37    "io.sunshower.service.model",
38    "io.sunshower.service.signup",
39    "io.sunshower.model.core.auth",
40    "io.sunshower.service.revision",
41    "io.sunshower.service.model.compute",
42    "io.sunshower.service.model.application",
43    "io.sunshower.service.model.provider",
44    "io.sunshower.service.model.storage",
45    "io.sunshower.service.workspace.model",
46    "io.sunshower.service.orchestration.model"
47    }
48    )
 
49    public class CoreServiceConfiguration {
50   
 
51  2 toggle @Bean
52    public GraphTransformer graphTransformer() {
53  2 return new DefaultGraphTransformer();
54    }
55   
 
56  2 toggle @Bean
57    public TaskService taskService() {
58  2 return new DefaultTaskService();
59    }
60   
 
61  2 toggle @Bean
62    public CredentialService credentialService() {
63  2 return new JpaCredentialService();
64    }
65   
 
66  2 toggle @Bean
67    public FileResolutionStrategy fileResolutionStrategy() {
68  2 return new DefaultConfigurableFileResolutionStrategy();
69    }
70   
 
71  2 toggle @Bean
72    public GraphServiceResolver graphServiceResolver(ApplicationContext ctx) {
73  2 return new SpringGraphServiceResolver(ctx);
74    }
75   
 
76  2 toggle @Bean
77    public DynamicJaxrsProviders dynamicJaxrsProviders() {
78  2 return new DynamicJaxrsProviders();
79    }
80   
 
81  2 toggle @Bean
82    public MOXyJsonGraphContext moXyJsonGraphContext(
83    DynamicResolvingMoxyJsonProvider provider, DynamicJaxrsProviders providers) {
84  2 return new MOXyJsonGraphContext(provider, providers);
85    }
86   
 
87  2 toggle @Bean
88    public RepositoryService repositoryService() {
89  2 return new JGitRepositoryService();
90    }
91   
 
92  0 toggle @Bean
93    public ApplicationService applicationService() {
94  0 return new DefaultApplicationService();
95    }
96   
 
97  2 toggle @Bean
98    public SpringPermissionsService springPermissionsService() {
99  2 return new SpringPermissionsService();
100    }
101   
 
102  2 toggle @Bean
103    public WorkspaceService workspaceService() {
104  2 return new JpaWorkspaceService();
105    }
106   
 
107  2 toggle @Bean(name = TemplateService.NAME)
108    public TemplateService orchestrationTemplateService() {
109  2 return new JpaTemplateService();
110    }
111   
 
112  2 toggle @Bean
113    public ParallelTaskExecutor parallelTaskExecutor(
114    ElementContext elementContext, ExecutorService executor, ApplicationContext context) {
115  2 return new ParallelTaskExecutor(elementContext, executor, context);
116    }
117   
 
118  2 toggle @Bean
119    public ElementContext elementContext() {
120  2 ElementContext context = new SpringElementContext();
121  2 context.register(EntityResolverTask.key, EntityResolverTask.class);
122  2 return context;
123    }
124   
 
125  2 toggle @Bean(name = "caches:authentication")
126    public Cache authenticationCache(CacheManager cacheManager) {
127  2 return cacheManager.getCache("caches:authentication");
128    }
129    }