Package com.dbxml.db.client

Examples of com.dbxml.db.client.CollectionClient


   private static final String ACTION_ADDROLE = "ADDROLE";
   private static final String ACTION_RMROLE = "RMROLE";
   private static final String ACTION_LSROLE = "LSROLE";

   public void process() throws dbXMLException {
      CollectionClient col = (CollectionClient)cl.getProperty(CommandLine.COLLECTION);
      if ( col == null )
         throw new dbXMLException("Collection context required");

      AccessManagerClient manager = new AccessManagerClient(cl.getClient());
      PrintWriter pw = cl.getWriter();
View Full Code Here


* ListBase serves as a base class for several listing Commands.
*/

public abstract class ListBase extends CommandBase {
   public final void process() throws dbXMLException {
      CollectionClient col = (CollectionClient)cl.getProperty(CommandLine.COLLECTION);
      if ( col == null )
         throw new dbXMLException("Collection context required");

      WildcardMatcher matcher = null;
      if ( cl.hasMoreTokens() )
View Full Code Here

   private static final String ACTION_ADDUSER = "ADDUSER";
   private static final String ACTION_RMUSER = "RMUSER";
   private static final String ACTION_LSUSER = "LSUSER";

   public void process() throws dbXMLException {
      CollectionClient col = (CollectionClient)cl.getProperty(CommandLine.COLLECTION);
      if ( col == null )
         throw new dbXMLException("Collection context required");

      AccessManagerClient manager = new AccessManagerClient(cl.getClient());
      PrintWriter pw = cl.getWriter();
View Full Code Here

public final class AccessControlList extends CommandBase {
   private static final String[] STRS = {"NONE", "READ", "WRITE", "EXECUTE", "CREATE"};
   private static final int[] INTS = {Access.NONE, Access.READ, Access.WRITE, Access.EXECUTE, Access.CREATE};

   public void process() throws dbXMLException {
      CollectionClient col = (CollectionClient)cl.getProperty(CommandLine.COLLECTION);
      if ( col == null )
         throw new dbXMLException("Collection context required");

      String path = col.getCanonicalName();
      String roleID = null;

      if ( cl.hasMoreTokens() )
         roleID = cl.getNextToken("Role ID");
View Full Code Here

         sb.append('\u0008');
      EOL_STRING = sb.toString();
   }

   public void process() throws dbXMLException {
      CollectionClient col = (CollectionClient)cl.getProperty(CommandLine.COLLECTION);
      if ( col == null )
         throw new dbXMLException("Collection context required");

      boolean binary = col.getCollectionType() == CollectionClient.TYPE_VALUES;
      String type;
      if ( binary )
         type = "Record";
      else
         type = "Document";
View Full Code Here

            throw new XMLDBException(ErrorCodes.NO_SUCH_DATABASE, e.getMessage());
         }
      }

      try {
         CollectionClient colClient = dbClient.getCollection(path);
         if ( colClient != null )
            return new CollectionImpl(colClient);
         else
            throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "No such Collection at '"+uri+"'");
      }
View Full Code Here

      return parent;
   }

   public CollectionClient getDatabase() throws dbXMLException {
      CollectionClient p = getParentCollection();
      if ( p != null )
         return p.getDatabase();
      else
         return this;
   }
View Full Code Here

   public int doEndTag() throws JspException {
      Object obj = pageContext.getAttribute(collection);
      if ( obj == null || !(obj instanceof CollectionClient) )
         throw new JspException("No Collection named '" + collection + "' has been declared");
      CollectionClient col = (CollectionClient)obj;

      try {
         BodyContent content = getBodyContent();
         String doc = content.getString().trim();
         col.setDocumentAsText(key, doc);
      }
      catch ( Exception e ) {
         throw new JspException("Can't set Document '" + key + "' on Collection '" + collection + "'", e);
      }
View Full Code Here

   public int doEndTag() throws JspException {
      Object obj = pageContext.getAttribute(collection);
      if ( obj == null || !(obj instanceof CollectionClient) )
         throw new JspException("No Collection named '" + collection + "' has been declared");
      CollectionClient col = (CollectionClient)obj;

      try {
         BodyContent content = getBodyContent();
         String doc = content.getString().trim();
         String id = col.insertDocumentAsText(doc);
         if ( name != null )
            pageContext.setAttribute(name, id);
      }
      catch ( Exception e ) {
         throw new JspException("Can't insert Document on Collection '" + collection + "'", e);
View Full Code Here

      if ( obj == null && !(obj instanceof dbXMLClient) )
         throw new JspException("No Connection named '" + connection + "' has been declared");
      dbXMLClient client = (dbXMLClient)obj;

      try {
         CollectionClient col = client.getCollection(path);
         pageContext.setAttribute(name, col);
      }
      catch ( dbXMLException e ) {
         throw new JspException("Can't connect to Collection '" + path + "' on Connection '" + connection + "'", e);
      }
View Full Code Here

TOP

Related Classes of com.dbxml.db.client.CollectionClient

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.