Qizx/db 2.1 API

com.qizx.api
Class LibraryManagerFactory

java.lang.Object
  extended bycom.qizx.api.LibraryManagerFactory

public abstract class LibraryManagerFactory
extends Object

Factory used to initialize a LibraryManager, either by opening an existing group of XML Libraries stored in a file-system, or by creating a new group.


Constructor Summary
protected LibraryManagerFactory()
          Default constructor is protected on purpose.
 
Method Summary
abstract  LibraryManager createLibraryGroup(File storageDir)
          Creates a group of XML Libraries at the specified directory location and returns a LibraryManager controlling this group.
static LibraryManagerFactory getInstance()
          Creates an instance of the factory, which can be used to configure a LibraryManager.
abstract  long getMemoryLimit()
          Defines the maximum memory size the generated LibraryManager can use.
abstract  LibraryManager openLibraryGroup(File storageDir)
          Starts a manager controlling an existing group of XML Libraries.
abstract  void setMemoryLimit(long size)
          Defines the maximum memory size the generated LibraryManager can use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibraryManagerFactory

protected LibraryManagerFactory()
Default constructor is protected on purpose.

Method Detail

getInstance

public static LibraryManagerFactory getInstance()
Creates an instance of the factory, which can be used to configure a LibraryManager.

Returns:
a unique instance of this factory

createLibraryGroup

public abstract LibraryManager createLibraryGroup(File storageDir)
                                           throws QizxException
Creates a group of XML Libraries at the specified directory location and returns a LibraryManager controlling this group.

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

Parameters:
storageDir - a directory which is the location of the Library Group. This directory contains an XML file group.qlg that describes the Group.
Returns:
an active LibraryManager managing the new group.
Throws:
QizxException - if storageDir exists and is not empty.

openLibraryGroup

public abstract LibraryManager openLibraryGroup(File storageDir)
                                         throws QizxException
Starts a manager controlling an existing group of XML Libraries.

Parameters:
storageDir - a directory which is the location of the Library Group. This directory contains an XML file group.qlg that describes the Group.
Returns:
an active LibraryManager managing the group.
Throws:
QizxException - if storageDir has not been initialized by invoking createLibraryGroup(File).

setMemoryLimit

public abstract void setMemoryLimit(long size)
Defines the maximum memory size the generated LibraryManager can use.

Parameters:
size - maximum size in bytes of memory allocated to the LibraryManager.
See Also:
getMemoryLimit()

getMemoryLimit

public abstract long getMemoryLimit()
Defines the maximum memory size the generated LibraryManager can use.

Returns:
maximum size in bytes of memory allocated to the LibraryManager.
See Also:
setMemoryLimit(long)

© 2008 Axyana Software