From 2ef3886c9b0223f4813ac1385318d6f2e600a4a8 Mon Sep 17 00:00:00 2001 From: Tal Gitelman Date: Mon, 30 Apr 2018 19:06:20 +0300 Subject: Remove dead code asdctool Change-Id: I467f70b442a02a15b8a18b160309bac9a8ab3f9a Issue-ID: SDC-1270 Signed-off-by: Tal Gitelman --- .../model/operations/impl/GraphLockOperation.java | 2 - .../operations/impl/GroupInstanceOperation.java | 68 ---------------------- .../model/operations/impl/PropertyOperation.java | 31 ---------- 3 files changed, 101 deletions(-) (limited to 'catalog-model/src') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GraphLockOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GraphLockOperation.java index 776012ac43..e5a743af8f 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GraphLockOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GraphLockOperation.java @@ -50,9 +50,7 @@ public class GraphLockOperation implements IGraphLockOperation { log.info("lock resource with id {}", componentId); TitanOperationStatus lockElementStatus = null; try { - lockElementStatus = titanGenericDao.lockElement(componentId, nodeType); - } catch (Exception e) { lockElementStatus = TitanOperationStatus.ALREADY_LOCKED; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java index 662e2ecf70..3b7b5def2e 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java @@ -432,7 +432,6 @@ public class GroupInstanceOperation extends AbstractOperation implements IGroupI } - /** * update value of attribute on resource instance * @@ -661,73 +660,6 @@ public class GroupInstanceOperation extends AbstractOperation implements IGroupI } } - private Either getGroupInstanceFromGraph(String uniqueId, boolean skipProperties, boolean skipArtifacts) { - - Either result = null; - - Either groupInstRes = titanGenericDao.getNode(UniqueIdBuilder.getKeyByNodeType(NodeTypeEnum.GroupInstance), uniqueId, GroupInstanceData.class); - if (groupInstRes.isRight()) { - TitanOperationStatus status = groupInstRes.right().value(); - log.debug("Failed to retrieve group {} from graph. Status is {}", uniqueId, status); - BeEcompErrorManager.getInstance().logBeFailedRetrieveNodeError("Fetch Group", uniqueId, String.valueOf(status)); - result = Either.right(status); - return result; - } - - GroupInstanceData groupInstData = groupInstRes.left().value(); - - GroupInstance groupInstance = new GroupInstance(groupInstData.getGroupDataDefinition()); - String instOriginGroupId = groupInstance.getGroupUid(); - Either groupRes = groupOperation.getGroupFromGraph(instOriginGroupId, false, true, false); - - if (groupRes.isRight()) { - TitanOperationStatus status = groupRes.right().value(); - result = Either.right(status); - - } - GroupDefinition groupDefinition = groupRes.left().value(); - Either, TitanOperationStatus> groupInstancePropertyValuesRes = getAllGroupInstancePropertyValuesData(groupInstData); - if(groupInstancePropertyValuesRes.isRight()){ - result = Either.right(groupInstancePropertyValuesRes.right().value()); - } - buildGroupInstanceFromGroup(groupInstance, groupDefinition, groupInstancePropertyValuesRes.left().value()); - - /* - * if (false == skipProperties) { Either, TitanOperationStatus> propertiesRes = getGroupProperties(uniqueId); if (propertiesRes.isRight()) { TitanOperationStatus status = propertiesRes.right().value(); if (status != - * TitanOperationStatus.OK) { result = Either.right(status); return result; } } else { List properties = propertiesRes.left().value(); groupDefinition.setProperties(properties); } } - */ - - if (false == skipArtifacts) { - Either>, TitanOperationStatus> artifactsRes = getGroupArtifactsPairs(uniqueId); - if (artifactsRes.isRight()) { - TitanOperationStatus status = artifactsRes.right().value(); - if (status != TitanOperationStatus.OK) { - result = Either.right(status); - return result; - } - } else { - List artifactsUid = new ArrayList<>(); - List artifactsUUID = new ArrayList<>(); - - List> list = artifactsRes.left().value(); - if (list != null) { - for (ImmutablePair pair : list) { - String uid = pair.left; - String UUID = pair.right; - artifactsUid.add(uid); - artifactsUUID.add(UUID); - } - groupInstance.setGroupInstanceArtifacts(artifactsUid); - groupInstance.setGroupInstanceArtifactsUuid(artifactsUUID); - } - } - } - result = Either.left(groupInstance); - - return result; - - } - private void buildGroupInstanceFromGroup(GroupInstance groupInstance, GroupDefinition groupDefinition, Map groupInstancePropertyValues) { groupInstance.setGroupName(groupDefinition.getName()); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java index a2996ac152..f0d0b514ab 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java @@ -1297,37 +1297,6 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe } - private Either, TitanOperationStatus> findAllDataTypeDefinition(DataTypeDefinition dataTypeDefinition) { - - Map nameToDataTypeDef = new HashMap<>(); - - DataTypeDefinition typeDefinition = dataTypeDefinition; - - while (typeDefinition != null) { - - List properties = typeDefinition.getProperties(); - if (properties != null) { - for (PropertyDefinition propertyDefinition : properties) { - String type = propertyDefinition.getType(); - Either dataTypeByName = this.getDataTypeUsingName(type); - if (dataTypeByName.isRight()) { - return Either.right(dataTypeByName.right().value()); - } else { - DataTypeDefinition value = dataTypeByName.left().value(); - if (false == nameToDataTypeDef.containsKey(type)) { - nameToDataTypeDef.put(type, value); - } - } - - } - } - - typeDefinition = typeDefinition.getDerivedFrom(); - } - - return Either.left(nameToDataTypeDef); - } - public Either, TitanOperationStatus> getAllPropertiesOfResourceInstanceOnlyPropertyDefId(String resourceInstanceUid, NodeTypeEnum instanceNodeType) { Either findResInstanceRes = titanGenericDao.getVertexByProperty(UniqueIdBuilder.getKeyByNodeType(instanceNodeType), resourceInstanceUid); -- cgit 1.2.3-korg