Committing missing change

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@158405 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-11-13 11:50:53 +00:00
parent 6155b24dbe
commit 7fe7e641f4
1 changed files with 2 additions and 10 deletions

View File

@ -30,14 +30,12 @@ import com.tinkerpop.blueprints.Element;
import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph;
import com.tinkerpop.blueprints.impls.orient.OrientElement; import com.tinkerpop.blueprints.impls.orient.OrientElement;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx;
import com.tinkerpop.blueprints.util.io.graphson.GraphSONMode; import com.tinkerpop.blueprints.util.io.graphson.GraphSONMode;
import com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility; import com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility;
/** /**
* @author Luca Frosini (ISTI - CNR) * @author Luca Frosini (ISTI - CNR)
*
*/ */
public class Utility { public class Utility {
@ -92,17 +90,11 @@ public class Utility {
public static <El extends Element> El getElementByUUIDAsAdmin(String elementType, UUID uuid, public static <El extends Element> El getElementByUUIDAsAdmin(String elementType, UUID uuid,
Class<? extends El> clz) throws ERNotFoundException, ResourceRegistryException { Class<? extends El> clz) throws ERNotFoundException, ResourceRegistryException {
OrientGraphFactory orientGraphFactory = SecurityContextMapper
.getSecurityContextFactory(SecurityContextMapper.ADMIN_SECURITY_CONTEXT_UUID, PermissionMode.READER);
OrientGraphNoTx orientGraphNoTx = null; OrientGraphNoTx orientGraphNoTx = null;
try { try {
orientGraphNoTx = SecurityContextMapper.getSecurityContextGraphNoTx(
orientGraphNoTx = orientGraphFactory.getNoTx(); SecurityContextMapper.ADMIN_SECURITY_CONTEXT_UUID, PermissionMode.READER);
return Utility.getElementByUUID(orientGraphNoTx, elementType, uuid, clz); return Utility.getElementByUUID(orientGraphNoTx, elementType, uuid, clz);
} finally { } finally {
if (orientGraphNoTx != null) { if (orientGraphNoTx != null) {
orientGraphNoTx.shutdown(); orientGraphNoTx.shutdown();