aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-adapters-rest-interface/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-adapters-rest-interface/src/main/java')
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java18
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java4
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java6
3 files changed, 6 insertions, 22 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
index f51cb0dd64..2a3a64ce1b 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
@@ -21,7 +21,6 @@ package org.openecomp.mso.adapters.json;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import org.codehaus.jackson.map.ObjectMapper;
@@ -48,27 +47,22 @@ import java.util.Map;
* </pre>
*/
public class MapDeserializer extends JsonDeserializer<Map<String, String>> {
+
@Override
public Map<String, String> deserialize(JsonParser parser,
- DeserializationContext context) throws IOException,
- JsonProcessingException {
+ DeserializationContext context) throws IOException {
ObjectMapper mapper = new ObjectMapper();
JsonNode tree = mapper.readTree(parser);
-
Map<String, String> map = new LinkedHashMap<>();
- Iterator<JsonNode> iterator = tree.iterator();
-
- while (iterator.hasNext()) {
- JsonNode element = iterator.next();
- Iterator<JsonNode> arrayIterator = element.iterator();
- while (arrayIterator.hasNext()) {
- JsonNode arrayElement = arrayIterator.next();
+ if (tree == null)
+ return map;
+ for (JsonNode element : tree) {
+ for (JsonNode arrayElement : element) {
String key = arrayElement.get("key").getTextValue();
String value = arrayElement.get("value").getTextValue();
map.put(key, value);
}
}
-
return map;
}
}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java
index 83c31336bb..2d359e059f 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java
@@ -37,10 +37,6 @@ public class RollbackTenantError implements Serializable {
public RollbackTenantError () {}
- public RollbackTenantError (String message) {
- this.message = message;
- }
-
public RollbackTenantError (String message, MsoExceptionCategory category, boolean rolledBack) {
this.message = message;
this.category = category;
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java
index d7b02e028a..c5105aa683 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java
@@ -20,8 +20,6 @@
package org.openecomp.mso.adapters.tenantrest;
-
-
import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
@@ -39,10 +37,6 @@ public class TenantExceptionResponse implements Serializable {
public TenantExceptionResponse () {}
- public TenantExceptionResponse (String message) {
- this.message = message;
- }
-
public TenantExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack) {
this.message = message;
this.category = category;