Skip to content

Commit 643fea5

Browse files
Merge pull request #1 from Ericsson/master
Update fork
2 parents 9797066 + a03f602 commit 643fea5

File tree

121 files changed

+6654
-1205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+6654
-1205
lines changed

.gitignore

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
/target/
1+
# Eclipse
22
.classpath
3+
.project
34
.settings/
45

6+
# Intellij
7+
.idea/
8+
*.iml
9+
*.iws
10+
11+
# Mac
12+
.DS_Store
13+
14+
# Maven
15+
log/
16+
target/
17+
18+
# Others
19+
derby.log
20+

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ before_install:
1313
- chmod +x pom.xml
1414

1515
script:
16-
- mvn -DsomeModule.test.excludes="**/FlowTest.java, **/FlowTest2.java" test
16+
- mvn -DsomeModule.test.excludes="**/FlowTest.java, **/FlowTest2.java, **/TrafficGeneratedTest.java, **/FlowTestExternalComposition.java, **/FlowTestTestExecution.java, **/FlowSourceChangeObject.java" test
1717
- mvn -DsomeModule.test.includes="**/FlowTest.java" test
1818
- mvn -DsomeModule.test.includes="**/FlowTest2.java" test
19+
- mvn -DsomeModule.test.includes="**/TrafficGeneratedTest.java" test
20+
- mvn -DsomeModule.test.includes="**/FlowTestExternalComposition.java" test
21+
- mvn -DsomeModule.test.includes="**/FlowSourceChangeObject.java" test
22+
- mvn -DsomeModule.test.includes="**/FlowTestTestExecution.java" test

pom.xml

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.ericsson.ei</groupId>
55
<artifactId>eiffel-intelligence</artifactId>
6-
<version>0.0.1-SNAPSHOT</version>
6+
<version>0.0.1</version>
77

88
<parent>
99
<groupId>org.springframework.boot</groupId>
1010
<artifactId>spring-boot-starter-parent</artifactId>
11-
<version>1.5.2.RELEASE</version>
11+
<version>1.5.5.RELEASE</version>
12+
<relativePath/> <!-- .. lookup parent from repository -->
1213
</parent>
1314

1415
<properties>
1516
<java.version>1.8</java.version>
16-
<plugin-version>0.8.6</plugin-version>
17+
<plugin-version>0.10.11</plugin-version>
1718
<output-relative-path>src/main/java</output-relative-path>
18-
<raml-path>src/main/resources/public/raml/subscription.raml</raml-path>
19+
<raml-path>src/main/resources/public/raml/instance_info.raml</raml-path>
20+
<raml-path>src/main/resources/public/raml/eiffel-intelligence.raml</raml-path>
1921
<base-package>com.ericsson.ei.controller</base-package>
2022
</properties>
2123

@@ -71,7 +73,7 @@
7173
<dependency>
7274
<groupId>com.fasterxml.jackson.core</groupId>
7375
<artifactId>jackson-databind</artifactId>
74-
<version>2.8.3</version>
76+
<version>2.8.9</version>
7577
</dependency>
7678

7779
<dependency>
@@ -100,13 +102,14 @@
100102
<version>1.10.19</version>
101103
</dependency>
102104

103-
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-io -->
105+
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
104106
<dependency>
105-
<groupId>org.apache.commons</groupId>
107+
<groupId>commons-io</groupId>
106108
<artifactId>commons-io</artifactId>
107-
<version>1.3.2</version>
109+
<version>2.5</version>
108110
</dependency>
109-
<!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>
111+
112+
<!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>
110113
<version>1.7.25</version> </dependency> -->
111114

112115
<!-- https://mvnrepository.com/artifact/org.json/json -->
@@ -116,6 +119,13 @@
116119
<version>20160810</version>
117120
</dependency>
118121

