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 --- .../conflict-rest/conflict-rest-services/pom.xml | 58 +++++++++ .../sdcrests/conflict/rest/Conflicts.java | 61 ++++++++++ .../rest/mapping/MapConflictInfoToDto.java | 14 +++ .../conflict/rest/mapping/MapConflictToDto.java | 134 +++++++++++++++++++++ .../rest/mapping/MapDtoToConflictResolution.java | 15 +++ .../rest/mapping/MapItemVersionConflictToDto.java | 22 ++++ .../conflict/rest/services/ConflictsImpl.java | 62 ++++++++++ .../conflict-rest/conflict-rest-types/pom.xml | 22 ++++ .../sdcrests/conflict/types/ConflictDto.java | 24 ++++ .../sdcrests/conflict/types/ConflictInfoDto.java | 33 +++++ .../conflict/types/ConflictResolutionDto.java | 27 +++++ .../conflict/types/ItemVersionConflictDto.java | 29 +++++ .../conflict-rest/pom.xml | 35 ++++++ 13 files changed, 536 insertions(+) create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/Conflicts.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictInfoToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapDtoToConflictResolution.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapItemVersionConflictToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/services/ConflictsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictInfoDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictResolutionDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ItemVersionConflictDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/pom.xml (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/pom.xml new file mode 100644 index 0000000000..534aea1a73 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + + + org.openecomp.sdc + conflict-rest + 1.2.0-SNAPSHOT + + + conflict-rest-services + + + + + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + javax.inject + javax.inject + 1 + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + org.openecomp.sdc + openecomp-sdc-conflict-manager + ${project.version} + + + org.openecomp.sdc + conflict-rest-types + ${project.version} + + + org.openecomp.sdc.onboarding + vendor-software-products-rest-services + ${project.version} + + + org.openecomp.sdc.onboarding + vendor-license-rest-services + ${project.version} + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/Conflicts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/Conflicts.java new file mode 100644 index 0000000000..396c4ee5d2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/Conflicts.java @@ -0,0 +1,61 @@ +package org.openecomp.sdcrests.conflict.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdcrests.common.RestConstants; +import org.openecomp.sdcrests.conflict.types.ConflictDto; +import org.openecomp.sdcrests.conflict.types.ConflictResolutionDto; +import org.openecomp.sdcrests.conflict.types.ItemVersionConflictDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.NotNull; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/items/{itemId}/versions/{versionId}/conflicts") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Item Version Conflicts") +@Validated +public interface Conflicts { + + @GET + @Path("/") + @ApiOperation(value = "item version conflicts", + notes = "Item version private copy conflicts against its public copy", + response = ItemVersionConflictDto.class) + Response getConflict(@ApiParam("Item Id") @PathParam("itemId") String itemId, + @ApiParam("Version Id") @PathParam("versionId") String versionId, + @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user); + + @GET + @Path("/{conflictId}") + @ApiOperation(value = "Gets item version conflict", + notes = "Gets an item version private copy conflict against its public copy", + response = ConflictDto.class) + Response getConflict(@ApiParam("Item Id") @PathParam("itemId") String itemId, + @ApiParam("Version Id") @PathParam("versionId") String versionId, + @ApiParam("Version Id") @PathParam("conflictId") String conflictId, + @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user); + + @PUT + @Path("/{conflictId}") + @ApiOperation(value = "Resolves item version conflict", + notes = "Resolves an item version private copy conflict against its public copy") + Response resolveConflict(ConflictResolutionDto conflictResolution, + @ApiParam("Item Id") @PathParam("itemId") String itemId, + @ApiParam("Version Id") @PathParam("versionId") String versionId, + @ApiParam("Version Id") @PathParam("conflictId") String conflictId, + @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictInfoToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictInfoToDto.java new file mode 100644 index 0000000000..e80ef5653d --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictInfoToDto.java @@ -0,0 +1,14 @@ +package org.openecomp.sdcrests.conflict.rest.mapping; + +import org.openecomp.conflicts.types.ConflictInfo; +import org.openecomp.sdcrests.conflict.types.ConflictInfoDto; +import org.openecomp.sdcrests.mapping.MappingBase; + +public class MapConflictInfoToDto extends MappingBase { + @Override + public void doMapping(ConflictInfo source, ConflictInfoDto target) { + target.setId(source.getId()); + target.setType(source.getType()); + target.setName(source.getName()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictToDto.java new file mode 100644 index 0000000000..83a0f52155 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictToDto.java @@ -0,0 +1,134 @@ +package org.openecomp.sdcrests.conflict.rest.mapping; + +import org.openecomp.conflicts.types.Conflict; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.datatypes.model.ElementType; +import org.openecomp.sdcrests.conflict.types.ConflictDto; +import org.openecomp.sdcrests.mapping.EchoMapMapping; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementEntityToLicenseAgreementDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLimitEntityToLimitDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVendorLicenseModelEntityToDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDependencyModelEntityToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentEntityToComponentDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToVspComputeDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorEntityToDeploymentFlavorDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapFilesDataStructureToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapImageEntityToImageDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkEntityToNetworkDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNicEntityToNicDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapProcessEntityToProcessEntityDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireToQuestionnaireDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDetailsToDto; + +import java.util.AbstractMap; +import java.util.HashMap; +import java.util.Map; + +public class MapConflictToDto extends MappingBase { + + @Override + public void doMapping(Conflict source, ConflictDto target) { + target.setId(source.getId()); + target.setType(source.getType()); + target.setName(source.getName()); + + Map.Entry mapperToTargetClass = getMapper(source.getType()); + target.setTheirs(map(mapperToTargetClass, source.getTheirs())); + target.setYours(map(mapperToTargetClass, source.getYours())); + } + + private Map map(Map.Entry mapperToTargetClass, Object object) { + return JsonUtil + .json2Object(JsonUtil.object2Json( + mapperToTargetClass.getKey().applyMapping(object, mapperToTargetClass.getValue())), + Map.class); + } + + private Map.Entry getMapper(ElementType type) { + switch (type) { + case VendorLicenseModel: + return new AbstractMap.SimpleEntry<>(new MapVendorLicenseModelEntityToDto(), + VendorLicenseModelEntityDto.class); + case LicenseAgreement: + return new AbstractMap.SimpleEntry<>( + new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto(), + LicenseAgreementDescriptorDto.class); + case FeatureGroup: + return new AbstractMap.SimpleEntry<>(new MapFeatureGroupEntityToFeatureGroupDescriptorDto(), + FeatureGroupDescriptorDto.class); + case LicenseKeyGroup: + return new AbstractMap.SimpleEntry<>( + new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto(), LicenseKeyGroupEntityDto + .class); + case EntitlementPool: + return new AbstractMap.SimpleEntry<>( + new MapEntitlementPoolEntityToEntitlementPoolEntityDto(), EntitlementPoolEntityDto + .class); + case Limit: + return new AbstractMap.SimpleEntry<>(new MapLimitEntityToLimitDto(), LimitEntityDto.class); + case VendorSoftwareProduct: + return new AbstractMap.SimpleEntry<>(new MapVspDetailsToDto(), VspDetailsDto.class); + case Network: + return new AbstractMap.SimpleEntry<>(new MapNetworkEntityToNetworkDto(), NetworkDto.class); + case Component: + return new AbstractMap.SimpleEntry<>(new MapComponentEntityToComponentDto(), + ComponentDto.class); + case ComponentDependencies: + return new AbstractMap.SimpleEntry<>(new MapComponentDependencyModelEntityToDto(), + ComponentDependencyModel.class); + case Nic: + return new AbstractMap.SimpleEntry<>(new MapNicEntityToNicDto(), NicDto.class); + case Process: + return new AbstractMap.SimpleEntry<>(new MapProcessEntityToProcessEntityDto(), + ProcessEntityDto.class); + case DeploymentFlavor: + return new AbstractMap.SimpleEntry<>(new MapDeploymentFlavorEntityToDeploymentFlavorDto(), + DeploymentFlavorDto.class); + case Compute: + return new AbstractMap.SimpleEntry<>(new MapComputeEntityToVspComputeDto(), + VspComputeDto.class); + case Image: + return new AbstractMap.SimpleEntry<>(new MapImageEntityToImageDto(), ImageDto.class); + case VSPQuestionnaire: + case NicQuestionnaire: + case ComponentQuestionnaire: + case ImageQuestionnaire: + case ComputeQuestionnaire: + return new AbstractMap.SimpleEntry<>(new MapQuestionnaireToQuestionnaireDto(), + QuestionnaireDto.class); + case SNMP_POLL: + case SNMP_TRAP: + case VES_EVENTS: + case OrchestrationTemplateCandidate: + return new AbstractMap.SimpleEntry<>(new MapFilesDataStructureToDto(), + FileDataStructureDto.class); + case ServiceModel: + case NetworkPackage: + return new AbstractMap.SimpleEntry<>(new EchoMapMapping(), HashMap.class); + case itemVersion: + return new AbstractMap.SimpleEntry<>(new EchoMapMapping(), HashMap.class); + } + throw new RuntimeException("Get conflict does not support element type: " + type.name()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapDtoToConflictResolution.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapDtoToConflictResolution.java new file mode 100644 index 0000000000..1a03a6b15e --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapDtoToConflictResolution.java @@ -0,0 +1,15 @@ +package org.openecomp.sdcrests.conflict.rest.mapping; + +import org.openecomp.conflicts.types.ConflictResolution; +import org.openecomp.sdcrests.conflict.types.ConflictResolutionDto; +import org.openecomp.sdcrests.mapping.MappingBase; + +public class MapDtoToConflictResolution + extends MappingBase { + + @Override + public void doMapping(ConflictResolutionDto source, ConflictResolution target) { + target.setResolution(source.getResolution()); + target.setOtherResolution(source.getOtherResolution()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapItemVersionConflictToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapItemVersionConflictToDto.java new file mode 100644 index 0000000000..fb5d013aba --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapItemVersionConflictToDto.java @@ -0,0 +1,22 @@ +package org.openecomp.sdcrests.conflict.rest.mapping; + + +import org.openecomp.conflicts.types.ItemVersionConflict; +import org.openecomp.sdcrests.conflict.types.ConflictDto; +import org.openecomp.sdcrests.conflict.types.ConflictInfoDto; +import org.openecomp.sdcrests.conflict.types.ItemVersionConflictDto; +import org.openecomp.sdcrests.mapping.MappingBase; + +public class MapItemVersionConflictToDto + extends MappingBase { + + @Override + public void doMapping(ItemVersionConflict source, ItemVersionConflictDto target) { + target + .setConflict(new MapConflictToDto().applyMapping(source.getVersionConflict(), ConflictDto.class)); + + MapConflictInfoToDto conflictInfoMapper = new MapConflictInfoToDto(); + source.getElementConflicts().forEach(conflictInfo -> target + .addConflictInfo(conflictInfoMapper.applyMapping(conflictInfo, ConflictInfoDto.class))); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/services/ConflictsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/services/ConflictsImpl.java new file mode 100644 index 0000000000..fda12ef4c6 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/services/ConflictsImpl.java @@ -0,0 +1,62 @@ +package org.openecomp.sdcrests.conflict.rest.services; + +import org.openecomp.conflicts.types.Conflict; +import org.openecomp.conflicts.types.ConflictResolution; +import org.openecomp.conflicts.types.ItemVersionConflict; +import org.openecomp.sdc.conflicts.ConflictsManager; +import org.openecomp.sdc.conflicts.ConflictsManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.conflict.rest.Conflicts; +import org.openecomp.sdcrests.conflict.rest.mapping.MapConflictToDto; +import org.openecomp.sdcrests.conflict.rest.mapping.MapDtoToConflictResolution; +import org.openecomp.sdcrests.conflict.rest.mapping.MapItemVersionConflictToDto; +import org.openecomp.sdcrests.conflict.types.ConflictDto; +import org.openecomp.sdcrests.conflict.types.ConflictResolutionDto; +import org.openecomp.sdcrests.conflict.types.ItemVersionConflictDto; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("conflicts") +@Scope(value = "prototype") +public class ConflictsImpl implements Conflicts { + + @Override + public Response getConflict(String itemId, String versionId, String user) { + + ConflictsManager conflictsManager = ConflictsManagerFactory.getInstance().createInterface(); + ItemVersionConflict itemVersionConflict = conflictsManager.getConflict + (itemId, new Version(versionId)); + ItemVersionConflictDto result = (new MapItemVersionConflictToDto()).applyMapping + (itemVersionConflict, ItemVersionConflictDto.class); + return Response.ok(result).build(); + } + + @Override + public Response getConflict(String itemId, String versionId, String conflictId, String user) { + ConflictsManager conflictsManager = ConflictsManagerFactory.getInstance().createInterface(); + Conflict conflict = conflictsManager.getConflict(itemId, new Version(versionId), conflictId); + + ConflictDto result = new MapConflictToDto().applyMapping(conflict, ConflictDto.class); + + return Response.ok(result).build(); + + } + + @Override + public Response resolveConflict(ConflictResolutionDto conflictResolution, String itemId, + String versionId, String conflictId, String user) { + ConflictsManager conflictsManager = ConflictsManagerFactory.getInstance().createInterface(); + + Version version = new Version(versionId); + conflictsManager.resolveConflict(itemId, version, conflictId, + new MapDtoToConflictResolution() + .applyMapping(conflictResolution, ConflictResolution.class)); + conflictsManager.finalizeMerge(itemId, version); + + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/pom.xml new file mode 100644 index 0000000000..e0169332c8 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + + org.openecomp.sdc + conflict-rest + 1.2.0-SNAPSHOT + + + conflict-rest-types + + + + org.openecomp.sdc + openecomp-sdc-conflict-manager + ${project.version} + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictDto.java new file mode 100644 index 0000000000..47f0abd794 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictDto.java @@ -0,0 +1,24 @@ +package org.openecomp.sdcrests.conflict.types; + +import java.util.Map; + +public class ConflictDto extends ConflictInfoDto { + private Map yours; + private Map theirs; + + public Map getYours() { + return yours; + } + + public void setYours(Map yours) { + this.yours = yours; + } + + public Map getTheirs() { + return theirs; + } + + public void setTheirs(Map theirs) { + this.theirs = theirs; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictInfoDto.java new file mode 100644 index 0000000000..e2e842a74e --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictInfoDto.java @@ -0,0 +1,33 @@ +package org.openecomp.sdcrests.conflict.types; + +import org.openecomp.sdc.datatypes.model.ElementType; + +public class ConflictInfoDto { + private String id; + private ElementType type; + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ElementType getType() { + return type; + } + + public void setType(ElementType type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictResolutionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictResolutionDto.java new file mode 100644 index 0000000000..1aaf18f859 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictResolutionDto.java @@ -0,0 +1,27 @@ +package org.openecomp.sdcrests.conflict.types; + +import org.openecomp.conflicts.types.Resolution; + +import java.util.Map; + +public class ConflictResolutionDto { + private Resolution resolution; + // sits in lower level... + private Map otherResolution; + + public Resolution getResolution() { + return resolution; + } + + public void setResolution(Resolution resolution) { + this.resolution = resolution; + } + + public Map getOtherResolution() { + return otherResolution; + } + + public void setOtherResolution(Map otherResolution) { + this.otherResolution = otherResolution; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ItemVersionConflictDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ItemVersionConflictDto.java new file mode 100644 index 0000000000..3dbfcf03cf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ItemVersionConflictDto.java @@ -0,0 +1,29 @@ +package org.openecomp.sdcrests.conflict.types; + +import java.util.ArrayList; +import java.util.Collection; + +public class ItemVersionConflictDto{ + private ConflictDto conflict; + private Collection conflictInfoList = new ArrayList<>(); + + public ConflictDto getConflict() { + return conflict; + } + + public void setConflict(ConflictDto conflict) { + this.conflict = conflict; + } + + public Collection getConflictInfoList() { + return conflictInfoList; + } + + public void setConflictInfoList(Collection conflictInfoList) { + this.conflictInfoList = conflictInfoList; + } + + public void addConflictInfo(ConflictInfoDto conflictInfo){ + conflictInfoList.add(conflictInfo); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/pom.xml new file mode 100644 index 0000000000..d29b22a680 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-conflict-manager + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.2.0-SNAPSHOT + + + conflict-rest + + pom + + + + conflict-rest-services + conflict-rest-types + + + \ No newline at end of file -- cgit 1.2.3-korg