Package org.ozoneDB.xml.core

Examples of org.ozoneDB.xml.core.XMLCollection


    private void createCollection() throws Exception {
        try {
            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();
                connect();
            }
            // create a new Collection
View Full Code Here


        }
    }
    public void deleteCollection() {
        try {
            connect();
            XMLCollection collection = (XMLCollection)db.objectForName(collectionName);
            Iterator it = collection.getResources().iterator();
            while (it.hasNext()) {
                XMLContainer.forName(db,(String)it.next()).delete();
            }
            db.deleteObject(collection);
            System.out.println("StoreDocument.deleteCollection() - deleted " + collectionName);
View Full Code Here

    }
    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

   
    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

    }
   
    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

     *  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

    /**
     *  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

    *
    * @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

    * @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

Related Classes of org.ozoneDB.xml.core.XMLCollection

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.