Qizx fe-4.4p2 API

com.qizx.api
Class Configuration

java.lang.Object
  extended by com.qizx.api.Configuration

public class Configuration
extends Object

Bootstrap Configuration for Qizx.

Replaces the deprecated LibraryManagerFactory.

Methods of this class allow:


Nested Class Summary
static class Configuration.Property
          Properties of Qizx Configuration.
 
Field Summary
static Configuration.Property ALLOWED_CLASSES
          List of classes allowed for Java function Binding.
static Configuration.Property CONTENT_IMPORTERS
          List of extension classes for import of semistructured content into an XML Library.
static Configuration.Property DOC_BLOCK_SIZE
          Size of blocks used for XML document storage.
static Configuration.Property DOC_COMPRESS
          Compression for XML document storage.
static Configuration.Property DOC_INDEX_COMPRESS
          Compression for XML dmocument indexes.
static Configuration.Property DOC_NODE_STATS
          Addition of Data-Model statistics as meta-properties of Documents
static Configuration.Property DOC_SEGMENT_MAX_COUNT
          Number of index segments of similar size that triggers a segment compaction (unless this would create a segment larger than specified property DOC_SEGMENT_MAX_SIZE).
static Configuration.Property DOC_SEGMENT_MAX_SIZE
          Maximum size in bytes for document index segments.
static Configuration.Property FULLTEXT_FACTORY
          Class used as a default FullTextFactory.
static Configuration.Property LARGE_TX_DUPLICATE_CHECK
          Checking of duplicate document paths inside large transactions (uses more memory).
static Configuration.Property LOGGING_LEVEL
          Logging level applied to all XML Libraries.
static Configuration.Property LONG_COMPACTION_SIZE
          Size threshold in index compaction for using a separate thread.
static Configuration.Property MEMORY_LIMIT
          Maximum memory size used by a LibraryManager (in bytes).
static Configuration.Property META_BLOCK_SIZE
          Size of blocks used for meta-properties storage.
static Configuration.Property META_COMPRESS
          Compression for metadata properties.
static Configuration.Property META_INDEX_COMPRESS
          Compression for metadata indexes.
static Configuration.Property META_SEGMENT_MAX_COUNT
          Number of index segments of similar size that triggers a segment compaction (unless this would create a segment larger than specified property META_SEGMENT_MAX_SIZE).
static Configuration.Property META_SEGMENT_MAX_SIZE
          Maximum size in bytes for metadata index segments (segment compaction will not create larger segments than this size)
static Configuration.Property[] properties
           
static Configuration.Property READONLY_MODE
          Read-only mode for new sessions.
static Configuration.Property SHUTDOWN_COMPACTER_DELAY
          Cut-off time on shutdown (closeAllLibraries) granted to cleanup and index optimization tasks.
static Configuration.Property SYNC_COMMIT
          Control of file-system sync on each commit for data safety.
static Configuration.Property TRANSIENT_DOCUMENT_CACHE_SIZE
          Size in bytes of the cache of parsed (or transient) XML documents.
static Configuration.Property XQUERY_DEFAULT_COLLATION
           
static Configuration.Property XQUERY_IMPLICIT_TIMEZONE
           
static Configuration.Property XQUERY_STRICT_COMPLIANCE
           
static Configuration.Property XQUERY_STRICT_TYPING
           
 
Method Summary
static void addContentImporter(String className)
          Defines a ContentImporter by its class name.
static LibraryManager createLibraryGroup(File groupDirectory)
          Creates a group of XML Libraries and the LibraryManager controlling it.
static LibraryManager createLibraryManager()
          Creates a LibraryManager without group directory and without XML Libraries.
static XQuerySessionManager createSessionManager(String baseURI)
          Creates a plain Session Manager.
static void defineExtensionDirectory(File directory)
          Defines a directory containing extension jars.
static void defineExtensionJar(File jarFile)
          Defines an extension jars for add-ons.
static String getAllowedClasses()
          Returns a list of classes allowed for Java Binding.
static Class<?> getExtensionClass(String className)
          (Internal) finds a class name using extended classpath.
static Object instantiate(String className)
          (Internal) instantiates a class name using extended classpath.
static Object instantiate(String className, Class<?> implemented)
          (Internal) instantiates a class name using extended classpath.
static ContentImporter instantiateImporter(String formatName)
          (Internal) instantiates a ContentImporter by its symbolic name.
static File locateLibrary(File location)
          Tests whether a directory contains an XML Library.
static LibraryManager openLibraryGroup(File groupDirectory)
          Starts a LibraryManager controlling an existing group of XML Libraries.
static void set(Configuration.Property property, Object value)
          Sets a property, which will be inherited by LibraryManagers created by createLibraryGroup(File), openLibraryGroup(File) or createLibraryManager().
static void setLogHandler(Handler handler)
          Defines a bootstrap Log Handler used when creating LibraryManagers or plain sessions.
