Examples of KAMStoreImpl


Examples of org.openbel.framework.api.KAMStoreImpl

        try {
            final SystemConfiguration syscfg = createSystemConfiguration();
            final DatabaseService dbs = new DatabaseServiceImpl();
            dbc = dbs.dbConnection(syscfg.getKamURL(),
                    syscfg.getKamUser(), syscfg.getKamPassword());
            ks = new KAMStoreImpl(dbc);
        } catch (IOException e) {
            e.printStackTrace();
            fail("Could not read system configuration.");
        } catch (SQLException e) {
            e.printStackTrace();
View Full Code Here

Examples of org.openbel.framework.api.KAMStoreImpl

            try{
                dbConnection = dbsvc.dbConnection(
                        syscfg.getKamURL(),
                        syscfg.getKamUser(),
                        syscfg.getKamPassword());
                kamStore = new KAMStoreImpl(dbConnection);
                kams = kamStore.getCatalog();
                for (KamInfo kam : kams){
                    if (kam.getName().equals(kamName)){
                        bail(ExitCode.DUPLICATE_KAM_NAME);
                    }
View Full Code Here

Examples of org.openbel.framework.api.KAMStoreImpl

        DBConnection c = null;
        try {
            c = db.dbConnection(sc.getKamURL(), sc.getKamUser(),
                    sc.getKamPassword());
            KAMStore store = new KAMStoreImpl(c);
            return store.getKamInfo(kam) != null;
        } catch (SQLException e) {
            return false;
        } finally {
            if (c != null) {
                c.close();
View Full Code Here

Examples of org.openbel.framework.api.KAMStoreImpl

        DBConnection c = null;
        try {
            c = db.dbConnection(sc.getKamURL(), sc.getKamUser(),
                    sc.getKamPassword());
            KAMStore store = new KAMStoreImpl(c);
            return store.getKam(kam);
        } catch (SQLException e) {
            return null;
        } finally {
            if (c != null) {
                c.close();
View Full Code Here

Examples of org.openbel.framework.api.KAMStoreImpl

        DBConnection c = null;
        try {
            c = db.dbConnection(sc.getKamURL(), sc.getKamUser(),
                    sc.getKamPassword());
            return new KAMStoreImpl(c);
        } catch (SQLException e) {
            return null;
        }
    }
View Full Code Here

Examples of org.openbel.framework.api.KAMStoreImpl

        DBConnection dbConnection = dbservice.dbConnection(
                sysconfig.getKamURL(),
                sysconfig.getKamUser(),
                sysconfig.getKamPassword());

        KAMStore kAMStore = new KAMStoreImpl(dbConnection);

        // See if we need to set up the KAM Store schemas
        final KAMStoreSchemaService kamSchemaService =
                new KAMStoreSchemaServiceImpl(dbservice);

        // Load the KAM catalog schema, if it doesn't exist (see #88).
        kamSchemaService.setupKAMCatalogSchema();

        try {
            if (mode == Mode.LIST) {
                List<KamInfo> kamInfos = kAMStore.getCatalog();
                printKamCatalogSummary(kamInfos);

            } else if (mode == Mode.COMPARE) {
                final KamComparisonXHTMLWriter xhtmlWriter =
                        createOutputFileWriter();

                final String[] kamNames = new String[] { kam1Name, kam2Name };

                // Get the KAM catalog information for each KAM.
                final KamInfo[] kamInfos = new KamInfo[kamNames.length];
                for (int i = 0; i < kamNames.length; ++i) {
                    final KamInfo kamInfo = kAMStore.getKamInfo(kamNames[i]);
                    if (kamInfo == null) {
                        reportable.error("No KAM found with name '"
                                + kamNames[i] + "'");
                        bail(ExitCode.GENERAL_FAILURE);
                    }
                    kamInfos[i] = kamInfo;
                }

                // Create the KamComparison that will be displayed and/or written to the
                // output file.
                final KamComparison cmp = new KamComparison(kamNames);
                for (KamInfo kamInfo : kamInfos) {
                    final String kamName = kamInfo.getName();
                    final KAMStoreStatisticsDaoImpl dao =
                            new KAMStoreStatisticsDaoImpl(
                                    kamInfo.getKamDbObject().getSchemaName(),
                                    dbConnection);

                    cmp.setKamNodeCount(kamName, dao.getKamNodeCount());
                    cmp.setKamEdgeCount(kamName, dao.getKamEdgeCount());
                    cmp.setBELDocumentCount(kamName, dao.getBELDocumentCount());
                    cmp.setNamespaceCount(kamName, dao.getNamespaceCount());
                    cmp.setAnnotationDefinitionCount(kamName,
                            dao.getAnnotationDefinitonCount());
                    cmp.setAnnotationCount(kamName, dao.getAnnotationCount());
                    cmp.setStatementCount(kamName, dao.getStatementCount());
                    cmp.setTermCount(kamName, dao.getTermCount());
                    cmp.setParameterCount(kamName, dao.getParameterCount());
                    cmp.setUniqueParameterCount(kamName,
                            dao.getUniqueParameterCount());
                }

                // Write to stdout.
                writeComparison(cmp);

                // Write the output to the output file.
                if (xhtmlWriter != null) {
                    xhtmlWriter.writeKamComparison(cmp);
                    xhtmlWriter.close();
                }
            }
        } finally {
            kAMStore.teardown();
            dbConnection.getConnection().close();
        }
    }
View Full Code Here

Examples of org.openbel.framework.api.KAMStoreImpl

                sysconfig.getKamPassword());

        // Connect to the KAM Store. This establishes a connection to the
        // KAM store database and sets up the system to read and process
        // KAMs.
        kAMStore = new KAMStoreImpl(dbConnection);

        // Set up the KAM Store schemas
        kamSchemaService = new KAMStoreSchemaServiceImpl(dbservice);

        // Load the KAM catalog schema, if it doesn't exist (see #88).
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.