From 8e9c0653dd6c6862123c9609ae34e1206d86456e Mon Sep 17 00:00:00 2001 From: talig Date: Wed, 20 Dec 2017 14:30:43 +0200 Subject: Add collaboration feature Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig --- .../openecomp/sdcrests/common/RestConstants.java | 4 ++- .../sdcrests/common/types/VersionDto.java | 34 ---------------------- .../openecomp/sdcrests/mapping/EchoMapMapping.java | 14 +++++++++ .../openecomp/sdcrests/mapping/EchoMapping.java | 8 +++++ .../openecomp/sdcrests/mapping/MappingBase.java | 6 ---- 5 files changed, 25 insertions(+), 41 deletions(-) delete mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/VersionDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapMapping.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapping.java (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java index 7bc1082ebe..302af10dc2 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java @@ -21,10 +21,12 @@ package org.openecomp.sdcrests.common; public class RestConstants { - public static final String USER_ID_HEADER_PARAM = "USER_ID"; // value Should be equal to com.tlv.sdc.common.api.Constants#USER_ID_HEADER + public static final String USER_ID_HEADER_PARAM = "USER_ID"; + public static final String LAST_DELIVERED_QUERY_PARAM = "LAST_DELIVERED_EVENT_ID"; public static final String USER_MISSING_ERROR_MSG = "Field does not conform to predefined criteria : user : may not be null"; + public static final String INVALID_JSON_ERROR_MESSAGE = "Field does not conform to predefined criteria : body :must be in JSON format"; } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/VersionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/VersionDto.java deleted file mode 100644 index b5b86c65a2..0000000000 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/VersionDto.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openecomp.sdcrests.common.types; - -/** - * Created by SVISHNEV on 3/5/2017. - */ -public class VersionDto { - String id; - String label; - - public VersionDto(){ - - } - - public VersionDto(String id, String label) { - this.id = id; - this.label = label; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } -} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapMapping.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapMapping.java new file mode 100644 index 0000000000..81c2f37a66 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapMapping.java @@ -0,0 +1,14 @@ +package org.openecomp.sdcrests.mapping; + +import java.util.HashMap; + +/** + * Created by ayalaben on 9/12/2017 + */ +public class EchoMapMapping extends MappingBase,HashMap> { + + @Override +public void doMapping(HashMap source, HashMap target) { + target.putAll(source); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapping.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapping.java new file mode 100644 index 0000000000..4e5a22e3c7 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapping.java @@ -0,0 +1,8 @@ +package org.openecomp.sdcrests.mapping; + +public class EchoMapping extends MappingBase { + @Override + public void doMapping(Object source, Object target) { + target = source; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java index 2310c0f6ce..25c2be9158 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java @@ -23,15 +23,11 @@ package org.openecomp.sdcrests.mapping; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerServiceName; -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.logging.api.LoggerFactory; - /** * Base class for all mapping classes. Mapping classes will perform data mapping from source object * to target object Base class provides following
  1. provides life cycle of @@ -55,8 +51,6 @@ public abstract class MappingBase { * @return T - instance of type T */ - private final Logger logger = (Logger) LoggerFactory.getLogger(this.getClass().getName()); - public final T applyMapping(final S source, Class clazz) { T target = (T) instantiateTarget(clazz); if (source == null || target == null) { -- cgit 1.2.3-korg