Search in sources :

Example 11 with NoSQLReflectionException

use of org.talend.repository.nosql.exceptions.NoSQLReflectionException in project tbd-studio-se by Talend.

the class Neo4jConnectionUtil method getQueryEngine.

private static Object getQueryEngine(Object db, ClassLoader classLoader) throws NoSQLReflectionException {
    Object qe = queryEngine;
    if (qe != null) {
        return qe;
    }
    // $NON-NLS-1$
    Object restAPI = NoSQLReflection.invokeMethod(db, "getRestAPI", new Object[0]);
    try {
        qe = // $NON-NLS-1$
        NoSQLReflection.newInstance(// $NON-NLS-1$
        "org.neo4j.rest.graphdb.query.RestCypherQueryEngine", new Object[] { restAPI }, classLoader, // $NON-NLS-1$
        Class.forName("org.neo4j.rest.graphdb.RestAPI", true, classLoader));
    } catch (ClassNotFoundException e) {
        throw new NoSQLReflectionException(e);
    }
    return queryEngine = qe;
}
Also used : NoSQLReflectionException(org.talend.repository.nosql.exceptions.NoSQLReflectionException)

Example 12 with NoSQLReflectionException

use of org.talend.repository.nosql.exceptions.NoSQLReflectionException in project tbd-studio-se by Talend.

the class CassandraOldVersionMetadataHandler method closeConnections.

@Override
public void closeConnections() throws NoSQLServerException {
    try {
        if (cluster != null) {
            // $NON-NLS-1$
            Object connMgr = NoSQLReflection.invokeMethod(cluster, "getConnectionManager");
            // $NON-NLS-1$
            NoSQLReflection.invokeMethod(connMgr, "shutdown");
            cluster = null;
        }
    } catch (NoSQLReflectionException e) {
        throw new NoSQLServerException(e);
    }
}
Also used : NoSQLServerException(org.talend.repository.nosql.exceptions.NoSQLServerException) NoSQLReflectionException(org.talend.repository.nosql.exceptions.NoSQLReflectionException)

Aggregations

NoSQLReflectionException (org.talend.repository.nosql.exceptions.NoSQLReflectionException)12 NoSQLServerException (org.talend.repository.nosql.exceptions.NoSQLServerException)11 ContextType (org.talend.designer.core.model.utils.emf.talendfile.ContextType)4 ArrayList (java.util.ArrayList)3 ASN1Object (org.bouncycastle.asn1.ASN1Object)3 JSONObject (org.talend.utils.json.JSONObject)3 HashSet (java.util.HashSet)2 File (java.io.File)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1