Examples of XMLCollection


Examples of org.ozoneDB.xml.core.XMLCollection

    }
    private void create() throws Exception {
        connect();
        assertNotNull(db);
        // create a new Collection
        XMLCollection root = (XMLCollection)db.createObject( XMLCollectionImpl.class.getName(), OzoneInterface.Public, collectionName);
        root.setName(collectionName);
        db.close();
        assert(!db.isOpen());
    }
View Full Code Here

Examples of org.ozoneDB.xml.core.XMLCollection

   
    public void createCollection(String collectionName) throws Exception {
        connect();
        // check if there is an object there already in that case delete it
        // we assume we are cleaning up after an usuccessful testrun
        XMLCollection test = (XMLCollection)db.objectForName(collectionName);
        if (test != null) {
            deleteCollection(collectionName);
            connect();
        }
        // create a new Collection
        XMLCollection root = (XMLCollection)db.createObject( XMLCollectionImpl.class.getName(), OzoneInterface.Public, collectionName);
        System.out.println("CollectionStorageHelper.createCollection() - created XMLCollectionImpl as " + collectionName);
        root.setName(collectionName);
    }
View Full Code Here

Examples of org.ozoneDB.xml.core.XMLCollection

    }
   
    public void deleteCollection(String collectionName) {
        try {
            connect();
            XMLCollection collection = (XMLCollection)db.objectForName(collectionName);
            System.out.println("CollectionStorageHelper.deleteCollection() - " +
                collection.getResourceCount() + " XML documents in this collection");
            Iterator it = collection.getResources().iterator();
            String id;
            while (it.hasNext()) {
                id = (String)it.next();                   
                db.deleteObject(db.objectForName(id));
                it.remove();
View Full Code Here

Examples of org.ozoneDB.xml.core.XMLCollection

     *  gets the <code>Collection</code> using the corresponding name from the given
     *  database
     */
    protected static Collection forName( ExternalDatabase database, String collectionName )
        throws Exception {
        XMLCollection collection = ( XMLCollection )database.objectForName( collectionName );
        return collection != null ?
                new CollectionImpl ( database, collection ) : null;
    }
View Full Code Here

Examples of org.ozoneDB.xml.core.XMLCollection

    /**
     *  creates a new <code>Collection</code> and stores it in the database
     */
    protected static Collection newCollection( ExternalDatabase database,
        String collectionName ) throws Exception {
        XMLCollection collection = ( XMLCollection ) database.createObject(
                org.ozoneDB.xml.core.XMLCollectionImpl.class.getName(), OzoneInterface.Public, collectionName );
        collection.setName(collectionName);
        return new CollectionImpl( database, collection );
    }
View Full Code Here

Examples of org.ozoneDB.xml.core.XMLCollection

    *
    * @return the parent Collection instance.
    * @exception XMLDBException
    */
    public Collection getParentCollection() throws XMLDBException {
        XMLCollection parentCollection = collection.getParentCollection();
        return parentCollection == null ? null :
                new CollectionImpl( database, parentCollection );
    }
View Full Code Here

Examples of org.ozoneDB.xml.core.XMLCollection

    * @param name the name of the child collection to retrieve.
    * @return the requested child collection or null if it couldn't be found.
    * @exception XMLDBException
    */
    public Collection getChildCollection( String name ) throws XMLDBException {
        XMLCollection cCollection = collection.getChildCollection( name );
        return cCollection == null ? null :
                new CollectionImpl( database, cCollection );
    }
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.