Skip to content

Commit 6b6158a

Browse files
authored
Revert "merge (#20)" (#21)
This reverts commit 470e899.
1 parent 470e899 commit 6b6158a

18 files changed

+122
-563
lines changed

.travis.yml

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

1515
script:
16-
- mvn clean install
16+
- mvn -DsomeModule.test.excludes="**/FlowTest.java, **/FlowTest2.java, **/TrafficGeneratedTest.java, **/FlowTestExternalComposition.java, **/FlowTestTestExecution.java, **/FlowSourceChangeObject.java" test
17+
- mvn -DsomeModule.test.includes="**/FlowTest.java" test
18+
- 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: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@
185185
<version>1.16.16</version>
186186
<scope>provided</scope>
187187
</dependency>
188-
<dependency>
189-
<groupId>org.jongo</groupId>
190-
<artifactId>jongo</artifactId>
191-
<version>1.3.0</version>
192-
</dependency>
193188
</dependencies>
194189
<build>
195190
<plugins>

src/main/java/com/ericsson/ei/controller/QueryAggregatedObjectController.java renamed to src/main/java/com/ericsson/ei/controller/AggregatedObjectController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*
1616
*/
1717
@RestController
18-
@RequestMapping(value = "/queryAggregatedObject", produces = "application/json")
19-
public interface QueryAggregatedObjectController {
18+
@RequestMapping(value = "/query/aggregatedObject", produces = "application/json")
19+
public interface AggregatedObjectController {
2020

2121

2222
/**

src/main/java/com/ericsson/ei/controller/QueryAggregatedObjectControllerImpl.java renamed to src/main/java/com/ericsson/ei/controller/AggregatedObjectControllerImpl.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*/
1414
package com.ericsson.ei.controller;
1515

16-
import com.ericsson.ei.controller.model.QueryResponse;
17-
import com.ericsson.ei.queryservice.ProcessAggregatedObject;
16+
import java.util.ArrayList;
17+
1818
import org.slf4j.Logger;
1919
import org.slf4j.LoggerFactory;
2020
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,33 +24,34 @@
2424
import org.springframework.web.bind.annotation.CrossOrigin;
2525
import org.springframework.web.bind.annotation.RequestParam;
2626

27-
import java.util.ArrayList;
27+
import com.ericsson.ei.controller.model.QueryResponse;
28+
import com.ericsson.ei.queryservice.ProcessAggregatedObject;
2829

2930
/**
3031
* This class represents the REST GET mechanism to extract the aggregated data
3132
* on the basis of the ID from the aggregatedObject.
33+
*
3234
*/
3335
@Component
3436
@CrossOrigin
35-
public class QueryAggregatedObjectControllerImpl implements QueryAggregatedObjectController {
37+
public class AggregatedObjectControllerImpl implements AggregatedObjectController {
3638

37-
private static Logger LOGGER = (Logger) LoggerFactory.getLogger(QueryAggregatedObjectControllerImpl.class);
39+
static Logger log = (Logger) LoggerFactory.getLogger(AggregatedObjectControllerImpl.class);
3840

3941
@Autowired
4042
private ProcessAggregatedObject processAggregatedObject;
4143

4244
/**
4345
* This method is responsible for the REST Get mechanism to extract the
4446
* aggregated data on the basis of the ID from the aggregatedObject.
45-
*
47+
*
4648
* @param id
4749
* @return ResponseEntity
4850
*/
4951
public ResponseEntity<QueryResponse> getQueryAggregatedObject(@RequestParam("ID") final String id) {
50-
QueryResponse queryResponse= new QueryResponse();
5152
ArrayList<String> response = processAggregatedObject.processQueryAggregatedObject(id);
52-
queryResponse.setResponseEntity(response.toString());
53-
LOGGER.debug("The response is : " + response.toString());
54-
return new ResponseEntity(queryResponse, HttpStatus.OK);
53+
log.info("The response is : " + response.toString());
54+
return new ResponseEntity(response.toString(), HttpStatus.OK);
5555
}
56-
}
56+
57+
}

src/main/java/com/ericsson/ei/controller/QueryMissedNotificationController.java renamed to src/main/java/com/ericsson/ei/controller/MissedNotificationController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*
1616
*/
1717
@RestController
18-
@RequestMapping(value = "/queryMissedNotifications", produces = "application/json")
19-
public interface QueryMissedNotificationController {
18+
@RequestMapping(value = "/query/missedNotifications", produces = "application/json")
19+
public interface MissedNotificationController {
2020

2121

2222
/**

src/main/java/com/ericsson/ei/controller/QueryMissedNotificationControllerImpl.java renamed to src/main/java/com/ericsson/ei/controller/MissedNotificationControllerImpl.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
*/
1414
package com.ericsson.ei.controller;
1515

16-
import com.ericsson.ei.controller.model.QueryResponse;
17-
import com.ericsson.ei.queryservice.ProcessMissedNotification;
16+
import java.util.ArrayList;
17+
import java.util.List;
18+
1819
import org.slf4j.Logger;
1920
import org.slf4j.LoggerFactory;
2021
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,34 +25,35 @@
2425
import org.springframework.web.bind.annotation.CrossOrigin;
2526
import org.springframework.web.bind.annotation.RequestParam;
2627

27-
import java.util.List;
28+
import com.ericsson.ei.controller.model.QueryResponse;
29+
import com.ericsson.ei.queryservice.ProcessMissedNotification;
2830

2931
/**
3032
* This class represents the REST GET mechanism to extract the aggregated data
3133
* on the basis of the SubscriptionName from the Missed Notification Object.
34+
*
3235
*/
3336
@Component
3437
@CrossOrigin
35-
public class QueryMissedNotificationControllerImpl implements QueryMissedNotificationController {
38+
public class MissedNotificationControllerImpl implements MissedNotificationController {
3639

37-
private final static Logger LOGGER = (Logger) LoggerFactory.getLogger(QueryMissedNotificationControllerImpl.class);
40+
static Logger log = (Logger) LoggerFactory.getLogger(MissedNotificationControllerImpl.class);
3841

3942
@Autowired
4043
private ProcessMissedNotification processMissedNotification;
4144

4245
/**
4346
* This method is responsible for the REST GET mechanism to extract the data on
4447
* the basis of the SubscriptionName from the Missed Notification Object.
45-
*
48+
*
4649
* @param subscriptionName
4750
* @return ResponseEntity
4851
*/
49-
public ResponseEntity<QueryResponse> getQueryMissedNotifications(@RequestParam("SubscriptionName") final String subscriptionName) {
50-
QueryResponse queryResponse = new QueryResponse();
52+
public ResponseEntity<QueryResponse> getQueryMissedNotifications(
53+
@RequestParam("SubscriptionName") final String subscriptionName) {
5154
List<String> response = processMissedNotification.processQueryMissedNotification(subscriptionName);
52-
queryResponse.setResponseEntity(response.toString());
53-
LOGGER.debug("The response is : " + response.toString());
54-
return new ResponseEntity(queryResponse, HttpStatus.OK);
55+
log.info("The response is : " + response.toString());
56+
return new ResponseEntity(response.toString(), HttpStatus.OK);
5557
}
5658

5759
}

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

Lines changed: 0 additions & 39 deletions
This file was deleted.

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

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/main/java/com/ericsson/ei/queryservice/ProcessAggregatedObject.java

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,25 @@
1313
*/
1414
package com.ericsson.ei.queryservice;
1515

16-
import com.ericsson.ei.mongodbhandler.MongoDBHandler;
17-
import com.fasterxml.jackson.databind.JsonNode;
18-
import com.fasterxml.jackson.databind.ObjectMapper;
19-
import com.mongodb.DB;
20-
import com.mongodb.MongoClient;
21-
import org.bson.Document;
22-
import org.jongo.Jongo;
23-
import org.jongo.MongoCollection;
24-
import org.jongo.MongoCursor;
25-
import org.json.JSONArray;
26-
import org.json.JSONObject;
16+
import java.util.ArrayList;
17+
18+
import javax.annotation.PostConstruct;
19+
2720
import org.slf4j.Logger;
2821
import org.slf4j.LoggerFactory;
2922
import org.springframework.beans.factory.annotation.Autowired;
3023
import org.springframework.beans.factory.annotation.Value;
3124
import org.springframework.stereotype.Component;
3225

33-
import javax.annotation.PostConstruct;
34-
import java.util.ArrayList;
26+
import com.ericsson.ei.mongodbhandler.MongoDBHandler;
27+
import com.fasterxml.jackson.databind.JsonNode;
28+
import com.fasterxml.jackson.databind.ObjectMapper;
3529

3630
/**
3731
* This class represents the mechanism to extract the aggregated data on the
3832
* basis of the ID from the aggregatedObject.
33+
*
34+
*
3935
*/
4036
@Component
4137
public class ProcessAggregatedObject {
@@ -46,67 +42,38 @@ public class ProcessAggregatedObject {
4642
@Value("${database.name}")
4743
private String aggregationDataBaseName;
4844

49-
private static final Logger LOGGER = (Logger) LoggerFactory.getLogger(ProcessAggregatedObject.class);
45+
static Logger log = (Logger) LoggerFactory.getLogger(ProcessAggregatedObject.class);
5046

5147
@Autowired
52-
private MongoDBHandler handler;
48+
MongoDBHandler handler;
5349

5450
/**
5551
* The method is responsible to extract the aggregated data on the basis of
5652
* the ID from the aggregatedObject.
57-
*
53+
*
5854
* @param id
5955
* @return ArrayList
6056
*/
6157
public ArrayList<String> processQueryAggregatedObject(String id) {
6258
ObjectMapper mapper = new ObjectMapper();
6359
String condition = "{\"_id\" : \"" + id + "\"}";
64-
LOGGER.debug("The condition is : " + condition);
60+
log.info("The condition is : " + condition);
6561
JsonNode jsonCondition = null;
6662
try {
6763
jsonCondition = mapper.readTree(condition);
6864
} catch (Exception e) {
69-
LOGGER.error(e.getMessage(), e);
65+
log.error(e.getMessage(), e);
7066
}
71-
LOGGER.debug("The Json condition is : " + jsonCondition);
67+
log.info("The Json condition is : " + jsonCondition);
7268
ArrayList<String> response = handler.find(aggregationDataBaseName, aggregationCollectionName,
7369
jsonCondition.toString());
7470
return response;
7571
}
7672

77-
/**
78-
* This method is responsible for fetching all the aggregatedObjects from
79-
* the Aggregation database and return it as JSONArray.
80-
*
81-
* @param request
82-
* @param AggregationDataBaseName
83-
* @param AggregationCollectionName
84-
* @return JSONArray
85-
*/
86-
public JSONArray processQueryAggregatedObject(JsonNode request, String AggregationDataBaseName, String AggregationCollectionName) {
87-
DB db = new MongoClient().getDB(AggregationDataBaseName);
88-
Jongo jongo = new Jongo(db);
89-
MongoCollection aggObjects = jongo.getCollection(AggregationCollectionName);
90-
LOGGER.debug("Successfully connected to AggregatedObject database");
91-
MongoCursor<Document> allDocuments = aggObjects.find(request.toString()).as(Document.class);
92-
LOGGER.debug("Number of document returned from AggregatedObject collection is : " + allDocuments.count());
93-
JSONArray jsonArray = new JSONArray();
94-
JSONObject doc = null;
95-
while (allDocuments.hasNext()) {
96-
Document temp = allDocuments.next();
97-
try {
98-
doc = new JSONObject(temp.toJson());
99-
} catch (Exception e) {
100-
LOGGER.error(e.getMessage(), e);
101-
}
102-
jsonArray.put(doc);
103-
}
104-
return jsonArray;
105-
}
106-
10773
@PostConstruct
10874
public void init() {
109-
LOGGER.debug("The Aggregated Database is : " + aggregationDataBaseName);
110-
LOGGER.debug("The Aggregated Collection is : " + aggregationCollectionName);
75+
log.debug("The Aggregated Database is : " + aggregationDataBaseName);
76+
log.debug("The Aggregated Collection is : " + aggregationCollectionName);
11177
}
112-
}
78+
79+
}

0 commit comments

Comments
 (0)