|
Qizx/db 2.1 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Manages a group of XML Libraries.
A LibraryManager is a driver that manages a group of XML Libraries and
federates resources likes memory caches. It is from a LibraryManager that
User sessions (Library) are obtained, by calling the method
openLibrary(String, User).
A LibraryManager instance is obtained through a
LibraryManagerFactory, by opening or by creating a Library Group
(methods openLibraryGroup and createLibraryGroup respectively).
A Library Group is physically located in a directory of a file-system and
contains a XML file group.qlg that describes the structure of
the group (essentially a list of XML Libraries with their name and
location).
Note that there is no delete method for a group. To delete a group, simply delete its storage directory.
| Method Summary | |
void |
addLibraryObserver(LibraryMemberObserver observer)
Adds an observer of access and update operations. |
boolean |
closeAllLibraries(int graceTimeMillis)
Closes all the managed Libraries and release resources. |
Library |
createLibrary(String libraryName,
User user)
Creates a Library inside the storage directory of the Library group controlled by this LibraryManager. |
boolean |
deleteLibrary(String libraryName)
Physically destroys a Library. |
AccessControl |
getAccessControl()
Returns the current AccessControl object. |
LibraryMemberObserver[] |
getLibraryObservers()
Returns a list of active LibraryMemberObserver's. |
ModuleResolver |
getModuleResolver()
Returns the current ModuleResolver. |
File |
getStorageDirectory()
Returns the top-level directory of the Library Group. |
int |
getTransientDocumentCacheSize()
Gets the current maximum memory size for the document cache. |
String[] |
listLibraries()
Returns the names of XML Libraries managed by this object. |
Library |
openLibrary(String libraryName,
User user)
Opens a new work session on a Library. |
void |
removeLibraryObserver(LibraryMemberObserver observer)
Removes an observer of access and update operations. |
void |
setAccessControl(AccessControl accessControl)
Specifies an AccessControl object. |
void |
setModuleResolver(ModuleResolver resolver)
Sets the resolver used for resolving a module into actual locations. |
int |
setTransientDocumentCacheSize(int size)
Sets the maximum memory size for the document cache. |
| Method Detail |
public File getStorageDirectory()
public void setAccessControl(AccessControl accessControl)
This method should be called before opening sessions.
accessControl - an AccessControl object used for all managed
Libraries. It can be null, in which case, no access control is
performed (this is the default). This object is cloned for each
new session.public AccessControl getAccessControl()
null.
public void addLibraryObserver(LibraryMemberObserver observer)
observer - an object implementing this interface.public void removeLibraryObserver(LibraryMemberObserver observer)
observer - an object implementing this interface.public LibraryMemberObserver[] getLibraryObservers()
public Library createLibrary(String libraryName,
User user)
throws DataModelException
libraryName - symbolic name of a Libraryuser - a User with security credentials. Can be null if there is
no AccessControl set on the Library.
DataModelException - if specified library already exists
public Library openLibrary(String libraryName,
User user)
throws DataModelException
Notice that no authentication is performed at this level.
libraryName - symbolic name of a Libraryuser - a User with security credentials. Can be null if there is
no AccessControl set on the Library.
null if such library does
not exist
DataModelException - if there is a system access problem. This
happens normally only when the XML Library is already used by
another application.
public String[] listLibraries()
throws DataModelException
DataModelException - if there is a system access problem.
public boolean deleteLibrary(String libraryName)
throws DataModelException
libraryName - symbolic name of the Library to destroy
true if specified library has been deleted;
false otherwise (because such library does not
exist)
DataModelException - if there is a system access problem.
public boolean closeAllLibraries(int graceTimeMillis)
throws DataModelException
graceTimeMillis - a time in milliseconds for which the method will
wait if there are Library sessions with unfinished transactions.
After that time a rollback will be forced on all uncommitted
transactions.
true if all libraries have been closed without
forced rollback
DataModelException - if there is a system access problem.public int setTransientDocumentCacheSize(int size)
size - maximum memory size in bytes. Decreasing this size will flush the
cache accordingly.
public int getTransientDocumentCacheSize()
public void setModuleResolver(ModuleResolver resolver)
DefaultModuleResolver.
resolver - replacement for the current resolverpublic ModuleResolver getModuleResolver()
ModuleResolver.
|
© 2008 Axyana Software | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||