static void setup(Properties properties)
          Defines a set of properties which will be inherited by LibraryManagers created by createLibraryGroup(File), openLibraryGroup(File) or createLibraryManager().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGING_LEVEL

public static final Configuration.Property LOGGING_LEVEL
Logging level applied to all XML Libraries. Default value is "info", accepted values are "error", "warning", "info", and "debug".


MEMORY_LIMIT

public static final Configuration.Property MEMORY_LIMIT
Maximum memory size used by a LibraryManager (in bytes). Setting this property on a LibraryManager is similar to use setMemoryLimit().


READONLY_MODE

public static final Configuration.Property READONLY_MODE
Read-only mode for new sessions. Applicable to all Libraries.


SYNC_COMMIT

public static final Configuration.Property SYNC_COMMIT
Control of file-system sync on each commit for data safety. Caution: this can slow down commits on some file-systems like ext4.


SHUTDOWN_COMPACTER_DELAY

public static final Configuration.Property SHUTDOWN_COMPACTER_DELAY
Cut-off time on shutdown (closeAllLibraries) granted to cleanup and index optimization tasks. Value in seconds


TRANSIENT_DOCUMENT_CACHE_SIZE

public static final Configuration.Property TRANSIENT_DOCUMENT_CACHE_SIZE
Size in bytes of the cache of parsed (or transient) XML documents. This is equivalent to calling setTransientDocumentCacheSize on LibraryManager or XQuerySessionManager


FULLTEXT_FACTORY

public static final Configuration.Property FULLTEXT_FACTORY
Class used as a default FullTextFactory.


CONTENT_IMPORTERS

public static final Configuration.Property CONTENT_IMPORTERS
List of extension classes for import of semistructured content into an XML Library.

The value is a comma-separated list of class names, each class must implement ContentImporter.

Example: "com.qizx.xmodule.importer.json.JsonImporter


ALLOWED_CLASSES

public static final Configuration.Property ALLOWED_CLASSES
List of classes allowed for Java function Binding.

The value is a comma-separated list of class names.

Example: "org.expath.zip.qizx.Functions"


DOC_NODE_STATS

public static final Configuration.Property DOC_NODE_STATS
Addition of Data-Model statistics as meta-properties of Documents


DOC_COMPRESS

public static final Configuration.Property DOC_COMPRESS
Compression for XML document storage.

Value is boolean, default value is true.


DOC_INDEX_COMPRESS

public static final Configuration.Property DOC_INDEX_COMPRESS
Compression for XML dmocument indexes.

Value is boolean, default value is true.


DOC_SEGMENT_MAX_SIZE

public static final Configuration.Property DOC_SEGMENT_MAX_SIZE
Maximum size in bytes for document index segments. (segment compaction will not create larger segments than this size)

Value is Long, default value is 6 Gigabytes.


DOC_SEGMENT_MAX_COUNT

public static final Configuration.Property DOC_SEGMENT_MAX_COUNT
Number of index segments of similar size that triggers a segment compaction (unless this would create a segment larger than specified property DOC_SEGMENT_MAX_SIZE).

Value is integer, default value is 8.


DOC_BLOCK_SIZE

public static final Configuration.Property DOC_BLOCK_SIZE
Size of blocks used for XML document storage.


META_COMPRESS

public static final Configuration.Property META_COMPRESS
Compression for metadata properties.

Value is boolean, default value is true.


META_INDEX_COMPRESS

public static final Configuration.Property META_INDEX_COMPRESS
Compression for metadata indexes.

Value is boolean, default value is true.


META_SEGMENT_MAX_SIZE

public static final Configuration.Property META_SEGMENT_MAX_SIZE
Maximum size in bytes for metadata index segments (segment compaction will not create larger segments than this size)

Value is Long, default value is 0.5 Gigabytes.


META_SEGMENT_MAX_COUNT

public static final Configuration.Property META_SEGMENT_MAX_COUNT
Number of index segments of similar size that triggers a segment compaction (unless this would create a segment larger than specified property META_SEGMENT_MAX_SIZE).


META_BLOCK_SIZE

public static final Configuration.Property META_BLOCK_SIZE
Size of blocks used for meta-properties storage.


LARGE_TX_DUPLICATE_CHECK

public static final Configuration.Property LARGE_TX_DUPLICATE_CHECK
Checking of duplicate document paths inside large transactions (uses more memory).

Value is boolean, default value is true.


LONG_COMPACTION_SIZE

public static final Configuration.Property LONG_COMPACTION_SIZE
Size threshold in index compaction for using a separate thread.


XQUERY_IMPLICIT_TIMEZONE

public static final Configuration.Property XQUERY_IMPLICIT_TIMEZONE

XQUERY_DEFAULT_COLLATION

public static final Configuration.Property XQUERY_DEFAULT_COLLATION

XQUERY_STRICT_TYPING

public static final Configuration.Property XQUERY_STRICT_TYPING

XQUERY_STRICT_COMPLIANCE

public static final Configuration.Property XQUERY_STRICT_COMPLIANCE

