Package org.xmldb.api.base

Examples of org.xmldb.api.base.XMLDBException


            params.put(RPCDefaultMessage.NAME, childName);
            String result = (String) runRemoteCommand("RemoveCollection", params);

            if (!result.equals("yes")) {

                throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                    "Cannot remove child collection");
            }
        } catch (Exception e) {
           
            throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                    "Cannot remove child collection", e);
        }
    }
View Full Code Here


    public Collection createCollection(String childCollName)
            throws XMLDBException {
               
        if (coll == null) {
           
            throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                "Must set collection for this service");
        }
       
        return ((XindiceCollection) coll).createCollection(childCollName);
    }
View Full Code Here

     * @param childCollName name of child collection to remove
     */
    public void removeCollection(String childCollName) throws XMLDBException {
        if (coll == null) {
           
            throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                "Must set collection for this service");
        }
       
        ((XindiceCollection) coll).removeCollection(childCollName);
    }
View Full Code Here

     * @exception XMLDBException
     */
    public Collection createCollection(String path, Document configuration)
       throws XMLDBException {
          if (coll == null) {
             throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                                      "Must set collection for this service");
          }

          return ((XindiceCollection) coll).createCollection(path, configuration);
       }
View Full Code Here

        {
            count = doc.getDocumentElement().getFirstChild().getNodeValue();
        }
        catch(Exception e)
        {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "Unable to retrieve <src:modified> element content from server result", e);
        }
        try {
          
            return Long.parseLong(count);
       } catch (Exception e) {
        
           throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "<src:modified> in server result did not contain a valid count", e);
       }
    }
View Full Code Here

    * @param value The new Content value
    * @exception XMLDBException
    */
   public void setContent(Object value) throws XMLDBException {
      if (value == null) {
         throw new XMLDBException(ErrorCodes.INVALID_RESOURCE);
      }
      else if (value instanceof String) {
         this.content = (String) value;
         this.bytes = null;
      }
      else {
         throw new XMLDBException(ErrorCodes.WRONG_CONTENT_TYPE);
      }
   }
View Full Code Here

      if (content != null) {
         this.content = TextWriter.toString( content );
         this.bytes = null;
      }
      else {
         throw new XMLDBException(ErrorCodes.INVALID_RESOURCE);
      }
   }
View Full Code Here

                }

                i++;
                resources.add(resource);
            } catch (Exception e) {
                throw new XMLDBException(ErrorCodes.UNKNOWN_ERROR, e);
            }
        }
    }
View Full Code Here

            message += ": " + e.getMessage();
        }

        // TODO: Mapping FaultCodes.COL_DOCUMENT_NOT_FOUND -> ErrorCodes.NO_SUCH_RESOURCE etc

        return new XMLDBException(errorCode, faultCode, message, e);
    }
View Full Code Here

                } else if (uri.startsWith(MANAGED_URI)) {
                    driver = new ManagedDatabaseImpl();
                }
            } catch (Exception e) {
                log.error("Exception during creation of the Database", e);
                throw new XMLDBException(ErrorCodes.INVALID_URI, uri, e);
            }

            // moved to avoid double catching a creation exception
            if (null == driver) {
                log.warn("The uri '" + uri + "' is not handled be xindice");
                throw new XMLDBException(ErrorCodes.INVALID_URI, uri);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.xmldb.api.base.XMLDBException

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.