Skip to content

Commit abecded

Browse files
Ei- raml migration from 0.8 to 1.0 (#197)
* updating raml to version 1.0 * property name change to springmvc-raml-version
1 parent 09f3061 commit abecded

Some content is hidden

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

52 files changed

+584
-669
lines changed

pom.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<properties>
1818
<java.version>1.8</java.version>
19-
<plugin-version>0.10.11</plugin-version>
19+
<springmvc-raml-version>2.0.4</springmvc-raml-version>
2020
<output-relative-path>src/main/java</output-relative-path>
2121
<raml-path>src/main/resources/public/raml/instance_info.raml</raml-path>
2222
<raml-path>src/main/resources/public/raml/eiffel-intelligence.raml</raml-path>
@@ -285,10 +285,10 @@
285285
<plugin>
286286
<groupId>com.phoenixnap.oss</groupId>
287287
<artifactId>springmvc-raml-plugin</artifactId>
288-
<version>${plugin-version}</version>
288+
<version>${springmvc-raml-version}</version>
289289
<configuration>
290290
<!-- path to raml file -->
291-
<ramlPath>${raml-path}</ramlPath>
291+
<ramlPath>${raml-path}</ramlPath>
292292
<!-- output of generated code -->
293293
<outputRelativePath>${output-relative-path}</outputRelativePath>
294294
<addTimestampFolder>false</addTimestampFolder>
@@ -297,7 +297,8 @@
297297
<baseUri>/</baseUri>
298298
<seperateMethodsByContentType>false</seperateMethodsByContentType>
299299
<useJackson1xCompatibility>false</useJackson1xCompatibility>
300-
<rule>com.phoenixnap.oss.ramlapisync.generation.rules.Spring4ControllerInterfaceRule</rule>
300+
<rule>com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4ControllerInterfaceRule</rule>
301+
<methodsNamingLogic>RESOURCES</methodsNamingLogic>
301302
<generationConfig>
302303
<useCommonsLang3>true</useCommonsLang3>
303304
</generationConfig>

src/main/java/com/ericsson/ei/controller/AuthController.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
package com.ericsson.ei.controller;
33

44
import org.springframework.http.ResponseEntity;
5+
import org.springframework.validation.annotation.Validated;
56
import org.springframework.web.bind.annotation.RequestMapping;
67
import org.springframework.web.bind.annotation.RequestMethod;
78
import org.springframework.web.bind.annotation.RestController;
89

910

1011
/**
1112
* No description
12-
* (Generated with springmvc-raml-parser v.0.10.11)
13+
* (Generated with springmvc-raml-parser v.2.0.4)
1314
*
1415
*/
1516
@RestController
17+
@Validated
1618
@RequestMapping(value = "/auth", produces = "application/json")
1719
public interface AuthController {
1820

@@ -29,13 +31,13 @@ public interface AuthController {
2931
*
3032
*/
3133
@RequestMapping(value = "/login", method = RequestMethod.GET)
32-
public ResponseEntity<?> getLogin();
34+
public ResponseEntity<?> getAuthLogin();
3335

3436
/**
3537
* This call for checking backend status
3638
*
3739
*/
3840
@RequestMapping(value = "/checkStatus", method = RequestMethod.GET)
39-
public ResponseEntity<?> getCheckStatus();
41+
public ResponseEntity<?> getAuthCheckStatus();
4042

4143
}

src/main/java/com/ericsson/ei/controller/AuthControllerImpl.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
*/
1717
package com.ericsson.ei.controller;
1818

19-
import io.swagger.annotations.Api;
20-
import io.swagger.annotations.ApiOperation;
2119
import org.json.JSONObject;
2220
import org.slf4j.Logger;
2321
import org.slf4j.LoggerFactory;
@@ -28,6 +26,9 @@
2826
import org.springframework.stereotype.Component;
2927
import org.springframework.web.bind.annotation.CrossOrigin;
3028

29+
import io.swagger.annotations.Api;
30+
import io.swagger.annotations.ApiOperation;
31+
3132
/**
3233
* Endpoints /auth/login and /auth/checkStatus should be secured in case LDAP is enabled
3334
* Endpoint /auth should be not secured
@@ -37,7 +38,7 @@
3738
@Api(value = "Auth", description = "REST endpoints for authentication and authorization")
3839
public class AuthControllerImpl implements AuthController {
3940

40-
private static final Logger LOGGER = (Logger) LoggerFactory.getLogger(AuthControllerImpl.class);
41+
private static final Logger LOGGER = LoggerFactory.getLogger(AuthControllerImpl.class);
4142

4243
@Value("${ldap.enabled:false}")
4344
private boolean ldapEnabled;
@@ -58,7 +59,7 @@ public ResponseEntity<?> getAuth() {
5859
@Override
5960
@CrossOrigin
6061
@ApiOperation(value = "To get login of current user", response = String.class)
61-
public ResponseEntity<?> getLogin() {
62+
public ResponseEntity<?> getAuthLogin() {
6263
try {
6364
String currentUser = SecurityContextHolder.getContext().getAuthentication().getName();
6465
return new ResponseEntity<>(new JSONObject().put("user", currentUser).toString(), HttpStatus.OK);
@@ -72,7 +73,7 @@ public ResponseEntity<?> getLogin() {
7273
@Override
7374
@CrossOrigin
7475
@ApiOperation(value = "To check backend status", response = String.class)
75-
public ResponseEntity<?> getCheckStatus() {
76+
public ResponseEntity<?> getAuthCheckStatus() {
7677
try {
7778
return new ResponseEntity<>("Backend server is up and running", HttpStatus.OK);
7879
} catch (Exception e) {

src/main/java/com/ericsson/ei/controller/DownloadController.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
package com.ericsson.ei.controller;
33

44
import org.springframework.http.ResponseEntity;
5+
import org.springframework.validation.annotation.Validated;
56
import org.springframework.web.bind.annotation.RequestMapping;
67
import org.springframework.web.bind.annotation.RequestMethod;
78
import org.springframework.web.bind.annotation.RestController;
89

910

1011
/**
1112
* No description
12-
* (Generated with springmvc-raml-parser v.0.10.11)
13+
* (Generated with springmvc-raml-parser v.2.0.4)
1314
*
1415
*/
1516
@RestController
17+
@Validated
1618
@RequestMapping(value = "/download", produces = "application/json")
1719
public interface DownloadController {
1820

@@ -29,20 +31,20 @@ public interface DownloadController {
2931
*
3032
*/
3133
@RequestMapping(value = "/subscriptionsTemplate", method = RequestMethod.GET)
32-
public ResponseEntity<?> getSubscriptionsTemplate();
34+
public ResponseEntity<?> getDownloadSubscriptionsTemplate();
3335

3436
/**
3537
* This call for getting rules template
3638
*
3739
*/
3840
@RequestMapping(value = "/rulesTemplate", method = RequestMethod.GET)
39-
public ResponseEntity<?> getRulesTemplate();
41+
public ResponseEntity<?> getDownloadRulesTemplate();
4042

4143
/**
4244
* This call for getting events template
4345
*
4446
*/
4547
@RequestMapping(value = "/eventsTemplate", method = RequestMethod.GET)
46-
public ResponseEntity<?> getEventsTemplate();
48+
public ResponseEntity<?> getDownloadEventsTemplate();
4749

4850
}

src/main/java/com/ericsson/ei/controller/DownloadControllerImpl.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
*/
1717
package com.ericsson.ei.controller;
1818

19-
import io.swagger.annotations.Api;
19+
import java.io.IOException;
20+
import java.io.InputStream;
21+
2022
import org.apache.commons.io.IOUtils;
2123
import org.json.JSONObject;
2224
import org.slf4j.Logger;
@@ -26,15 +28,14 @@
2628
import org.springframework.stereotype.Component;
2729
import org.springframework.web.bind.annotation.CrossOrigin;
2830

29-
import java.io.IOException;
30-
import java.io.InputStream;
31+
import io.swagger.annotations.Api;
3132

3233
@Component
3334
@CrossOrigin
3435
@Api(value = "Get Templates", description = "REST endpoints for getting templates")
3536
public class DownloadControllerImpl implements DownloadController {
3637

37-
private static final Logger LOGGER = (Logger) LoggerFactory.getLogger(DownloadControllerImpl.class);
38+
private static final Logger LOGGER = LoggerFactory.getLogger(DownloadControllerImpl.class);
3839

3940
@Override
4041
public ResponseEntity<?> getDownload() {
@@ -52,7 +53,7 @@ public ResponseEntity<?> getDownload() {
5253
}
5354

5455
@Override
55-
public ResponseEntity<?> getSubscriptionsTemplate() {
56+
public ResponseEntity<?> getDownloadSubscriptionsTemplate() {
5657
try {
5758
InputStream is = getClass().getResourceAsStream("/templates/subscriptionsTemplate.json");
5859
return new ResponseEntity<>(IOUtils.toByteArray(is), HttpStatus.OK);
@@ -67,7 +68,7 @@ public ResponseEntity<?> getSubscriptionsTemplate() {
6768
}
6869

6970
@Override
70-
public ResponseEntity<?> getRulesTemplate() {
71+
public ResponseEntity<?> getDownloadRulesTemplate() {
7172
try {
7273
InputStream is = getClass().getResourceAsStream("/templates/rulesTemplate.json");
7374
return new ResponseEntity<>(IOUtils.toByteArray(is), HttpStatus.OK);
@@ -82,7 +83,7 @@ public ResponseEntity<?> getRulesTemplate() {
8283
}
8384

8485
@Override
85-
public ResponseEntity<?> getEventsTemplate() {
86+
public ResponseEntity<?> getDownloadEventsTemplate() {
8687
try {
8788
InputStream is = getClass().getResourceAsStream("/templates/eventsTemplate.json");
8889
return new ResponseEntity<>(IOUtils.toByteArray(is), HttpStatus.OK);

src/main/java/com/ericsson/ei/controller/InformationController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
package com.ericsson.ei.controller;
33

44
import org.springframework.http.ResponseEntity;
5+
import org.springframework.validation.annotation.Validated;
56
import org.springframework.web.bind.annotation.RequestMapping;
67
import org.springframework.web.bind.annotation.RequestMethod;
78
import org.springframework.web.bind.annotation.RestController;
@@ -10,10 +11,11 @@
1011
/**
1112
* Provides interaction with InstanceInfo resource
1213
*
13-
* (Generated with springmvc-raml-parser v.0.10.11)
14+
* (Generated with springmvc-raml-parser v.2.0.4)
1415
*
1516
*/
1617
@RestController
18+
@Validated
1719
@RequestMapping(value = "/information", produces = "application/json")
1820
public interface InformationController {
1921

src/main/java/com/ericsson/ei/controller/QueryAggregatedObjectController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import com.ericsson.ei.controller.model.QueryResponse;
55
import org.springframework.http.ResponseEntity;
6+
import org.springframework.validation.annotation.Validated;
67
import org.springframework.web.bind.annotation.RequestMapping;
78
import org.springframework.web.bind.annotation.RequestMethod;
89
import org.springframework.web.bind.annotation.RequestParam;
@@ -11,10 +12,11 @@
1112

1213
/**
1314
* No description
14-
* (Generated with springmvc-raml-parser v.0.10.11)
15+
* (Generated with springmvc-raml-parser v.2.0.4)
1516
*
1617
*/
1718
@RestController
19+
@Validated
1820
@RequestMapping(value = "/queryAggregatedObject", produces = "application/json")
1921
public interface QueryAggregatedObjectController {
2022

src/main/java/com/ericsson/ei/controller/QueryController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import javax.validation.Valid;
55
import com.ericsson.ei.controller.model.QueryBody;
66
import org.springframework.http.ResponseEntity;
7+
import org.springframework.validation.annotation.Validated;
78
import org.springframework.web.bind.annotation.RequestBody;
89
import org.springframework.web.bind.annotation.RequestMapping;
910
import org.springframework.web.bind.annotation.RequestMethod;
@@ -12,10 +13,11 @@
1213

1314
/**
1415
* No description
15-
* (Generated with springmvc-raml-parser v.0.10.11)
16+
* (Generated with springmvc-raml-parser v.2.0.4)
1617
*
1718
*/
1819
@RestController
20+
@Validated
1921
@RequestMapping(value = "/query", produces = "application/json")
2022
public interface QueryController {
2123

@@ -25,7 +27,7 @@ public interface QueryController {
2527
*
2628
*/
2729
@RequestMapping(value = "", method = RequestMethod.POST)
28-
public ResponseEntity<?> updateQuery(
30+
public ResponseEntity<?> createQuery(
2931
@Valid
3032
@RequestBody
3133
QueryBody queryBody);

src/main/java/com/ericsson/ei/controller/QueryControllerImpl.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
*/
1717
package com.ericsson.ei.controller;
1818

19-
import com.ericsson.ei.controller.model.QueryBody;
20-
import com.ericsson.ei.queryservice.ProcessQueryParams;
21-
import io.swagger.annotations.Api;
22-
import io.swagger.annotations.ApiOperation;
2319
import org.json.JSONArray;
2420
import org.json.JSONObject;
2521
import org.slf4j.Logger;
@@ -31,6 +27,12 @@
3127
import org.springframework.web.bind.annotation.CrossOrigin;
3228
import org.springframework.web.bind.annotation.RequestBody;
3329

30+
import com.ericsson.ei.controller.model.QueryBody;
31+
import com.ericsson.ei.queryservice.ProcessQueryParams;
32+
33+
import io.swagger.annotations.Api;
34+
import io.swagger.annotations.ApiOperation;
35+
3436
/**
3537
* This class represents the REST end-points for the query service. It can take
3638
* both query parameters and form parameters as criterias.
@@ -40,15 +42,15 @@
4042
@Api(value = "query", description = "REST endpoints for the freestyle query service")
4143
public class QueryControllerImpl implements QueryController {
4244

43-
private static final Logger LOGGER = (Logger) LoggerFactory.getLogger(QueryControllerImpl.class);
45+
private static final Logger LOGGER = LoggerFactory.getLogger(QueryControllerImpl.class);
4446

4547
@Autowired
4648
private ProcessQueryParams processQueryParams;
4749

4850
@Override
4951
@CrossOrigin
5052
@ApiOperation(value = "")
51-
public ResponseEntity<?> updateQuery(@RequestBody final QueryBody body) {
53+
public ResponseEntity<?> createQuery(@RequestBody final QueryBody body) {
5254
try {
5355
JSONObject criteria = new JSONObject(body.getCriteria().getAdditionalProperties());
5456
JSONObject options = null;

src/main/java/com/ericsson/ei/controller/QueryMissedNotificationController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import com.ericsson.ei.controller.model.QueryResponse;
55
import org.springframework.http.ResponseEntity;
6+
import org.springframework.validation.annotation.Validated;
67
import org.springframework.web.bind.annotation.RequestMapping;
78
import org.springframework.web.bind.annotation.RequestMethod;
89
import org.springframework.web.bind.annotation.RequestParam;
@@ -11,10 +12,11 @@
1112

1213
/**
1314
* No description
14-
* (Generated with springmvc-raml-parser v.0.10.11)
15+
* (Generated with springmvc-raml-parser v.2.0.4)
1516
*
1617
*/
1718
@RestController
19+
@Validated
1820
@RequestMapping(value = "/queryMissedNotifications", produces = "application/json")
1921
public interface QueryMissedNotificationController {
2022

0 commit comments

Comments
 (0)