import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ArtifactsOperations;
import org.openecomp.sdc.be.model.jsonjanusgraph.operations.InterfaceOperation;
-import org.openecomp.sdc.be.model.operations.api.IAdditionalInformationOperation;
import org.openecomp.sdc.be.model.operations.api.IElementOperation;
import org.openecomp.sdc.be.model.operations.api.IGroupInstanceOperation;
import org.openecomp.sdc.be.model.operations.api.IGroupOperation;
import org.openecomp.sdc.be.model.operations.api.IGroupTypeOperation;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
+import org.openecomp.sdc.be.model.operations.impl.AdditionalInformationOperation;
import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter;
import org.openecomp.sdc.be.model.operations.impl.InterfaceLifecycleOperation;
import org.openecomp.sdc.be.model.operations.utils.ComponentValidationUtils;
private static final Logger log = Logger.getLogger(AdditionalInformationBusinessLogic.class.getName());
private static final String FAILED_TO_LOCK_COMPONENT_ERROR = "Failed to lock component {} error - {}";
- private final IAdditionalInformationOperation additionalInformationOperation;
+ private final AdditionalInformationOperation additionalInformationOperation;
@Autowired
public AdditionalInformationBusinessLogic(IElementOperation elementDao,
IGroupTypeOperation groupTypeOperation,
InterfaceOperation interfaceOperation,
InterfaceLifecycleOperation interfaceLifecycleTypeOperation,
- IAdditionalInformationOperation additionalInformationOperation,
+ AdditionalInformationOperation additionalInformationOperation,
ArtifactsOperations artifactToscaOperation) {
super(elementDao, groupOperation, groupInstanceOperation, groupTypeOperation,
interfaceOperation, interfaceLifecycleTypeOperation, artifactToscaOperation);
*/
public Either<AdditionalInfoParameterInfo, ResponseFormat> createAdditionalInformation(NodeTypeEnum nodeType, String resourceId, AdditionalInfoParameterInfo additionalInfoParameterInfo, String userId) {
- validateUserExists(userId, "create Additional Information", false);
+ validateUserExists(userId);
Either<AdditionalInfoParameterInfo, ResponseFormat> result = null;
ResponseFormat responseFormat = verifyCanWorkOnComponent(nodeType, resourceId, userId);
// lock component
StorageOperationStatus lockResult = graphLockOperation.lockComponent(resourceId, nodeType);
- if (!lockResult.equals(StorageOperationStatus.OK)) {
+ if (lockResult != StorageOperationStatus.OK) {
BeEcompErrorManager.getInstance().logBeFailedLockObjectError(CREATE_ADDITIONAL_INFORMATION, nodeType.getName(), resourceId);
log.info(FAILED_TO_LOCK_COMPONENT_ERROR, resourceId, lockResult);
result = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
*/
public Either<AdditionalInfoParameterInfo, ResponseFormat> updateAdditionalInformation(NodeTypeEnum nodeType, String resourceId, AdditionalInfoParameterInfo additionalInfoParameterInfo, String userId) {
- validateUserExists(userId, "create Additional Information", false);
+ validateUserExists(userId);
Either<AdditionalInfoParameterInfo, ResponseFormat> result = null;
ResponseFormat responseFormat = verifyCanWorkOnComponent(nodeType, resourceId, userId);
}
// lock component
StorageOperationStatus lockResult = graphLockOperation.lockComponent(resourceId, nodeType);
- if (!lockResult.equals(StorageOperationStatus.OK)) {
+ if (lockResult != StorageOperationStatus.OK) {
BeEcompErrorManager.getInstance().logBeFailedLockObjectError(UPDATE_ADDITIONAL_INFORMATION, nodeType.getName(), resourceId);
log.info(FAILED_TO_LOCK_COMPONENT_ERROR, resourceId, lockResult);
result = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
*/
public Either<AdditionalInfoParameterInfo, ResponseFormat> deleteAdditionalInformation(NodeTypeEnum nodeType, String resourceId, AdditionalInfoParameterInfo additionalInfoParameterInfo, String userId) {
- validateUserExists(userId, "delete Additional Information", false);
+ validateUserExists(userId);
Either<AdditionalInfoParameterInfo, ResponseFormat> result = null;
ResponseFormat responseFormat = verifyCanWorkOnComponent(nodeType, resourceId, userId);
}
// lock component
StorageOperationStatus lockResult = graphLockOperation.lockComponent(resourceId, nodeType);
- if (!lockResult.equals(StorageOperationStatus.OK)) {
+ if (lockResult != StorageOperationStatus.OK) {
BeEcompErrorManager.getInstance().logBeFailedLockObjectError(DELETE_ADDITIONAL_INFORMATION, nodeType.getName(), resourceId);
log.info(FAILED_TO_LOCK_COMPONENT_ERROR, resourceId, lockResult);
result = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
*/
public Either<AdditionalInfoParameterInfo, ResponseFormat> getAdditionalInformation(NodeTypeEnum nodeType, String resourceId, AdditionalInfoParameterInfo additionalInfoParameterInfo, String userId) {
- validateUserExists(userId, "get Additional Information", false);
+ validateUserExists(userId);
Either<AdditionalInfoParameterInfo, ResponseFormat> result = null;
try {
*/
public Either<AdditionalInformationDefinition, ResponseFormat> getAllAdditionalInformation(NodeTypeEnum nodeType, String resourceId, String userId) {
- validateUserExists(userId, "get All Additional Information", false);
+ validateUserExists(userId);
Either<AdditionalInformationDefinition, ResponseFormat> result = null;