package org.openecomp.sdcrests.action.rest.services;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_NAME;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_SUPPORTED_MODELS;
+import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_FILE;
+import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_NAME;
+import static org.openecomp.sdc.action.ActionConstants.BE_FQDN;
+import static org.openecomp.sdc.action.ActionConstants.CATEGORY_LOG_LEVEL;
+import static org.openecomp.sdc.action.ActionConstants.CLIENT_IP;
+import static org.openecomp.sdc.action.ActionConstants.ERROR_DESCRIPTION;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_OPEN_ECOMP_COMPONENT;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR;
+import static org.openecomp.sdc.action.ActionConstants.INSTANCE_UUID;
+import static org.openecomp.sdc.action.ActionConstants.LOCAL_ADDR;
+import static org.openecomp.sdc.action.ActionConstants.MAX_ACTION_ARTIFACT_SIZE;
+import static org.openecomp.sdc.action.ActionConstants.MDC_ASDC_INSTANCE_UUID;
+import static org.openecomp.sdc.action.ActionConstants.PARTNER_NAME;
+import static org.openecomp.sdc.action.ActionConstants.REMOTE_HOST;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_EMPTY_BODY;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_ID;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_CREATE_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_UPDATE_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_VERSION_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_INSTANCE_ID;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_METRIC_BEGIN_TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.STATUS;
+import static org.openecomp.sdc.action.ActionConstants.STATUS_CODE;
+import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_COMPONENTS_ID;
+import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_MODELS_VERSION_ID;
+import static org.openecomp.sdc.action.ActionConstants.TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.UPDATED_BY;
+import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_INSTANCE_ID_HEADER_PARAM;
+import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_REQUEST_ID_HEADER_PARAM;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_READ_FILE_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_PARAM_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_BODY_EMPTY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_CONTENT_TYPE_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_FILTER_PARAM_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_MISSING_MANDATORY_PARAM;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_OPEN_ECOMP_INSTANCE_ID_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_OPEN_ECOMP_REQUEST_ID_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNSUPPORTED_OPERATION;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE;
+import static org.openecomp.sdc.action.util.ActionUtil.actionErrorLogProcessor;
+import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor;
+import static org.openecomp.sdc.action.util.ActionUtil.getUtcDateStringFromTimestamp;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.openecomp.sdc.action.errors.ActionException;
import org.openecomp.sdc.action.logging.CategoryLogLevel;
import org.openecomp.sdc.action.logging.StatusCode;
-import org.openecomp.sdc.action.types.*;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.ActionArtifactProtection;
+import org.openecomp.sdc.action.types.ActionRequest;
+import org.openecomp.sdc.action.types.OpenEcompComponent;
import org.openecomp.sdc.logging.api.Logger;
import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdcrests.action.rest.Actions;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
-
-import static org.openecomp.sdc.action.ActionConstants.*;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.*;
-import static org.openecomp.sdc.action.util.ActionUtil.*;
/**
* Implements various CRUD API that can be performed on Action
if(action.getSupportedComponents() != null && !isIDPresentInMap(action
.getSupportedComponents(), SUPPORTED_COMPONENTS_ID)){
setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE,
- ACTION_REQUEST_PARAM_SUPPORTED_MODELS, requestBodyErrorMap);
+ ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS, requestBodyErrorMap);
}
if(action.getArtifacts() != null){
setErrorValue(ACTION_UPDATE_NOT_ALLOWED_CODE,
/**
* Returns true if given key exists in List of HashMap
*/
- private boolean isIDPresentInMap(List<HashMap<String, String>> map, String idName) {
+ private boolean isIDPresentInMap(List<Map<String, String>> map, String idName) {
if (map != null && !map.isEmpty()) {
- for (HashMap<String, String> entry : map) {
+ for (Map<String, String> entry : map) {
if (StringUtils.isEmpty(entry.get(idName))) {
return false;
}
-/*-
- * ============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=========================================================
- */
+/*
+* Copyright © 2016-2018 European Support Limited
+*
+* 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.
+*/
package org.openecomp.sdc.action.dao.types;
import com.datastax.driver.mapping.annotations.Frozen;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.action.types.Action;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import java.util.ArrayList;
import java.util.Date;
-import java.util.List;
+import java.util.Set;
import java.util.stream.Collectors;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
@Table(keyspace = "dox", name = "Action")
public class ActionEntity {
@Column(name = "name")
private String name;
@Column(name = "vendor_list")
- private List<String> vendorList;
+ private Set<String> vendorList;
@Column(name = "category_list")
- private List<String> categoryList;
+ private Set<String> categoryList;
@Column(name = "timestamp")
private Date timestamp;
@Column(name = "user")
private String user;
@Column(name = "supportedModels")
- private List<String> supportedModels;
+ private Set<String> supportedModels;
@Column(name = "supportedComponents")
- private List<String> supportedComponents;
+ private Set<String> supportedComponents;
@Column(name = "data")
private String data;
this.name = name;
}
- public List<String> getVendorList() {
+ public Set<String> getVendorList() {
return vendorList;
}
*
* @param vendorList the vendor list
*/
- public void setVendorList(List<String> vendorList) {
- if (vendorList != null && !vendorList.isEmpty()) {
- List<String> lowerCaseVendorList = new ArrayList<>();
- lowerCaseVendorList
- .addAll(vendorList.stream().map(String::toLowerCase).collect(Collectors.toList()));
- this.vendorList = lowerCaseVendorList;
- } else {
- this.vendorList = vendorList;
- }
- }
-
- public List<String> getCategoryList() {
+ public void setVendorList(Set<String> vendorList) {
+ this.vendorList = vendorList != null && !vendorList.isEmpty() ?
+ vendorList.stream().map(String::toLowerCase).collect(Collectors.toSet()) : vendorList;
+ }
+
+ public Set<String> getCategoryList() {
return categoryList;
}
*
* @param categoryList the category list
*/
- public void setCategoryList(List<String> categoryList) {
- if (categoryList != null && !categoryList.isEmpty()) {
- List<String> lowerCaseCategoryList = new ArrayList<>();
- lowerCaseCategoryList
- .addAll(categoryList.stream().map(String::toLowerCase).collect(Collectors.toList()));
- this.categoryList = lowerCaseCategoryList;
- } else {
- this.categoryList = categoryList;
- }
+ public void setCategoryList(Set<String> categoryList) {
+ this.categoryList = categoryList != null && !categoryList.isEmpty() ?
+ categoryList.stream().map(String::toLowerCase).collect(Collectors.toSet()) :
+ categoryList;
}
public Date getTimestamp() {
this.user = user;
}
- public List<String> getSupportedModels() {
+ public Set<String> getSupportedModels() {
return supportedModels;
}
- public void setSupportedModels(List<String> supportedModels) {
+ public void setSupportedModels(Set<String> supportedModels) {
this.supportedModels = supportedModels;
}
- public List<String> getSupportedComponents() {
+ public Set<String> getSupportedComponents() {
return supportedComponents;
}
- public void setSupportedComponents(List<String> supportedComponents) {
+ public void setSupportedComponents(Set<String> supportedComponents) {
this.supportedComponents = supportedComponents;
}
-/*-
- * ============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=========================================================
- */
+/*
+* Copyright © 2016-2018 European Support Limited
+*
+* 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.
+*/
+
package org.openecomp.sdc.action.types;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
import org.openecomp.sdc.action.ActionConstants;
import org.openecomp.sdc.action.dao.types.ActionEntity;
import org.openecomp.sdc.versioning.dao.types.Version;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
public class Action implements Comparable {
private String actionUuId;
private String actionInvariantUuId;
private List<String> categoryList;
private Date timestamp;
private String user;
- private List<HashMap<String, String>> supportedModels;
- private List<HashMap<String, String>> supportedComponents;
+ private List<Map<String, String>> supportedModels;
+ private List<Map<String, String>> supportedComponents;
//private List<HashMap<String,String>> artifacts;
private List<ActionArtifact> artifacts;
private String data;
this.user = user;
}
- public List<HashMap<String, String>> getSupportedModels() {
+ public List<Map<String, String>> getSupportedModels() {
return supportedModels;
}
- public void setSupportedModels(List<HashMap<String, String>> supportedModels) {
+ public void setSupportedModels(List<Map<String, String>> supportedModels) {
this.supportedModels = supportedModels;
}
- public List<HashMap<String, String>> getSupportedComponents() {
+ public List<Map<String, String>> getSupportedComponents() {
return supportedComponents;
}
- public void setSupportedComponents(List<HashMap<String, String>> supportedComponents) {
+ public void setSupportedComponents(List<Map<String, String>> supportedComponents) {
this.supportedComponents = supportedComponents;
}
destination.setActionInvariantUuId(
this.getActionInvariantUuId() != null ? this.getActionInvariantUuId().toUpperCase() : null);
destination.setName(this.getName() != null ? this.getName().toLowerCase() : null);
- destination.setVendorList(this.getVendorList());
- destination.setCategoryList(this.getCategoryList());
+ if (Objects.nonNull(this.getVendorList())) {
+ destination.setVendorList(new HashSet<>(this.getVendorList()));
+ }
+ if (Objects.nonNull(this.getCategoryList())) {
+ destination.setCategoryList(new HashSet<>(this.getCategoryList()));
+ }
destination.setTimestamp(this.getTimestamp());
destination.setUser(this.getUser());
destination.setVersion(Version.valueOf(this.getVersion()));
return destination;
}
- private List<String> getIdFromMap(List<HashMap<String, String>> map, String idName) {
- List<String> list = new ArrayList<>();
+ private Set<String> getIdFromMap(List<Map<String, String>> map, String idName) {
+ Set<String> list = new HashSet<>();
if (map != null && !map.isEmpty()) {
- for (HashMap<String, String> entry : map) {
+ for (Map<String, String> entry : map) {
if (entry.containsKey(idName)) {
list.add(entry.get(idName) != null ? entry.get(idName).toLowerCase() : null);
}
package org.openecomp.sdc.action.dao.impl;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.in;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.set;
+import static org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory.getSession;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_OPEN_ECOMP_COMPONENT;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR;
+import static org.openecomp.sdc.action.ActionConstants.STATUS;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_MSG;
+
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Statement;
import com.datastax.driver.mapping.Result;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
import org.openecomp.core.dao.impl.CassandraBaseDao;
import org.openecomp.core.nosqldb.api.NoSqlDb;
import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
import org.slf4j.MDC;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import static com.datastax.driver.core.querybuilder.QueryBuilder.*;
-import static org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory.getSession;
-import static org.openecomp.sdc.action.ActionConstants.*;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.*;
-
public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements ActionDao {
private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID,
TARGET_ENTITY_DB);
Result<ActionEntity> result =
- accessor.getActionsByInvId(actionInvariantUuId, viewableVersions);
+ accessor.getActionsByInvId(actionInvariantUuId, new ArrayList<>(viewableVersions));
ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
log.metrics("");
if (result != null) {
versions.add(versionInfoEntity.getCandidate().getVersion());
ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID,
TARGET_ENTITY_DB);
- Result<ActionEntity> result = accessor.getActionsByInvId(actionInvariantUuId, versions);
+ Result<ActionEntity> result = accessor.getActionsByInvId(actionInvariantUuId, new ArrayList<>(versions));
ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
log.metrics("");
if (result != null) {
Result<ActionEntity> getAllActions();
@Query("SELECT * FROM Action where actionInvariantUuId = ? and version in ? ")
- Result<ActionEntity> getActionsByInvId(String actionInvariantUuId, Set<Version> versions);
+ Result<ActionEntity> getActionsByInvId(String actionInvariantUuId, List<Version> versions);
@Query("SELECT * FROM Action where supportedModels CONTAINS ?")
Result<ActionEntity> getActionsByModel(String resource);
</parent>
<dependencies>
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-extras</artifactId>
+ <version>${datastax.cassandra.version}</version>
+ </dependency>
<dependency>
<groupId>org.openecomp.sdc.core</groupId>
<artifactId>openecomp-session-lib</artifactId>
package org.openecomp.sdc.versioning.dao.impl;
+import com.datastax.driver.extras.codecs.enums.EnumNameCodec;
import com.datastax.driver.mapping.Mapper;
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.api.NoSqlDb;
import org.openecomp.sdc.versioning.dao.VersionInfoDao;
import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import java.util.Collection;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
public class VersionInfoDaoImpl extends CassandraBaseDao<VersionInfoEntity>
implements VersionInfoDao {
this.noSqlDb = noSqlDb;
this.mapper = this.noSqlDb.getMappingManager().mapper(VersionInfoEntity.class);
this.accessor = this.noSqlDb.getMappingManager().createAccessor(VersionInfoAccessor.class);
+ this.noSqlDb.getMappingManager().getSession().getCluster().getConfiguration().getCodecRegistry()
+ .register(new EnumNameCodec<>(VersionStatus.class));
}
@Override