Package xbird.storage

Examples of xbird.storage.DbCollection


    private static final boolean DEBUG_LIGHT = true;
    private static final String TEST_FILE = "D:/workspace/xbird/main/test/resources/scenario/storage/auction.xml";

    public DocumentTableTest() throws DbException {
        super(DocumentTableTest.class.getName());
        DbCollection rootCol = DbCollection.getRootCollection();
        rootCol.removeCollection("/test");
        DbCollection testCol = rootCol.createCollection("test");
        testCol.createCollection("xmark");
    }
View Full Code Here


        DbCollection testCol = rootCol.createCollection("test");
        testCol.createCollection("xmark");
    }

    public void xtestPutDocument() throws XQueryException, DbException, FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("dtm");
        assert (xmark.getDirectory().exists());
        DocumentTableModel dtm = new DocumentTableModel(false);
        File file = new File(TEST_FILE);
        dtm.loadDocument(new FileInputStream(file));
        IDocumentTable doc = dtm.getDocumentTable();
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        xmark.putDocument(new Transaction(), file.getName(), doc);
    }

    public void xtestPutDocumentPageOut() throws XQueryException, DbException,
            FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("dtms");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new DocumentTable.PersistentDocumentTable(xmark, FileUtils.getFileName(file));
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }

    public void xtestPutDocumentBig() throws XQueryException, DbException, FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("big_dtm");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable();
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        xmark.putDocument(new Transaction(), file.getName(), doc);
    }

    public void xtestPutDocumentPageOutBig() throws XQueryException, DbException,
            FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("big_dtms");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable.PersistentBigDocumentTable(xmark, FileUtils.getFileName(file));
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        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

        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

    }

    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

        }
        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

                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

TOP

Related Classes of xbird.storage.DbCollection

Copyright © 2018 www.massapicom. 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.