Berkeley DB XML
version 2.5.16

com.sleepycat.dbxml
Class XmlCompression

java.lang.Object
  extended by com.sleepycat.dbxml.XmlCompression

public class XmlCompression
extends Object

XmlCompression is a base class for implementations of custom compression for a container. Compression is only used by whole document storage containers. To use customized compression the implementation must be registered with the XmlManager using XmlManager.registerCompression(java.lang.String, com.sleepycat.dbxml.XmlCompression) and the container must be created by passing an XmlContainerConfig object to XmlManager.createContainer(java.lang.String) that includes the name under which the instance was registered (see XmlContainerConfig.setCompression(java.lang.String)). Compression is a persistent attribute of a container. A container created with custom compression requires that the same named compression instance be registered with the XmlManager or any attempt to open the container will fail. XmlCompression instances must be free-threaded and safe to use concurrently.


Constructor Summary
XmlCompression()
           
 
Method Summary
 boolean compress(XmlTransaction txn, XmlData source, XmlData dest)
          This method is called to compress the source into the destination.
 boolean decompress(XmlTransaction txn, XmlData source, XmlData dest)
          This method is called to decompress the source into the destination.
 void delete()
          Releases the native resources associated with this object, this method should be called from custom implement compression class when compression is done.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlCompression

public XmlCompression()
Method Detail

delete

public void delete()
Releases the native resources associated with this object, this method should be called from custom implement compression class when compression is done.


compress

public boolean compress(XmlTransaction txn,
                        XmlData source,
                        XmlData dest)
                 throws XmlException
This method is called to compress the source into the destination.

Parameters:
txn - The active transaction. It may be null.
source - An XmlData object containing the content to be compressed.
dest - An XmlData object for the resulting compressed content.
Returns:
true on success, false on failure.
Throws:
XmlException

decompress

public boolean decompress(XmlTransaction txn,
                          XmlData source,
                          XmlData dest)
                   throws XmlException
This method is called to decompress the source into the destination.

Parameters:
txn - The active transaction. It may be null.
source - An XmlData object containing the compressed content.
dest - An XmlData object for the resulting uncompressed content.
Returns:
true on success, false on failure.
Throws:
XmlException

Berkeley DB XML
version 2.5.16

Copyright (c) 1996,2009 Oracle. All rights reserved.