From caf13efd0cb09e0d9c4ad09174ab34a2e57fb439 Mon Sep 17 00:00:00 2001 From: Piotr Krysiak Date: Mon, 23 Jul 2018 13:25:18 +0200 Subject: Catalog-dao dead code removal Issue-ID: SDC-1551 Change-Id: I4947b3f8219f20c543abf06798caf69035ed7aa0 Signed-off-by: Piotr Krysiak --- .../sdc/be/dao/titan/TitanGraphClient.java | 31 ++++++---------------- .../sdc/be/resources/data/CategoryData.java | 15 ----------- .../sdc/be/resources/impl/ResourceUploader.java | 27 ------------------- 3 files changed, 8 insertions(+), 65 deletions(-) (limited to 'catalog-dao/src/main') diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java index e13b0ee9c5..e50c5e6278 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java @@ -37,7 +37,8 @@ import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.DAOTitanStrategy; import org.openecomp.sdc.be.dao.TitanClientStrategy; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; -import org.openecomp.sdc.common.log.wrappers.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @@ -48,9 +49,8 @@ import java.util.concurrent.*; @Component("titan-client") public class TitanGraphClient { - - private static Logger logger = Logger.getLogger(TitanGraphClient.class.getName()); - private static Logger healthLogger = Logger.getLogger("titan.healthcheck"); + private static Logger logger = LoggerFactory.getLogger(TitanGraphClient.class.getName()); + private static Logger healthLogger = LoggerFactory.getLogger("titan.healthcheck"); private static final String HEALTH_CHECK = GraphPropertiesDictionary.HEALTH_CHECK.getProperty(); private static final String OK = "GOOD"; @@ -67,12 +67,6 @@ public class TitanGraphClient { healthLogger.trace("Health Check Node Found...{}", v.property(HEALTH_CHECK)); graph.tx().commit(); - // Vertex v = graph.getVertices(HEALTH_CHECK, OK).iterator().next(); - // v.setProperty("healthcheck", OK + "_" + - // System.currentTimeMillis()); - // graph.commit(); - // healthLogger.trace("Health Check Node - // Found..."+v.getProperty(HEALTH_CHECK) ); return v; } } @@ -397,19 +391,10 @@ public class TitanGraphClient { if (!graphMgt.containsGraphIndex(prop.getProperty())) { if (prop.isUnique()) { index = graphMgt.buildIndex(prop.getProperty(), Vertex.class).addKey(propKey).unique().buildCompositeIndex(); - - graphMgt.setConsistency(propKey, ConsistencyModifier.LOCK); // Ensures - // only - // one - // name - // per - // vertex - graphMgt.setConsistency(index, ConsistencyModifier.LOCK); // Ensures - // name - // uniqueness - // in - // the - // graph + // Ensures only one name per vertex + graphMgt.setConsistency(propKey, ConsistencyModifier.LOCK); + // Ensures name uniqueness in the graph + graphMgt.setConsistency(index, ConsistencyModifier.LOCK); } else { graphMgt.buildIndex(prop.getProperty(), Vertex.class).addKey(propKey).buildCompositeIndex(); diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java index 5576f0db9f..f5ec18ac61 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java @@ -86,21 +86,6 @@ public abstract class CategoryData extends GraphNode { return "CategoryData [name=" + name + ", normalizedName=" + normalizedName + "uniqueId=" + uniqueId + "]"; } - /* - * @Override public int hashCode() { final int prime = 31; int result = 1; - * result = prime * result + ((name == null) ? 0 : name.hashCode()); result - * = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode()); return - * result; } - * - * @Override public boolean equals(Object obj) { if (this == obj) return - * true; if (obj == null) return false; if (getClass() != obj.getClass()) - * return false; CategoryData other = (CategoryData) obj; if (name == null) - * { if (other.name != null) return false; } else if - * (!name.equals(other.name)) return false; if (uniqueId == null) { if - * (other.uniqueId != null) return false; } else if - * (!uniqueId.equals(other.uniqueId)) return false; return true; } - */ - @Override public String getUniqueIdKey() { return GraphPropertiesDictionary.UNIQUE_ID.getProperty(); diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java index 8b5dee4e8b..5b9f548b46 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/impl/ResourceUploader.java @@ -124,26 +124,6 @@ public class ResourceUploader implements IResourceUploader { return status; } - /* - * @Override public ResourceUploadStatus - * updateServiceArtifact(ServiceArtifactData artifactUpdateData) { - * ResourceUploadStatus status = ResourceUploadStatus.OK; if(resourceDAO == - * null) return ResourceUploadStatus.ERROR; Either getServiceArtifactStatus = - * getServiceArtifact(artifactUpdateData.getId()); - * - * if(getServiceArtifactStatus.isRight()){ - * log.debug("ResourceUploadStatus:updateArtifactt artifact with id " + - * artifactUpdateData.getId() + " not exist."); status = - * getServiceArtifactStatus.right().value(); } - * if(getServiceArtifactStatus.isLeft()){ status = - * updateServiceArtifact(artifactUpdateData, - * getServiceArtifactStatus.left().value()); } - * - * return status; } - * - */ - @Override public Either getArtifact(String id) { if (resourceDAO == null) @@ -152,13 +132,6 @@ public class ResourceUploader implements IResourceUploader { return resourceDAO.getArtifact(id); } - /* - * @Override public Either - * getServiceArtifact(String id) { if(resourceDAO == null) return - * Either.right(ResourceUploadStatus.ERROR); - * - * return resourceDAO.getServiceArtifact(id); } - */ @Override public void deleteArtifact(String id) { if (resourceDAO != null) { -- cgit 1.2.3-korg