properties

public static Configuration.Property[] properties
Method Detail

setup

public static void setup(Properties properties)
                  throws IllegalArgumentException
Defines a set of properties which will be inherited by LibraryManagers created by createLibraryGroup(File), openLibraryGroup(File) or createLibraryManager().

Parameters:
properties -
Throws:
IllegalArgumentException

set

public static void set(Configuration.Property property,
                       Object value)
                throws IllegalArgumentException
Sets a property, which will be inherited by LibraryManagers created by createLibraryGroup(File), openLibraryGroup(File) or createLibraryManager().

Parameters:
property - see Configuration.Property
value - see each Configuration.Property
Throws:
IllegalArgumentException

getAllowedClasses

public static String getAllowedClasses()
Returns a list of classes allowed for Java Binding.

These classes are defined by set(ALLOWED_CLASSES, names). Notice that this property value is cumulative: repeated calls add new names to the current list. To erase the lsit, set a value of null.

Returns:
a comma-separated list of full class names.

setLogHandler

public static void setLogHandler(Handler handler)
Defines a bootstrap Log Handler used when creating LibraryManagers or plain sessions.

Parameters:
handler -

defineExtensionJar

public static void defineExtensionJar(File jarFile)
Defines an extension jars for add-ons.

Parameters:
jarFile - a jar file.

defineExtensionDirectory

public static void defineExtensionDirectory(File directory)
Defines a directory containing extension jars. Recursively scans this directory.

Parameters:
directory - a readable directory

getExtensionClass

public static Class<?> getExtensionClass(String className)
                                  throws ClassNotFoundException
(Internal) finds a class name using extended classpath.

Parameters:
className - full name of a class
Throws:
ClassNotFoundException

instantiate

public static Object instantiate(String className)
                          throws InstantiationException
(Internal) instantiates a class name using extended classpath.

Parameters:
className - full name of a class
Throws:
InstantiationException

instantiate

public static Object instantiate(String className,
                                 Class<?> implemented)
                          throws InstantiationException
(Internal) instantiates a class name using extended classpath. Checks the implements the 'implemented' class.

Parameters:
className - full name of a class
implemented - a superclass or interface
Throws:
InstantiationException

createSessionManager

public static XQuerySessionManager createSessionManager(String baseURI)
                                                 throws QizxException
Creates a plain Session Manager. This method is to be preferred to direct creation with new XQuerySessionManager().

Sets a default Module Resolver with a base URI and a default cache for parsed documents.

Parameters:
baseURI - a base URI for resolution of modules.
Returns:
a XQuerySessionManager.
Throws:
QizxException - if storageDir exists and is not empty.

locateLibrary

public static File locateLibrary(File location)
                          throws FileNotFoundException
Tests whether a directory contains an XML Library.

Parameters:
location - a directory supposedly containing an XML Library. It can also be any file or directory within an XML Library.
Returns:
the directory containing the Qizx XML Library, or null if the location does not correspond to an XML Library.
Throws:
FileNotFoundException - if parent directory cannot be accessed
Since:
4.0

createLibraryManager

public static LibraryManager createLibraryManager()
                                           throws QizxException
Creates a LibraryManager without group directory and without XML Libraries.

Libraries can then be managed through LibraryManager.manageLibrary(java.lang.String, java.io.File) or created through LibraryManager.createLibrary(java.lang.String, java.io.File).

Returns:
an active LibraryManager managing the new group.
Throws:
QizxException - if storageDir exists and is not empty.

createLibraryGroup

public static LibraryManager createLibraryGroup(File groupDirectory)
                                         throws QizxException
Creates a group of XML Libraries and the LibraryManager controlling it.

There is initially no XML Library in the created group. A Library can be added by LibraryManager.createLibrary(java.lang.String, java.io.File).

Parameters:
groupDirectory - a directory which is the location of the Library Group. This directory is created if it does not exist.
Returns:
an active LibraryManager managing the new group.
Throws:
QizxException - if storageDir exists and is not empty.

openLibraryGroup

public static LibraryManager openLibraryGroup(File groupDirectory)
                                       throws QizxException
Starts a LibraryManager controlling an existing group of XML Libraries.

XML Libraries are located as sub-directories of the 'group directory'. They are found by scanning the group directory (the descriptor file group.qlg is deprecated).

Parameters:
groupDirectory - a directory which is the root location of the group.
Returns:
an active LibraryManager managing the group.
Throws:
QizxException - if storageDir has not been initialized by invoking createLibraryGroup(File).

addContentImporter

public static void addContentImporter(String className)
                               throws InstantiationException
Defines a ContentImporter by its class name.

Parameters:
className - full class name.
Throws:
InstantiationException

instantiateImporter

public static ContentImporter instantiateImporter(String formatName)
                                           throws InstantiationException
(Internal) instantiates a ContentImporter by its symbolic name.

Parameters:
formatName - symbolic name, e.g "json".
Throws:
InstantiationException

© 2010 Axyana Software