Package com.dbxml.db.common.adapters

Examples of com.dbxml.db.common.adapters.XMLSerializableAdapter


   public SymbolTable loadSymbols(Collection collection) throws DBException {
      Transaction tx = new Transaction();
      try {
         userStack.pushCurrentUser(magicUser);

         XMLSerializableAdapter symCol = getSymbolsCollection();
         String colName = collection.getCanonicalName();
         SymbolTable symbols = (SymbolTable)symCol.getObject(tx, colName);
         if ( symbols == null ) {
            symbols = new SymbolTable();
            saveSymbols(collection, symbols);
         }
View Full Code Here


      Transaction tx = new Transaction();
      try {
         userStack.pushCurrentUser(magicUser);

         if ( symbols != null ) {
            XMLSerializableAdapter symCol = getSymbolsCollection();
            String colName = collection.getCanonicalName();
            symCol.setObject(tx, colName, symbols);
            symbols.setDirty(false);
         }
      }
      catch ( DBException e ) {
         tx.cancel();
View Full Code Here

   }

   private XMLSerializableAdapter getSymbolsCollection()throws DBException {
      if ( symCol == null ) {
         Collection col = getCollection(SYMBOLS);
         symCol = new XMLSerializableAdapter(col);
      }
      return symCol;
   }
View Full Code Here

   public static final String[] PARAMS_removeGroup = {"group"};

   public void removeGroup(String group) throws DBException {
      Transaction tx = new Transaction();
      try {
         XMLSerializableAdapter col = getGroupsCollection();
         col.remove(tx, group);
      }
      catch ( DBException e ) {
         tx.cancel();
         throw e;
      }
View Full Code Here

   }

   public String[] listGroups() throws DBException {
      Transaction tx = new Transaction();
      try {
         XMLSerializableAdapter col = getGroupsCollection();
      Key[] keys = col.listKeys(tx);
      String[] result = new String[keys.length];
      for ( int i = 0; i < keys.length; i++ )
        result[i] = keys[i].toString();
         return result;
      }
View Full Code Here

   }

   public String[] listUsers() throws DBException {
      Transaction tx = new Transaction();
      try {
      XMLSerializableAdapter col = getUsersCollection();
      Key[] keys = col.listKeys(tx);
      String[] result = new String[keys.length];
      for ( int i = 0; i < keys.length; i++ )
        result[i] = keys[i].toString();
         return result;
      }
View Full Code Here

   }

   public User readUser(String userID) throws InvalidUserException {
      Transaction tx = new Transaction();
      try {
      XMLSerializableAdapter col = getUsersCollection();
         User user = (User)userCache.get(userID);
      if ( user != null ) {
        // Perform access check for cached items
        checkAccess(col, Access.READ);
      }
      else {
            user = (User)col.getObject(tx, userID);
        if ( user != null )
              userCache.put(userID, user);
        else
             throw new InvalidUserException("User '"+userID+"' doesn't exist");
         }
View Full Code Here

   public static final String[] PARAMS_listGroupContents = {"group"};

   public String[] listGroupContents(String group) throws DBException {
      Transaction tx = new Transaction();
      try {
         XMLSerializableAdapter col = getContentCollection();
         ResultSet res = col.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, "/content[@status='active']/groups/group[.='"+group+"']", EmptyNSMap);
         Set s = new TreeSet();
         while ( res.next() )
            s.add(res.getResultKey().toString());
      return (String[])s.toArray(EmptyStrings);
      }
View Full Code Here

   }

   public void storeUser(User user) throws DBException {
      Transaction tx = new Transaction();
      try {
         XMLSerializableAdapter col = getUsersCollection();
         String userID = user.getId();
         col.setObject(tx, userID, user);
         userCache.put(userID, user);
      }
      catch ( DBException e ) {
         tx.cancel();
         throw e;
View Full Code Here

            }
            sb.append("]");
         }
         sb.append("]");

         XMLSerializableAdapter col = getContentCollection();
         ResultSet rs = col.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, sb.toString(), null);
         Map grpMap = new HashMap(); // of String to List of Element

         while ( rs.next() ) {
            try {
               DocumentTable dt = rs.getResult();
View Full Code Here

TOP

Related Classes of com.dbxml.db.common.adapters.XMLSerializableAdapter

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.