summaryrefslogtreecommitdiffstats
path: root/services/activity-spec/activity-spec-web/activity-spec-service/src/main
diff options
context:
space:
mode:
authorshrikantawachar <shrikant.awachar@amdocs.com>2018-03-22 15:01:28 +0530
committerOren Kleks <orenkle@amdocs.com>2018-03-22 15:02:46 +0000
commit79550d5dc1c5bcb79123128aa37b381a368e38d9 (patch)
tree0b8391355c6bcd5cafb2ae48ed2871fc905ca8e5 /services/activity-spec/activity-spec-web/activity-spec-service/src/main
parent473f768e025412d43afa1f403ba638b913ffce83 (diff)
Enhance Activity Spec
Enhance Activity Spec to include additional fields type and content. Change-Id: Ic39aa21ef265bf07a5522a2f46f84d378316c7aa Issue-ID: SDC-1048 Signed-off-by: shrikantawachar <shrikant.awachar@amdocs.com>
Diffstat (limited to 'services/activity-spec/activity-spec-web/activity-spec-service/src/main')
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java10
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java10
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java6
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java6
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java12
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java6
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java6
7 files changed, 36 insertions, 20 deletions
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java
index 2062fe273b..2364d59629 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java
@@ -35,17 +35,19 @@ public class MapActivitySpecRequestDtoToActivitySpecEntity
target.setDescription(source.getDescription());
target.setCategoryList(source.getCategoryList() == null ? new ArrayList<String>()
: source.getCategoryList());
- if (Objects.nonNull(source.getInputParameters())) {
- target.setInputParameters(source.getInputParameters().stream()
+ if (Objects.nonNull(source.getInputs())) {
+ target.setInputs(source.getInputs().stream()
.map(activitySpecParameterDto -> new MapDtoToActivityParameter()
.applyMapping(activitySpecParameterDto, ActivitySpecParameter.class))
.collect(Collectors.toList()));
}
- if (Objects.nonNull(source.getOutputParameters())) {
- target.setOutputParameters(source.getOutputParameters().stream()
+ if (Objects.nonNull(source.getOutputs())) {
+ target.setOutputs(source.getOutputs().stream()
.map(activitySpecParameterDto -> new MapDtoToActivityParameter()
.applyMapping(activitySpecParameterDto, ActivitySpecParameter.class))
.collect(Collectors.toList()));
}
+ target.setType(source.getType());
+ target.setContent(source.getContent());
}
}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java
index 25e0f6e9c4..697e1bd667 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java
@@ -32,18 +32,20 @@ public class MapActivitySpecToActivitySpecGetResponse extends MappingBase<Activi
target.setName(source.getName());
target.setDescription(source.getDescription());
target.setCategoryList(source.getCategoryList());
- if (Objects.nonNull(source.getInputParameters())) {
- target.setInputParameters(source.getInputParameters().stream().map(
+ if (Objects.nonNull(source.getInputs())) {
+ target.setInputs(source.getInputs().stream().map(
activitySpecParameter -> new MapActivityParameterToDto()
.applyMapping(activitySpecParameter, ActivitySpecParameterDto
.class)).collect(Collectors.toList()));
}
- if (Objects.nonNull(source.getOutputParameters())) {
- target.setOutputParameters(source.getOutputParameters().stream().map(
+ if (Objects.nonNull(source.getOutputs())) {
+ target.setOutputs(source.getOutputs().stream().map(
activitySpecParameter -> new MapActivityParameterToDto()
.applyMapping(activitySpecParameter, ActivitySpecParameterDto
.class)).collect(Collectors.toList()));
}
target.setStatus(source.getStatus());
+ target.setType(source.getType());
+ target.setContent(source.getContent());
}
}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java
index cf3fa969fa..9453935559 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java
@@ -23,7 +23,9 @@ public class ActivitySpecGetResponse {
private String name;
private String description;
private List<String> categoryList;
- private List<ActivitySpecParameterDto> inputParameters;
- private List<ActivitySpecParameterDto> outputParameters;
+ private List<ActivitySpecParameterDto> inputs;
+ private List<ActivitySpecParameterDto> outputs;
private String status;
+ private String type;
+ private String content;
}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java
index 77ea393ce3..67455f9c9e 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java
@@ -32,6 +32,8 @@ public class ActivitySpecRequestDto {
private String description;
private List<String> categoryList;
- private List<ActivitySpecParameterDto> inputParameters;
- private List<ActivitySpecParameterDto> outputParameters;
+ private List<ActivitySpecParameterDto> inputs;
+ private List<ActivitySpecParameterDto> outputs;
+ private String type;
+ private String content;
}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java
index d9d495a01a..0dabcca984 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java
@@ -112,8 +112,10 @@ public class ActivitySpecDaoZusammenImpl implements ActivitySpecDao {
private void enrichEntityFromElementData(ActivitySpecEntity entity, InputStream data) {
ActivitySpecData activitySpecData = JsonUtil.json2Object(data, ActivitySpecData.class);
if (Objects.nonNull(activitySpecData)) {
- entity.setInputParameters(activitySpecData.getInputParameters());
- entity.setOutputParameters(activitySpecData.getOutputParameters());
+ entity.setInputs(activitySpecData.getInputs());
+ entity.setOutputs(activitySpecData.getOutputs());
+ entity.setType(activitySpecData.getType());
+ entity.setContent(activitySpecData.getContent());
}
}
@@ -127,8 +129,10 @@ public class ActivitySpecDaoZusammenImpl implements ActivitySpecDao {
private void enrichElementDataFromEntity(ZusammenElement element, ActivitySpecEntity entity) {
ActivitySpecData activitySpecData = new ActivitySpecData();
- activitySpecData.setInputParameters(entity.getInputParameters());
- activitySpecData.setOutputParameters(entity.getOutputParameters());
+ activitySpecData.setInputs(entity.getInputs());
+ activitySpecData.setOutputs(entity.getOutputs());
+ activitySpecData.setType(entity.getType());
+ activitySpecData.setContent(entity.getContent());
element.setData(new ByteArrayInputStream(JsonUtil.object2Json(activitySpecData).getBytes()));
}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java
index b21e424a2f..2f261f8fa9 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java
@@ -29,8 +29,10 @@ public class ActivitySpecEntity {
private String description;
private List<String> categoryList;
- private List<ActivitySpecParameter> inputParameters;
- private List<ActivitySpecParameter> outputParameters;
+ private List<ActivitySpecParameter> inputs;
+ private List<ActivitySpecParameter> outputs;
+ private String type;
+ private String content;
//Not to be maintained in activityspec element
private String status;
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java
index e884bfc784..ad70376aa2 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java
@@ -21,7 +21,9 @@ import java.util.List;
@lombok.Data
public class ActivitySpecData {
- private List<ActivitySpecParameter> inputParameters = Collections.emptyList();
- private List<ActivitySpecParameter> outputParameters = Collections.emptyList();
+ private List<ActivitySpecParameter> inputs = Collections.emptyList();
+ private List<ActivitySpecParameter> outputs = Collections.emptyList();
+ private String type;
+ private String content;
}