Skip to content

Commit d4dda43

Browse files
emichafvasile-baluta
authored andcommitted
bugfix in DownstreamIdRulesHandler (#27)
* approved rest post respond updated, added copyright headers * copyright header added to test, and unit test updated
1 parent b0ddd66 commit d4dda43

File tree

60 files changed

+955
-137
lines changed

Some content is hidden

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

60 files changed

+955
-137
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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;

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;

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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.config;
218

319
import java.util.concurrent.Executor;

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

src/main/java/com/ericsson/ei/controller/SubscriptionControllerImpl.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
package com.ericsson.ei.controller;
1018

1119
import java.util.ArrayList;

src/main/java/com/ericsson/ei/erqueryservice/ERQueryService.java

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

src/main/java/com/ericsson/ei/exception/SubscriptionNotFoundException.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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.exception;
218

319
public class SubscriptionNotFoundException extends Exception {

src/main/java/com/ericsson/ei/handlers/DownstreamExtractionHandler.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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.handlers;
218

319
import org.slf4j.Logger;

src/main/java/com/ericsson/ei/handlers/DownstreamIdRulesHandler.java

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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.handlers;
218

319
import java.util.ArrayList;
@@ -34,25 +50,27 @@ public void setJmesPathInterface(JmesPathInterface jmesPathInterface) {
3450
}
3551

3652
public void runIdRules(RulesObject rulesObject, String event) {
37-
JsonNode idsJsonObj = getIds(rulesObject, event);
38-
ArrayList<String> objects = null;
39-
String id;
40-
if (idsJsonObj != null && idsJsonObj.isArray()) {
41-
for (final JsonNode idJsonObj : idsJsonObj) {
42-
id = idJsonObj.textValue();
43-
objects = matchIdRulesHandler.fetchObjectsById(rulesObject, id);
44-
for (String object:objects) {
45-
downstreamExtractionHandler.runExtraction(rulesObject, id, event, object);
46-
}
47-
if (objects.size() == 0) {
48-
try {
49-
waitListStorageHandler.addEventToWaitList(event, rulesObject);
50-
} catch (Exception e) {
51-
log.info(e.getMessage(),e);
52-
}
53-
}
54-
}
55-
}
53+
if (rulesObject != null && event != null) {
54+
JsonNode idsJsonObj = getIds(rulesObject, event);
55+
ArrayList<String> objects = null;
56+
String id;
57+
if (idsJsonObj != null && idsJsonObj.isArray()) {
58+
for (final JsonNode idJsonObj : idsJsonObj) {
59+
id = idJsonObj.textValue();
60+
objects = matchIdRulesHandler.fetchObjectsById(rulesObject, id);
61+
for (String object : objects) {
62+
downstreamExtractionHandler.runExtraction(rulesObject, id, event, object);
63+
}
64+
if (objects.size() == 0) {
65+
try {
66+
waitListStorageHandler.addEventToWaitList(event, rulesObject);
67+
} catch (Exception e) {
68+
log.info(e.getMessage(), e);
69+
}
70+
}
71+
}
72+
}
73+
}
5674
}
5775

5876
public JsonNode getIds(RulesObject rulesObject, String event) {

src/main/java/com/ericsson/ei/handlers/EventHandler.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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.handlers;
218

319
import org.slf4j.Logger;

0 commit comments

Comments
 (0)