122+
<!-- https://mvnrepository.com/artifact/com.github.wnameless/json-flattener -->
123+
<dependency>
124+
<groupId>com.github.wnameless</groupId>
125+
<artifactId>json-flattener</artifactId>
126+
<version>0.4.1</version>
127+
</dependency>
128+
119129
<dependency>
120130
<groupId>org.mongodb</groupId>
121131
<artifactId>mongo-java-driver</artifactId>
@@ -126,13 +136,9 @@
126136
<artifactId>joda-time</artifactId>
127137
</dependency>
128138
<dependency>
129-
<groupId>com.fasterxml.jackson.core</groupId>
130-
<artifactId>jackson-databind</artifactId>
131-
</dependency>
132-
<dependency>
133-
<groupId>commons-lang</groupId>
134-
<artifactId>commons-lang</artifactId>
135-
<version>2.6</version>
139+
<groupId>org.apache.commons</groupId>
140+
<artifactId>commons-lang3</artifactId>
141+
<version>3.5</version>
136142
</dependency>
137143
<dependency>
138144
<groupId>io.springfox</groupId>
@@ -159,7 +165,12 @@
159165
<version>2.0.0</version>
160166
<scope>test</scope>
161167
</dependency>
162-
168+
<dependency>
169+
<groupId>org.projectlombok</groupId>
170+
<artifactId>lombok</artifactId>
171+
<version>1.16.16</version>
172+
<scope>provided</scope>
173+
</dependency>
163174
</dependencies>
164175
<build>
165176
<plugins>
@@ -168,7 +179,7 @@
168179
<artifactId>spring-boot-maven-plugin</artifactId>
169180
</plugin>
170181

171-
<!-- PhoenixNAP RAML Code Generator plugin used to generate sources
182+
<!-- PhoenixNAP RAML Code Generator plugin used to generate sources
172183
from raml -->
173184
<plugin>
174185
<groupId>com.phoenixnap.oss</groupId>
@@ -185,16 +196,22 @@
185196
<baseUri>/</baseUri>
186197
<seperateMethodsByContentType>false</seperateMethodsByContentType>
187198
<useJackson1xCompatibility>false</useJackson1xCompatibility>
199+
<rule>com.phoenixnap.oss.ramlapisync.generation.rules.Spring4ControllerInterfaceRule</rule>
200+
<generationConfig>
201+
<useCommonsLang3>true</useCommonsLang3>
202+
</generationConfig>
188203
</configuration>
204+
<executions>
205+
<execution>
206+
<id>generate-springmvc-controllers</id>
207+
<phase>generate-sources</phase>
208+
<goals>
209+
<goal>generate-springmvc-endpoints</goal>
210+
</goals>
211+
</execution>
212+
</executions>
189213
</plugin>
190-
<!-- Required to build the executable jar file -->
191-
<plugin>
192-
<groupId>org.springframework.boot</groupId>
193-
<artifactId>spring-boot-maven-plugin</artifactId>
194-
<configuration>
195-
<classifier>exec</classifier>
196-
</configuration>
197-
</plugin>
214+
198215
<!-- required for adding generated sources -->
199216
<plugin>
200217
<groupId>org.codehaus.mojo</groupId>
@@ -214,22 +231,6 @@
214231
</execution>
215232
</executions>
216233
</plugin>
217-
<plugin>
218-
<groupId>com.phoenixnap.oss</groupId>
219-
<artifactId>springmvc-raml-plugin</artifactId>
220-
<configuration>
221-
<rule>com.phoenixnap.oss.ramlapisync.generation.rules.Spring4ControllerInterfaceRule</rule>
222-
</configuration>
223-
<executions>
224-
<execution>
225-
<id>generate-springmvc-controllers</id>
226-
<phase>generate-sources</phase>
227-
<goals>
228-
<goal>generate-springmvc-endpoints</goal>
229-
</goals>
230-
</execution>
231-
</executions>
232-
</plugin>
233234

234235
<plugin>
235236
<groupId>org.apache.maven.plugins</groupId>
@@ -247,4 +248,4 @@
247248

248249
</plugins>
249250
</build>
250-
</project>
251+
</project>

