Examples of KamInfo


Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

     */
    @Test
    public void test() {
        KamCacheService kcSvc = new DefaultKamCacheService(new MockKAMStore1());
        KamDbObject kdbobj = new KamDbObject(1, null, null, null, null);
        KamInfo ki = new KamInfo(kdbobj);
        long t1 = currentTimeMillis();
        try {
            kcSvc.loadKam(ki, null);
        } catch (KamCacheServiceException e) {
            e.printStackTrace();
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

        }

        final SystemConfiguration cfg =
                SystemConfiguration.getSystemConfiguration();

        KamInfo kamInfo = loadKAMInfo(kamName, filePath, cfg);

        PKAMWriter pkw = null;
        CSVWriter tabbedWriter = null;
        KAMExportDAO kdao = null;
        try {
            pkw = new PKAMWriter(filePath);
            tabbedWriter = new CSVWriter(pkw, FIELD_SEPARATOR,
                    CSVParser.DEFAULT_QUOTE_CHARACTER,
                    CSVParser.DEFAULT_ESCAPE_CHARACTER);

            final DBConnection kcc = createKAMConnection(kamName, cfg);
            kdao = new KAMExportDAO(kcc, kamInfo.getSchemaName());
            for (KAMStoreTables1_0 kamTable : KAMStoreTables1_0.values()) {
                tabbedWriter.writeNext(new String[] { "["
                        + kamTable.getTableName() + "]" });

                // write out column headers
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

        final String kamDescription = rowData[2];
        final long lastCompiled = Long.parseLong(rowData[3]);

        // check to see if it exists
        KamInfo kamInfo = loadKAMInfo(kamName, filePath, cfg);

        // create a kam catalog entry if it does not exist
        final KamDbObject kamDb;
        if (kamInfo == null) {
            kamDb = new KamDbObject(null, kamName, kamDescription,
                    new Date(lastCompiled), null);
        } else {
            if (!noPreserve) {
                // FIXME Hack to throw noPreserve check error to be processed by the calling CLI
                throw new IllegalStateException();
            }

            kamDb = new KamDbObject(kamInfo.getId(), kamName, kamDescription,
                    new Date(lastCompiled), kamInfo.getSchemaName());
        }

        final String kamSchema;
        try {
            // create new kam entry since it does not exist
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

    private KamInfo loadKAMInfo(final String kamName, final String filePath,
            final SystemConfiguration cfg) throws PKAMSerializationFailure {
        final DBConnection kcc = createKAMConnection(kamName, cfg);

        KamInfo kamInfo;
        KAMCatalogDao kcdao = null;
        try {
            kcdao = new KAMCatalogDao(kcc,
                    cfg.getKamCatalogSchema(), cfg.getKamSchemaPrefix());
            kamInfo = kcdao.getKamInfoByName(kamName);
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

            reportable.output(format(fmt, kamName));
        }

        // run orthologize
        Kam kam = kam(kamName);
        KamInfo info = kam.getKamInfo();
        KAMStore kamstore = kamstore();
        Orthologize ortho = new DefaultOrthologize();
        SpeciesDialect dialect = dialect(taxId, info, kamstore);
        OrthologizedKam orthokam = ortho.orthologize(kam, kamstore, dialect);
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

                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());
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

    private void runDeleteCommand(final String kamName) {
        try {
            setUp();

            KamInfo kamInfo = kAMStore.getKamInfo(kamName);
            if (kamInfo != null) {
                deleteKam(kamInfo, quiet);
            } else {
                reportable.warning("No KAM named '" + kamName
                        + "' exists in the catalog.");
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

    private void runSetDescriptionCommand(final String kamName,
            final String newDescription) {
        try {
            setUp();

            final KamInfo kamInfo = kAMStore.getKamInfo(kamName);
            if (kamInfo != null) {
                if (!BELUtilities.equals(kamInfo.getDescription(),
                        newDescription)) {
                    final KamDbObject updated =
                            new KamDbObject(kamInfo.getId(), kamInfo.getName(),
                                    newDescription, kamInfo.getLastCompiled(),
                                    kamInfo.getSchemaName());
                    kamCatalogDao.saveToCatalog(updated);
                }
            } else {
                reportable.warning("No KAM named '" + kamName
                        + "' exists in the catalog.");
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

        }

        try {
            setUp();

            final KamInfo kamInfo = kAMStore.getKamInfo(oldKamName);
            if (kamInfo != null) {
                final KamInfo kamInfo2 = kAMStore.getKamInfo(newKamName);
                if (kamInfo2 != null) {
                    if (noPreserve) {
                        deleteKam(kamInfo2, true);
                    } else {
                        teardown();
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamInfo

            SecurityException, NoSuchFieldException,
            IllegalArgumentException, IllegalAccessException {
        setupKamStore(Constants.SMALL_CORPUS_KAM_NAME);

        // Create an instance of the KAMStoreDaoImpl class to test.
        KamInfo kamInfo = testKam.getKamInfo();
        dao = new KAMStoreDaoImpl(kamInfo.getKamDbObject().getSchemaName(), dbc);
        kamFilterHelper = new KAMFilterHelper(dao);

        reflectNecessaryCode();
    }
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.