Framework Professional Edition Package


com.prosyst.mbs.services.db
Interface DBManager


public interface DBManager

The DBManager is a service, that is used to obtain or create a custom storage for saving a type-safe data. The user of the service is allowed to use it's own instance or to use a global instance of the Database.

Author:
Svetozar Dimov

Field Summary
static java.lang.String MAIN_DB
          This is the name of the main DB instance.
 
Method Summary
 DB getCustomDB(java.io.File root)
          Retrieves or creates a custom DB in the root directory.
 DB getCustomDB(java.lang.String alias)
          Retrieves or creates a custom DB implementation.
 DB getCustomDB(java.lang.String alias, java.io.File root)
          Retrieves or creates a custom DB in the root directory.
 void save()
          Deprecated.  
 void ungetCustomDB(DB dbCustom)
          Releases the DB instance.
 void ungetCustomDB(java.lang.String alias)
          Releases the DB instance mapped to the alias.
 

Field Detail

MAIN_DB

static final java.lang.String MAIN_DB
This is the name of the main DB instance. The value is "
"

See Also:
Constant Field Values
Method Detail

getCustomDB

DB getCustomDB(java.io.File root)
               throws java.io.IOException
Retrieves or creates a custom DB in the root directory. root must be a valid & existing directory.

Parameters:
root - the root directory where the DB is stored
Returns:
a DB instance, that is stored in the specified folder
Throws:
java.io.IOException - if the DB cannot be created

getCustomDB

DB getCustomDB(java.lang.String alias,
               java.io.File root)
               throws java.io.IOException
Retrieves or creates a custom DB in the root directory. root must be a valid & existing directory. The DB instance is mapped to the alias.

Parameters:
alias - the alias to which the DB instance is mapped
root - the root directory where the DB is stored
Returns:
a DB instance, that is stored in the specified folder
Throws:
java.io.IOException - if the DB cannot be created

getCustomDB

DB getCustomDB(java.lang.String alias)
               throws java.io.IOException
Retrieves or creates a custom DB implementation. The DB instance is mapped to the alias. The alias is used as a file name, relative to the DB bundle's data storage area. If such a directory can not be created, IOException is thrown

Parameters:
alias - the alias used to reference that DB instance
Returns:
a DB instance, that is mapped to the specified alias
Throws:
java.io.IOException - if the DB cannot be created

ungetCustomDB

void ungetCustomDB(DB dbCustom)
                   throws java.io.IOException
Releases the DB instance. If no-one uses the DB instance, this method will close it and discard it.

Parameters:
dbCustom - the DB instance, that will be released
Throws:
java.io.IOException

ungetCustomDB

void ungetCustomDB(java.lang.String alias)
                   throws java.io.IOException
Releases the DB instance mapped to the alias. If no-one uses the DB instance, this method will close it and discard it.

Parameters:
alias - the alias used to reference a DB instance
Throws:
java.io.IOException

save

void save()
          throws java.io.IOException
Deprecated. 

Saves all DB instances. Please don't use that method anymore as it is deprecated.

Throws:
java.io.IOException - if save operation cannot be performed

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved