aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-03-22 15:33:06 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-24 06:59:47 +0000
commitd378c37fbd1ecec7b43394926f1ca32a695e07de (patch)
tree5c8a085f8732f980d871d966ac49361644efa698 /openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core
parenta6ae7294ecd336d7e88f915710b08e2658eaee00 (diff)
Reformat openecomp-be
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3449 Change-Id: I13e02322f8e00820cc5a1d85752caaeda9bf10d1
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core')
-rw-r--r--openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java58
-rw-r--r--openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java11
2 files changed, 33 insertions, 36 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java
index e6dd5a6d3b..0eae247869 100644
--- a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java
@@ -21,48 +21,44 @@ import com.datastax.driver.mapping.MappingManager;
import com.datastax.driver.mapping.Result;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
+import java.util.Collection;
import org.openecomp.core.dao.impl.CassandraBaseDao;
import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
import org.openecomp.sdc.activitylog.dao.ActivityLogDao;
import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
import org.openecomp.sdc.activitylog.dao.type.ActivityType;
-import java.util.Collection;
-
-public class ActivityLogDaoCassandraImpl extends CassandraBaseDao<ActivityLogEntity>
- implements ActivityLogDao {
-
- private static final Mapper<ActivityLogEntity> mapper;
- private static final ActivityLogAccessor accessor;
+public class ActivityLogDaoCassandraImpl extends CassandraBaseDao<ActivityLogEntity> implements ActivityLogDao {
- static {
- MappingManager mappingManager = NoSqlDbFactory.getInstance().createInterface().getMappingManager();
- mappingManager.getSession().getCluster().getConfiguration().getCodecRegistry()
- .register(new EnumNameCodec<>(ActivityType.class));
+ private static final Mapper<ActivityLogEntity> mapper;
+ private static final ActivityLogAccessor accessor;
- mapper = mappingManager.mapper(ActivityLogEntity.class);
- accessor = mappingManager.createAccessor(ActivityLogAccessor.class);
- }
+ static {
+ MappingManager mappingManager = NoSqlDbFactory.getInstance().createInterface().getMappingManager();
+ mappingManager.getSession().getCluster().getConfiguration().getCodecRegistry().register(new EnumNameCodec<>(ActivityType.class));
+ mapper = mappingManager.mapper(ActivityLogEntity.class);
+ accessor = mappingManager.createAccessor(ActivityLogAccessor.class);
+ }
- @Override
- protected Mapper<ActivityLogEntity> getMapper() {
- return mapper;
- }
+ @Override
+ protected Mapper<ActivityLogEntity> getMapper() {
+ return mapper;
+ }
- @Override
- protected Object[] getKeys(ActivityLogEntity entity) {
- return new Object[]{entity.getItemId(), entity.getVersionId(), entity.getId()};
- }
+ @Override
+ protected Object[] getKeys(ActivityLogEntity entity) {
+ return new Object[]{entity.getItemId(), entity.getVersionId(), entity.getId()};
+ }
- @Override
- public Collection<ActivityLogEntity> list(ActivityLogEntity entity) {
- return accessor.listByItemVersion(entity.getItemId(), entity.getVersionId()).all();
- }
+ @Override
+ public Collection<ActivityLogEntity> list(ActivityLogEntity entity) {
+ return accessor.listByItemVersion(entity.getItemId(), entity.getVersionId()).all();
+ }
- @Accessor
- interface ActivityLogAccessor {
+ @Accessor
+ interface ActivityLogAccessor {
- @Query("select * from activity_log where item_id=? and version_id=?")
- Result<ActivityLogEntity> listByItemVersion(String itemId, String versionId);
- }
+ @Query("select * from activity_log where item_id=? and version_id=?")
+ Result<ActivityLogEntity> listByItemVersion(String itemId, String versionId);
+ }
}
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java
index 02c8a71b0e..0da29828e2 100644
--- a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java
@@ -19,10 +19,11 @@ import org.openecomp.sdc.activitylog.dao.ActivityLogDao;
import org.openecomp.sdc.activitylog.dao.ActivityLogDaoFactory;
public class ActivityLogDaoFactoryImpl extends ActivityLogDaoFactory {
- private static final ActivityLogDao INSTANCE = new ActivityLogDaoCassandraImpl();
- @Override
- public ActivityLogDao createInterface() {
- return INSTANCE;
- }
+ private static final ActivityLogDao INSTANCE = new ActivityLogDaoCassandraImpl();
+
+ @Override
+ public ActivityLogDao createInterface() {
+ return INSTANCE;
+ }
}