Examples of DBCollection


Examples of xbird.storage.DbCollection

        for(Map.Entry<String, List<Pair<String, Lock>>> e : cfmap.entrySet()) {
            final String colpath = e.getKey();
            final List<Pair<String, Lock>> fileResources = e.getValue();

            DbCollection col = DbCollection.getCollection(colpath);
            File colDir = col.getDirectory();
            if(!colDir.exists()) {
                throw new GridException("Collection not found: " + colpath);
            }

            for(Pair<String, Lock> rsc : fileResources) {
View Full Code Here

Examples of xbird.storage.DbCollection

        for(Map.Entry<String, List<Pair<String, Lock>>> e : cfmap.entrySet()) {
            final String colpath = e.getKey();
            final List<Pair<String, Lock>> fileResources = e.getValue();

            DbCollection col = DbCollection.getCollection(colpath);
            File colDir = col.getDirectory();
            if(!colDir.exists()) {
                throw new GridException("Collection not found: " + colpath);
            }

            for(Pair<String, Lock> rsc : fileResources) {
View Full Code Here

Examples of xbird.storage.DbCollection

    }

    private void run(String[] args) {
        prepArgs(args);
        if(colpath != null) {
            final DbCollection col;
            try {
                col = DbCollection.getRootCollection().createCollection(colpath);
            } catch (DbException e) {
                throw new IllegalStateException("create collection failed: " + colpath, e);
            }
View Full Code Here

Examples of xbird.storage.DbCollection

        }
        return true;
    }

    public boolean process(String[] args) throws CommandException {
        final DbCollection col = session.getContextCollection();
        if(col == null) {
            throwException("Context collection is not set");
        }
        final int type = ArrayUtils.indexOf(IDXTYPE, args[1]);
        if(type == ArrayUtils.INDEX_NOT_FOUND) {
View Full Code Here

Examples of xbird.storage.DbCollection

                return false;
        }
    }

    public boolean process(String[] args) throws CommandException {
        DbCollection col = session.getContextCollection();
        if(col == null) {
            throwException("Context collection is not set");
        }
        String docpath = args[2];
        File docFile = new File(docpath);
View Full Code Here

Examples of xbird.storage.DbCollection

        }
        CommandRequest command = (CommandRequest) request;
        String[] cmdArg = command.getArgs();
        String baseCol = command.getBaseCollection();

        DbCollection contextCol = DbCollection.getCollection(baseCol);
        Session session = new Session(contextCol);
        CommandInvoker invoker = new CommandInvoker(session);

        _runningThreads.put(rc, Thread.currentThread());
        try {
View Full Code Here

Examples of xbird.storage.DbCollection

        final List<Pair<DbCollection, String>> lst = new ArrayList<Pair<DbCollection, String>>(files.size());
        for(File f : files) {
            String fname = FileUtils.getFileName(f);
            String dname = fname.substring(0, fname.lastIndexOf('.'));
            String parentDirPath = f.getParent();
            final DbCollection col;
            if(parentDirPath.length() == colDirPathLength) {
                col = collection;
            } else {
                String relative = parentDirPath.substring(colDirPathLength);
                col = DbCollection.getCollection(relative);
View Full Code Here

Examples of xbird.storage.DbCollection

        String colPath = arg2.stringValue();
        File docFile = new File(docPath);
        if(!docFile.exists()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        DbCollection col = DbCollection.getCollection(colPath);
        if(col == null) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        final IDocumentTable doc;
        try {
View Full Code Here

Examples of xbird.storage.DbCollection

            final Map<String, DTMDocument> defaultCol = statEnv.getDefaultCollection();
            if(defaultCol != null) {
                catalog = defaultCol;
            } else {
                try {
                    DbCollection rootColl = DbCollection.getRootCollection();
                    catalog = rootColl.listDocuments(dynEnv);
                } catch (DbException e) {
                    throw new XQueryException("failed loading default collection", e);
                }
            }
        } else {
            Item arg = argv.getItem(0);
            String argStr = arg.stringValue();
            final String unescapedArg = XMLUtils.unescapeXML(argStr);
            if(unescapedArg.endsWith(".catalog")) {
                URI baseUri = dynEnv.getStaticContext().getBaseURI();
                if(baseUri == null) { // TODO REVIEWME workaround
                    baseUri = dynEnv.getStaticContext().getSystemBaseURI();
                }
                URI resolved = baseUri.resolve(unescapedArg);
                final URL colurl;
                try {
                    colurl = resolved.toURL();
                } catch (MalformedURLException e) {
                    throw new DynamicError("Invalid uri: " + argStr);
                }
                DocumentManager docmgr = dynEnv.getDocumentManager();
                DTMDocument doc = docmgr.loadDocument(colurl, dynEnv);
                catalog = resolveCatalog(doc, dynEnv);
            } else if(unescapedArg.startsWith("/")) {
                DbCollection coll = DbCollection.getCollection(unescapedArg);
                if(coll == null) {
                    catalog = Collections.emptyMap();
                } else {
                    final String filter = DbCollection.getDocumentFilterExp(unescapedArg);
                    try {
                        catalog = coll.listDocuments(filter, true, dynEnv);
                    } catch (DbException e) {
                        throw new XQueryException("failed loading collection: " + unescapedArg, e);
                    }
                }
            } else {
View Full Code Here

Examples of xbird.storage.DbCollection

                    return false;
                }
            } else {
                throw new IllegalStateException("Unexpected parameters: " + _params);
            }
            DbCollection col = DbCollection.getCollection(colpath);
            if(col == null) {
                this.indexAccessable = ThreeLogic.FALSE;
                return false;
            }
            File idxDir = new File(col.getDirectory(), LabelingHandler.INDEX_DIR_NAME);
            if(!idxDir.exists()) {
                this.indexAccessable = ThreeLogic.FALSE;
                return false;
            }
            info.setCollection(col, colpath);
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.