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/backend/openecomp-sdc-activity-log-manager/src | |
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/backend/openecomp-sdc-activity-log-manager/src')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManager.java (renamed from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java) | 8 | ||||
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManagerFactory.java (renamed from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java) | 3 | ||||
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java (renamed from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerFactoryImpl.java) | 17 | ||||
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImpl.java (renamed from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerImpl.java) | 39 | ||||
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json | 2 |
5 files changed, 35 insertions, 34 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManager.java index a40e1018d7..06de3e11b6 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManager.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.openecomp.sdc.activityLog; +package org.openecomp.sdc.activitylog; import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; import org.openecomp.sdc.versioning.dao.types.Version; @@ -26,6 +26,8 @@ import org.openecomp.sdc.versioning.dao.types.Version; import java.util.Collection; public interface ActivityLogManager { - void addActionLog(ActivityLogEntity activityLogEntity, String user); - Collection<ActivityLogEntity> listActivityLogs(String itemId, Version versionId, String user); + + void logActivity(ActivityLogEntity activityLogEntity); + + Collection<ActivityLogEntity> listLoggedActivities(String itemId, Version versionId); } diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManagerFactory.java index 9816b76486..93010f6560 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManagerFactory.java @@ -17,11 +17,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.openecomp.sdc.activityLog; +package org.openecomp.sdc.activitylog; import org.openecomp.core.factory.api.AbstractComponentFactory; import org.openecomp.core.factory.api.AbstractFactory; -import org.openecomp.sdc.activityLog.ActivityLogManager; public abstract class ActivityLogManagerFactory extends AbstractComponentFactory<ActivityLogManager> { diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java index 491192470d..5dc7f849fc 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerFactoryImpl.java +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java @@ -17,17 +17,18 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.openecomp.sdc.activityLog.impl; +package org.openecomp.sdc.activitylog.impl; -import org.openecomp.sdc.activityLog.ActivityLogManager; -import org.openecomp.sdc.activityLog.ActivityLogManagerFactory; +import org.openecomp.sdc.activitylog.ActivityLogManager; +import org.openecomp.sdc.activitylog.ActivityLogManagerFactory; import org.openecomp.sdc.activitylog.dao.ActivityLogDaoFactory; public class ActivityLogManagerFactoryImpl extends ActivityLogManagerFactory { - private static final ActivityLogManager INSTANCE = new ActivityLogManagerImpl( - ActivityLogDaoFactory.getInstance().createInterface() - ); + private static final ActivityLogManager INSTANCE = + new ActivityLogManagerImpl(ActivityLogDaoFactory.getInstance().createInterface()); - @Override - public ActivityLogManager createInterface() {return INSTANCE;} + @Override + public ActivityLogManager createInterface() { + return INSTANCE; + } } diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerImpl.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImpl.java index 324af2095a..711fd68a8e 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImpl.java @@ -18,36 +18,35 @@ * ============LICENSE_END========================================================= */ -package org.openecomp.sdc.activityLog.impl; +package org.openecomp.sdc.activitylog.impl; import org.openecomp.core.utilities.CommonMethods; -import org.openecomp.sdc.activityLog.ActivityLogManager; +import org.openecomp.sdc.activitylog.ActivityLogManager; import org.openecomp.sdc.activitylog.dao.ActivityLogDao; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; +import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.versioning.dao.types.Version; import java.util.Collection; public class ActivityLogManagerImpl implements ActivityLogManager { - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - private ActivityLogDao activityLogDao; + private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private ActivityLogDao activityLogDao; - public ActivityLogManagerImpl(ActivityLogDao activityLogDao) { - this.activityLogDao = activityLogDao; - } + public ActivityLogManagerImpl(ActivityLogDao activityLogDao) { + this.activityLogDao = activityLogDao; + } - @Override - public void addActionLog(ActivityLogEntity activityLogEntity, String user) { - mdcDataDebugMessage.debugEntryMessage("ITEM id", activityLogEntity.getItemId()); - activityLogEntity.setId(CommonMethods.nextUuId()); - activityLogDao.create(activityLogEntity); - } + @Override + public void logActivity(ActivityLogEntity activityLogEntity) { + mdcDataDebugMessage.debugEntryMessage("ITEM id", activityLogEntity.getItemId()); + activityLogEntity.setId(CommonMethods.nextUuId()); + activityLogDao.create(activityLogEntity); + } - @Override - public Collection<ActivityLogEntity> listActivityLogs(String itemId, Version version, String user) { - mdcDataDebugMessage.debugEntryMessage("ITEM id", itemId); - String versionId = version.getMinor() == 0 ? String.valueOf(version.getMajor()) : String.valueOf(version.getMajor()+1); - return activityLogDao.getActivityLogListForItem(itemId, versionId); - } + @Override + public Collection<ActivityLogEntity> listLoggedActivities(String itemId, Version version) { + mdcDataDebugMessage.debugEntryMessage("ITEM id", itemId); + return activityLogDao.list(new ActivityLogEntity(itemId, version)); + } } diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json index b4e151d16b..e4d3dab0f0 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json @@ -1,3 +1,3 @@ { - "org.openecomp.sdc.activityLog.ActivityLogManagerFactory": "org.openecomp.sdc.activityLog.impl.ActivityLogManagerFactoryImpl" + "org.openecomp.sdc.activitylog.ActivityLogManagerFactory": "org.openecomp.sdc.activitylog.impl.ActivityLogManagerFactoryImpl" }
\ No newline at end of file |