src/main/java/com/ericsson/ei/App.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,50 @@
1+
/*
2+
Copyright 2017 Ericsson AB.
3+
For a full list of individual contributors, please see the commit history.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
117
package com.ericsson.ei;
218

319
import org.springframework.boot.SpringApplication;
420
import org.springframework.boot.autoconfigure.SpringBootApplication;
521
import org.springframework.scheduling.annotation.EnableAsync;
622
import org.springframework.scheduling.annotation.EnableScheduling;
723

24+
import java.util.ArrayList;
25+
import java.util.Collections;
26+
import java.util.List;
27+
828
@SpringBootApplication
929
@EnableAsync
1030
@EnableScheduling
1131
public class App {
1232

1333
public static void main(String[] args) {
34+
35+
List<String> logLevels = new ArrayList<>();
36+
Collections.addAll(logLevels, "ALL", "DEBUG", "ERROR", "FATAL", "INFO", "TRACE", "WARN");
37+
38+
if(args != null && args.length > 0 && logLevels.contains(args[0])) {
39+
System.setProperty("logging.level.root", args[0]);
40+
System.setProperty("logging.level.org.springframework.web", args[0]);
41+
System.setProperty("logging.level.com.ericsson.ei", args[0]);
42+
} else {
43+
System.setProperty("logging.level.root", "OFF");
44+
System.setProperty("logging.level.org.springframework.web", "OFF");
45+
System.setProperty("logging.level.com.ericsson.ei", "OFF");
46+
}
47+
1448
SpringApplication.run(App.class, args);
1549
}
1650

src/main/java/com/ericsson/ei/EnpointSecurity.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
/***********************************************************************
2-
* *
3-
* Copyright Ericsson AB 2017 *
4-
* *
5-
* No part of this software may be reproduced in any form without the *
6-
* written permission of the copyright owner. *
7-
* *
8-
***********************************************************************/
1+
/*
2+
Copyright 2017 Ericsson AB.
3+
For a full list of individual contributors, please see the commit history.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
917

1018
package com.ericsson.ei;
1119
import org.springframework.context.annotation.Configuration;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
Copyright 2017 Ericsson AB.
3+
For a full list of individual contributors, please see the commit history.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
package com.ericsson.ei.config;
18+
19+
import java.util.concurrent.Executor;
20+
21+
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
22+
import org.springframework.beans.factory.annotation.Value;
23+
import org.springframework.context.annotation.Configuration;
24+
import org.springframework.scheduling.annotation.AsyncConfigurer;
25+
import org.springframework.scheduling.annotation.EnableAsync;
26+
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
27+
28+
@Configuration
29+
@EnableAsync
30+
public class SpringAsyncConfig implements AsyncConfigurer{
31+
32+
@Value("${threads.corePoolSize}") private int corePoolSize;
33+
@Value("${threads.queueCapacity}") private int queueCapacity;
34+
@Value("${threads.maxPoolSize}") private int maxPoolSize;
35+
36+
37+
@Override
38+
public Executor getAsyncExecutor() {
39+
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
40+
executor.setCorePoolSize(corePoolSize);
41+
executor.setQueueCapacity(queueCapacity);
42+
executor.setMaxPoolSize(maxPoolSize);
43+
executor.setThreadNamePrefix("EventHandler-");
44+
executor.initialize();
45+
return executor;
46+
}
47+
48+
49+
@Override
50+
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
51+
// TODO Auto-generated method stub
52+
return null;
53+
}
54+
}

src/main/java/com/ericsson/ei/config/SwaggerConfig.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
/***********************************************************************
2-
* *
3-
* Copyright Ericsson AB 2017 *
4-
* *
5-
* No part of this software may be reproduced in any form without the *
6-
* written permission of the copyright owner. *
7-
* *
8-
***********************************************************************/
1+
/*
2+
Copyright 2017 Ericsson AB.
3+
For a full list of individual contributors, please see the commit history.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
917

1018
package com.ericsson.ei.config;
1119

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
package com.ericsson.ei.controller;
3+
4+
import com.ericsson.ei.controller.model.QueryResponse;
5+
import org.springframework.http.ResponseEntity;
6+
import org.springframework.web.bind.annotation.RequestMapping;
7+
import org.springframework.web.bind.annotation.RequestMethod;
8+
import org.springframework.web.bind.annotation.RequestParam;
9+
import org.springframework.web.bind.annotation.RestController;
10+
11+
12+
/**
13+
* No description
14+
* (Generated with springmvc-raml-parser v.0.8.6)
15+
*
16+
*/
17+
@RestController
18+
@RequestMapping(value = "/query/aggregatedObject", produces = "application/json")
19+
public interface AggregatedObjectController {
20+
21+
22+
/**
23+
* No description
24+
*
25+
*/
26+
@RequestMapping(value = "", method = RequestMethod.GET)
27+
public ResponseEntity<QueryResponse> getQueryAggregatedObject(
28+
@RequestParam
29+
String id);
30+
31+
}

0 commit comments

Comments
 (0)