diff options
author | talig <talig@amdocs.com> | 2017-12-20 14:30:43 +0200 |
---|---|---|
committer | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | 2017-12-21 11:12:33 +0000 |
commit | 8e9c0653dd6c6862123c9609ae34e1206d86456e (patch) | |
tree | 5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services | |
parent | 785ebcc95de3e064e843bec04ba7a209d854fc7c (diff) |
Add collaboration feature
Issue-ID: SDC-767
Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795
Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services')
4 files changed, 0 insertions, 218 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml deleted file mode 100644 index 10685dbac0..0000000000 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>activity-log-rest-services</artifactId> - - <parent> - <groupId>org.openecomp.sdc</groupId> - <artifactId>activity-log-rest</artifactId> - <version>1.2.0-SNAPSHOT</version> - </parent> - - <dependencies> - - - <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>javax.ws.rs-api</artifactId> - <version>${ws.rs.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.framework.version}</version> - </dependency> - <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> - </dependency> - <dependency> - <groupId>org.openecomp.sdc</groupId> - <artifactId>openecomp-sdc-activity-log-manager</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.openecomp.sdc</groupId> - <artifactId>activity-log-rest-types</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.openecomp.sdc</groupId> - <artifactId>openecomp-sdc-common-rest</artifactId> - <version>${project.version}</version> - </dependency> - <!-- CXF --> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-frontend-jaxrs</artifactId> - <version>${cxf.version}</version> - </dependency> - - </dependencies> - - -</project> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/ActivityLog.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/ActivityLog.java deleted file mode 100644 index be4cc1bbf5..0000000000 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/ActivityLog.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdcrests.activitylog.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.openecomp.sdcrests.activitylog.types.ActivityLogDto; -import org.springframework.validation.annotation.Validated; - -import javax.validation.constraints.NotNull; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; -import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; - - -@Path("/v1.0/activity-logs") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -@Api(value = "Item Activity Log") -@Validated -public interface ActivityLog { - - @GET - @Path("/{itemId}/versions/{versionId}") - @ApiOperation(value = "List actions log of item", - response = ActivityLogDto.class, - responseContainer = "List") - Response getActivityLog(@ApiParam("Item Id") @PathParam("itemId") String itemId, - @ApiParam("Version Id") @PathParam("versionId") String versionId, - @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) - String user); - -} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java deleted file mode 100644 index 023dedf12c..0000000000 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdcrests.activitylog.rest.mapping; - -import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; -import org.openecomp.sdcrests.activitylog.types.ActivityLogDto; -import org.openecomp.sdcrests.activitylog.types.ActivityStatus; -import org.openecomp.sdcrests.mapping.MappingBase; - -public class MapActivityLogEntityToActivityLogDto extends MappingBase<ActivityLogEntity, ActivityLogDto> { - - - @Override - public void doMapping(ActivityLogEntity source, ActivityLogDto target) { - target.setId(source.getId()); - target.setTimestamp(source.getTimestamp()); - target.setType(source.getType()); - target.setComment(source.getComment()); - target.setUser(source.getUser()); - target.setStatus(new ActivityStatus(source.isSuccess(), source.getMessage())); - } -} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/services/ActivityLogImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/services/ActivityLogImpl.java deleted file mode 100644 index c42d72b7a5..0000000000 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/services/ActivityLogImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdcrests.activitylog.rest.services; - -import org.openecomp.sdc.activityLog.ActivityLogManager; -import org.openecomp.sdc.activityLog.ActivityLogManagerFactory; -import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; -import org.openecomp.sdc.logging.context.MdcUtil; -import org.openecomp.sdc.logging.types.LoggerServiceName; -import org.openecomp.sdc.versioning.dao.types.Version; -import org.openecomp.sdcrests.activitylog.rest.ActivityLog; -import org.openecomp.sdcrests.activitylog.rest.mapping.MapActivityLogEntityToActivityLogDto; -import org.openecomp.sdcrests.activitylog.types.ActivityLogDto; -import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Service; - -import javax.inject.Named; -import javax.ws.rs.core.Response; -import java.util.Collection; - -@Named -@Service("activityLog") -@Scope(value = "prototype") -public class ActivityLogImpl implements ActivityLog { - - private ActivityLogManager activityLogManager = - ActivityLogManagerFactory.getInstance().createInterface(); - - - @Override - public Response getActivityLog(String vspId, String versionId, String user) { - MdcUtil.initMdc(LoggerServiceName.Get_List_Activity_Log.toString()); - - Collection<ActivityLogEntity> activityLogs = - activityLogManager.listActivityLogs(vspId, Version.valueOf(versionId), user); - - MapActivityLogEntityToActivityLogDto mapper = new MapActivityLogEntityToActivityLogDto(); - GenericCollectionWrapper<ActivityLogDto> results = new GenericCollectionWrapper<>(); - for (ActivityLogEntity activityLog : activityLogs) { - results.add(mapper.applyMapping(activityLog, ActivityLogDto.class)); - } - - return Response.ok(results).build(); - } -} - |