Package com.dbxml.db.core

Examples of com.dbxml.db.core.Collection


   public int getCollectionType() throws dbXMLException {
      return col.getCollectionType();
   }

   public CollectionClient getParentCollection() throws dbXMLException {
      Collection pc = col.getParentCollection();
      if ( pc != null )
         return new CollectionClientImpl(client, pc);
      else
         throw new dbXMLException("No parent Collection");
   }
View Full Code Here


   public CollectionClient getSystemCollection() throws dbXMLException {
      return new CollectionClientImpl(client, col.getSystemCollection());
   }

   public CollectionClient getCollection(String name) throws dbXMLException {
      Collection c = col.getCollection(name);
      if ( c != null )
         return new CollectionClientImpl(client, c);
      else
         throw new dbXMLException("Collection '" + name + "' not found");
   }
View Full Code Here

         throw new dbXMLException("Collection '" + name + "' not found");
   }

   public CollectionClient createCollection(String path, Document configuration) throws dbXMLException {
      Configuration cfg = new Configuration(configuration);
      Collection c = col.createCollection(path, cfg);
      if ( c != null )
         return new CollectionClientImpl(client, c);
      else
         throw new dbXMLException("Couldn't create Collection '" + path + "'");
   }
View Full Code Here

   public String[] listCollections() throws dbXMLException {
      return col.listCollections();
   }

   public boolean dropCollection(String name) throws dbXMLException {
      Collection c = col.getCollection(name);
      if ( c != null )
         return col.dropCollection(c);
      else
         return false;
   }
View Full Code Here

   public void shutdown(int exitCode) throws DBException {
    // Do an access control check
    Database db = Database.getInstance();
    if ( db != null ) {
      Collection col = db.getSystemCollection();
      String path = col.getCanonicalName();
      db.getSecurityManager().access(path, Access.EXECUTE);
    }
    server.shutDown(exitCode);
   }
View Full Code Here

   private ObjectInstance getContent(ID id) throws DBException {
    String name = id.toString();
    Database db = Database.getInstance();
    int idx = name.lastIndexOf('/');
    String colName = name.substring(0, idx);
    Collection col = db.getCollection(colName);
    String docName = name.substring(idx + 1);

    Transaction tx = new Transaction();
    try {
      Container c = col.getContainer(tx, docName);

      if ( c != null ) {
        ContentProxy dp = new ContentProxy(col, docName);
        return new ObjectInstance(dp);
      }
View Full Code Here

      Map result = new HashMap(4);
      result.put(NAME, col.getName());
      result.put(CANONICAL_NAME, col.getCanonicalName());
      result.put(COLLECTION_TYPE, new Integer(col.getCollectionType()));
      try {
         Collection parent = col.getParentCollection();
         result.put(PARENT_COLLECTION, parent.getCanonicalName());
      }
      catch ( Exception e ) {
         // NOOP
      }
      return result;
View Full Code Here

   }

   public static final String[] PARAMS_dropCollection = {"name"};

   public boolean dropCollection(String name) throws DBException {
      Collection c = col.getCollection(name);
      if ( c != null )
         return col.dropCollection(c);
      else
         return false;
   }
View Full Code Here

      else
         throw new dbXMLException("Database not found");
   }

   public CollectionClient getCollection(String path) throws dbXMLException {
      Collection col = getAbsoluteCollection(path);
      if ( col != null )
         return new CollectionClientImpl(this, col);
      else
         throw new dbXMLException("Collection '" + path + "' not found");
   }
View Full Code Here

      try {
         int idx = path.lastIndexOf('/');
         if ( idx != -1 ) {
            String docName = path.substring(idx + 1);
            path = path.substring(0, idx);
            Collection col = getAbsoluteCollection(path);
            if ( col != null ) {
               Container con = col.getContainer(tx, docName);
               if ( con != null )
                  return new ContentClientImpl(new CollectionClientImpl(this, col), con);
               else
                  throw new dbXMLException("Document '" + docName + "' not found");
            }
View Full Code Here

TOP

Related Classes of com.dbxml.db.core.Collection

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.