aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-07-29 16:13:45 +0300
committerMichael Lando <ml636r@att.com>2018-07-29 16:20:34 +0300
commit5b593496b8f1b8e8be8d7d2dbcc223332e65a49b (patch)
tree2f9dfc45191e723da69cf74be7829784e9741b94 /openecomp-be/api/openecomp-sdc-rest-webapp/item-rest
parent9200382f2ce7b4bb729aa287d0878004b2d2b4f9 (diff)
re base code
Change-Id: I12a5ca14a6d8a87e9316b9ff362eb131105f98a5 Issue-ID: SDC-1566 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/item-rest')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java15
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/CatalogNotifier.java31
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/ItemsImpl.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java46
4 files changed, 38 insertions, 89 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java
index 7d7b0854d9..be83a5297b 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java
@@ -3,22 +3,11 @@ package org.openecomp.sdcrests.item.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import org.openecomp.sdcrests.item.types.ActivityLogDto;
-import org.openecomp.sdcrests.item.types.RevisionDto;
-import org.openecomp.sdcrests.item.types.VersionActionRequestDto;
-import org.openecomp.sdcrests.item.types.VersionDto;
-import org.openecomp.sdcrests.item.types.VersionRequestDto;
+import org.openecomp.sdcrests.item.types.*;
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.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/CatalogNotifier.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/CatalogNotifier.java
index 4f2b7aed63..deced74e3c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/CatalogNotifier.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/CatalogNotifier.java
@@ -16,21 +16,6 @@
package org.openecomp.sdcrests.item.rest.services;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Function;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
@@ -45,6 +30,22 @@ import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.logging.api.LoggingContext;
import org.openecomp.sdcrests.item.types.ItemAction;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+
class CatalogNotifier {
private static final Logger LOGGER = LoggerFactory.getLogger(CatalogNotifier.class);
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/ItemsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/ItemsImpl.java
index afdac0ad61..eae8e4220e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/ItemsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/ItemsImpl.java
@@ -16,27 +16,6 @@
package org.openecomp.sdcrests.item.rest.services;
-import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_ID;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_NAME;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-import javax.annotation.PostConstruct;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import org.openecomp.sdc.activitylog.ActivityLogManager;
-import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
import org.openecomp.sdc.activitylog.dao.type.ActivityType;
import org.openecomp.sdc.datatypes.model.ItemType;
import org.openecomp.sdc.itempermissions.PermissionsManager;
@@ -66,6 +45,16 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
+import javax.annotation.PostConstruct;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+import java.util.*;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_NAME;
@Named
@Service("items")
@@ -75,7 +64,6 @@ public class ItemsImpl implements Items {
private ItemManager itemManager = ItemManagerFactory.getInstance().createInterface();
- private static ActivityLogManager activityLogManager = ActivityLogManagerFactory.getInstance().createInterface();
private VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface();
@@ -212,9 +200,6 @@ public class ItemsImpl implements Items {
private void execute(Item item, String user) {
notifyUsers(item.getId(), item.getName(), user, this.notificationType);
- activityLogManager.logActivity(
- new ActivityLogEntity(item.getId(), getLatestVersion(item.getId()), this.activityType, user, true,
- "", ""));
}
private void notifyUsers(String itemId, String itemName, String userName, NotificationEventTypes eventType) {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java
index 496db14e53..fd46e7f274 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java
@@ -16,22 +16,6 @@
package org.openecomp.sdcrests.item.rest.services;
-import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_ID;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_NAME;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.SUBMIT_DESCRIPTION;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_ID;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_NAME;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import org.openecomp.sdc.activitylog.ActivityLogManager;
-import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.activitylog.dao.type.ActivityType;
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.Messages;
import org.openecomp.sdc.conflicts.ConflictsManager;
@@ -57,17 +41,20 @@ import org.openecomp.sdcrests.item.rest.Versions;
import org.openecomp.sdcrests.item.rest.mapping.MapActivityLogEntityToDto;
import org.openecomp.sdcrests.item.rest.mapping.MapRevisionToDto;
import org.openecomp.sdcrests.item.rest.mapping.MapVersionToDto;
-import org.openecomp.sdcrests.item.types.ActivityLogDto;
-import org.openecomp.sdcrests.item.types.CommitRequestDto;
-import org.openecomp.sdcrests.item.types.RevisionDto;
-import org.openecomp.sdcrests.item.types.RevisionRequestDto;
-import org.openecomp.sdcrests.item.types.VersionActionRequestDto;
-import org.openecomp.sdcrests.item.types.VersionDto;
-import org.openecomp.sdcrests.item.types.VersionRequestDto;
+import org.openecomp.sdcrests.item.types.*;
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.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.*;
+
@Named
@Service("versions")
@Scope(value = "prototype")
@@ -84,8 +71,6 @@ public class VersionsImpl implements Versions {
VersioningManagerFactory.getInstance().createInterface();
private ConflictsManager conflictsManager =
ConflictsManagerFactory.getInstance().createInterface();
- private ActivityLogManager activityLogManager =
- ActivityLogManagerFactory.getInstance().createInterface();
private NotificationPropagationManager notifier =
NotificationPropagationManagerFactory.getInstance().createInterface();
@@ -111,9 +96,6 @@ public class VersionsImpl implements Versions {
VersionDto versionDto = new MapVersionToDto().applyMapping(version, VersionDto.class);
- activityLogManager.logActivity(new ActivityLogEntity(itemId, version,
- ActivityType.Create_Version, user, true, "", ""));
-
return Response.ok(versionDto).build();
}
@@ -128,11 +110,6 @@ public class VersionsImpl implements Versions {
public Response getActivityLog(String itemId, String versionId, String user) {
GenericCollectionWrapper<ActivityLogDto> results = new GenericCollectionWrapper<>();
MapActivityLogEntityToDto mapper = new MapActivityLogEntityToDto();
-
- activityLogManager.listLoggedActivities(itemId, new Version(versionId))
- .forEach(loggedActivity -> results
- .add(mapper.applyMapping(loggedActivity, ActivityLogDto.class)));
-
return Response.ok(results).build();
}
@@ -196,9 +173,6 @@ public class VersionsImpl implements Versions {
versioningManager.publish(itemId, version, message);
notifyUsers(itemId, version, message, user, NotificationEventTypes.COMMIT);
-
- activityLogManager.logActivity(new ActivityLogEntity(itemId, version,
- ActivityType.Commit, user, true, "", message));
}
private void revert(RevisionRequestDto request, String itemId, String versionId) {