/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version: 1.3.19
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.sleepycat.dbxml;


public class XmlContainer {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected XmlContainer(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected XmlContainer() {
    this(0, false);
  }

  protected void finalize() {
    delete();
  }

  public void delete() /* no exception */ {
    if(swigCPtr != 0 && swigCMemOwn) {
      dbxml_javaJNI.delete_XmlContainer(swigCPtr);
      swigCMemOwn = false;
    }
    swigCPtr = 0;
  }

  protected static long getCPtr(XmlContainer obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  public final static int LEVEL_NONE = dbxml_java.LEVEL_NONE;
  public final static int LEVEL_DEBUG = dbxml_java.LEVEL_DEBUG;
  public final static int LEVEL_INFO = dbxml_java.LEVEL_INFO;
  public final static int LEVEL_WARNING = dbxml_java.LEVEL_WARNING;
  public final static int LEVEL_ERROR = dbxml_java.LEVEL_ERROR;
  public final static int LEVEL_ALL = dbxml_java.LEVEL_ALL;
  public final static int CATEGORY_NONE = dbxml_java.CATEGORY_NONE;
  public final static int CATEGORY_INDEXER = dbxml_java.CATEGORY_INDEXER;
  public final static int CATEGORY_QUERY = dbxml_java.CATEGORY_QUERY;
  public final static int CATEGORY_OPTIMIZER = dbxml_java.CATEGORY_OPTIMIZER;
  public final static int CATEGORY_DICTIONARY = dbxml_java.CATEGORY_DICTIONARY;
  public final static int CATEGORY_CONTAINER = dbxml_java.CATEGORY_CONTAINER;
  public final static int CATEGORY_ALL = dbxml_java.CATEGORY_ALL;
  public final static String metaDataNamespace_uri = dbxml_java.metaDataNamespace_uri;
  public final static String metaDataNamespace_prefix = dbxml_java.metaDataNamespace_prefix;
  public final static String metaDataName_id = dbxml_java.metaDataName_id;
  public final static String metaDataName_name = dbxml_java.metaDataName_name;
  public final static String metaDataName_content = dbxml_java.metaDataName_content;
  public final static String metaDataName_default = dbxml_java.metaDataName_default;
  public final static String metaDataNamespace_prefix_debug = dbxml_java.metaDataNamespace_prefix_debug;

  public XmlContainer(com.sleepycat.db.DbEnv dbenv, String name, int flags) throws XmlException {
    this(dbxml_javaJNI.new_XmlContainer(dbenv, name, flags), true);
  }

  public void setPageSize(int pagesize) throws XmlException {
    dbxml_javaJNI.XmlContainer_setPageSize(swigCPtr, pagesize);
  }

  public void open(com.sleepycat.db.DbTxn txn, int flags, int mode) throws XmlException {
    dbxml_javaJNI.XmlContainer_open(swigCPtr, txn, flags, mode);
  }

  public boolean exists(com.sleepycat.db.DbTxn txn) throws XmlException {
    return dbxml_javaJNI.XmlContainer_exists(swigCPtr, txn);
  }

  public boolean isOpen() throws XmlException {
    return dbxml_javaJNI.XmlContainer_isOpen(swigCPtr);
  }

  public void close(int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_close(swigCPtr, flags);
  }

  public void setIndexSpecification(com.sleepycat.db.DbTxn txn, XmlIndexSpecification index) throws XmlException {
    dbxml_javaJNI.XmlContainer_setIndexSpecification(swigCPtr, txn, XmlIndexSpecification.getCPtr(index));
  }

  public void addIndex(com.sleepycat.db.DbTxn txn, String uri, String name, String index) throws XmlException {
    dbxml_javaJNI.XmlContainer_addIndex(swigCPtr, txn, uri, name, index);
  }

  public void deleteIndex(com.sleepycat.db.DbTxn txn, String uri, String name, String index) throws XmlException {
    dbxml_javaJNI.XmlContainer_deleteIndex(swigCPtr, txn, uri, name, index);
  }

  public void replaceIndex(com.sleepycat.db.DbTxn txn, String uri, String name, String index) throws XmlException {
    dbxml_javaJNI.XmlContainer_replaceIndex(swigCPtr, txn, uri, name, index);
  }

  public void upgrade(int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_upgrade(swigCPtr, flags);
  }

  public XmlIndexSpecification getIndexSpecification(com.sleepycat.db.DbTxn txn) throws XmlException {
    long cPtr = dbxml_javaJNI.XmlContainer_getIndexSpecification(swigCPtr, txn);
    return (cPtr == 0) ? null : new XmlIndexSpecification(cPtr, true);
  }

  public String getName() throws XmlException {
    return dbxml_javaJNI.XmlContainer_getName(swigCPtr);
  }

  public void setName(String name) throws XmlException {
    dbxml_javaJNI.XmlContainer_setName(swigCPtr, name);
  }

  public int putDocument(com.sleepycat.db.DbTxn txn, XmlDocument document, XmlUpdateContext context, int flags) { return dbxml_javaJNI.XmlContainer_putDocument(swigCPtr, txn, XmlDocument.getCPtr(document), XmlUpdateContext.getCPtr(context), flags); }

  public void updateDocument(com.sleepycat.db.DbTxn txn, XmlDocument document, XmlUpdateContext context) throws XmlException {
    dbxml_javaJNI.XmlContainer_updateDocument(swigCPtr, txn, XmlDocument.getCPtr(document), XmlUpdateContext.getCPtr(context));
  }

  public void remove(com.sleepycat.db.DbTxn txn, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_remove(swigCPtr, txn, flags);
  }

  public void rename(com.sleepycat.db.DbTxn txn, String newName, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_rename(swigCPtr, txn, newName, flags);
  }

  public void deleteDocument(com.sleepycat.db.DbTxn txn, int id, XmlUpdateContext context, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_deleteDocument__SWIG_0(swigCPtr, txn, id, XmlUpdateContext.getCPtr(context), flags);
  }

  public void deleteDocument(com.sleepycat.db.DbTxn txn, XmlDocument document, XmlUpdateContext context, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_deleteDocument__SWIG_1(swigCPtr, txn, XmlDocument.getCPtr(document), XmlUpdateContext.getCPtr(context), flags);
  }

  public void modifyDocument(com.sleepycat.db.DbTxn txn, XmlModify modify, XmlUpdateContext context, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_modifyDocument(swigCPtr, txn, XmlModify.getCPtr(modify), XmlUpdateContext.getCPtr(context), flags);
  }

  public XmlDocument getDocument(com.sleepycat.db.DbTxn txn, int id, int flags) throws XmlException {
    long cPtr = dbxml_javaJNI.XmlContainer_getDocument(swigCPtr, txn, id, flags);
    return (cPtr == 0) ? null : new XmlDocument(cPtr, true);
  }

  public XmlQueryExpression parseXPathExpression(com.sleepycat.db.DbTxn txn, String query, XmlQueryContext context) throws XmlException {
    long cPtr = dbxml_javaJNI.XmlContainer_parseXPathExpression(swigCPtr, txn, query, XmlQueryContext.getCPtr(context));
    return (cPtr == 0) ? null : new XmlQueryExpression(cPtr, true);
  }

  public XmlResults queryWithXPath(com.sleepycat.db.DbTxn txn, String query, XmlQueryContext context, int flags) throws XmlException {
    long cPtr = dbxml_javaJNI.XmlContainer_queryWithXPath__SWIG_0(swigCPtr, txn, query, XmlQueryContext.getCPtr(context), flags);
    return (cPtr == 0) ? null : new XmlResults(cPtr, true);
  }

  public XmlResults queryWithXPath(com.sleepycat.db.DbTxn txn, XmlQueryExpression query, int flags) throws XmlException {
    long cPtr = dbxml_javaJNI.XmlContainer_queryWithXPath__SWIG_1(swigCPtr, txn, XmlQueryExpression.getCPtr(query), flags);
    return (cPtr == 0) ? null : new XmlResults(cPtr, true);
  }

  public void dump(String filename, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_dump(swigCPtr, filename, flags);
  }

  public void load(String filename, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_load(swigCPtr, filename, flags);
  }

  public void verify(String filename, int flags) throws XmlException {
    dbxml_javaJNI.XmlContainer_verify(swigCPtr, filename, flags);
  }

  public static void setLogLevel(int level, boolean enabled) throws XmlException {
    dbxml_javaJNI.XmlContainer_setLogLevel(level, enabled);
  }

  public static void setLogCategory(int category, boolean enabled) throws XmlException {
    dbxml_javaJNI.XmlContainer_setLogCategory(category, enabled);
  }

  public static int get_version_major() throws XmlException {
    return dbxml_javaJNI.XmlContainer_get_version_major();
  }

  public static int get_version_minor() throws XmlException {
    return dbxml_javaJNI.XmlContainer_get_version_minor();
  }

  public static int get_version_patch() throws XmlException {
    return dbxml_javaJNI.XmlContainer_get_version_patch();
  }

  public static String get_version_string() throws XmlException {
    return dbxml_javaJNI.XmlContainer_get_version_string();
  }

}
