|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.Application
public final class Application
This class represents the BASE application and is the starting point for
all client applications. This class is used to start and stop the
application, create SessionControl
objects used for
user authentication, etc.
Nested Class Summary | |
---|---|
private static class |
Application.DbCleaner
|
static class |
Application.Pinger
A Pinger is an object that is used to protect another
object from timing out by automatically pinging it. |
private static class |
Application.SecondaryStorageControllerTask
|
private static class |
Application.SessionControlCacheCleaner
|
Field Summary | |
---|---|
private static String |
authenticationDriver
The name of the external authenication class, if any. |
private static boolean |
autoUnloadPlugins
Allow automatic unload of plug-in JAR files or not. |
private static String |
databaseVersionNumber
The name and version of the database server |
private static String |
dynamicCatalog
The name of the dynamic database. |
private static String |
dynamicSchema
The name of the dynamic schema. |
private static String |
extendedPropertiesFile
The path to the file containing extended properties. |
private static String |
hostName
The host name of the server running BASE. |
private static InternalJobQueue |
internalJobQueue
The internal job queue reference if it is enabled. |
private static boolean |
isRunning
If BASE is running or not. |
private static Logger |
log
Log core events. |
private static LogManagerFactory |
logManagerFactory
The log manager factory currently in use (may be null) |
private static String |
logManagerFactoryDriver
The name of the log manager factory class, if any. |
private static boolean |
noAutoCompression
If auto-compression has been enabled or not. |
private static File |
nonCorePluginDirectory
The directory where non-core plugins are located/installed. |
private static int |
permissionTimeout
Number of minutes permission information can be kept in memory before it must be reloaded. |
private static Set<Application.Pinger> |
pingers
|
private static String |
queryFile
The path to the file containing predefined queries. |
private static String |
rawDataTypesFile
The path to the file containing raw data types. |
private static Scheduler |
scheduler
An interface for adding timed task to the core timer. |
private static String |
secondaryStorageDriver
The name of the secondary storage controller class, if any. |
private static Map<String,SessionControl> |
sessionCache
A cache of SessionControl objects. |
private static int |
sessionCacheTimeout
Number of minutes a SessionControl object can be unused before it is removed from the cache. |
private static StaticCache |
staticCache
Cache for static data. |
private static Timer |
timer
The core timer which schedules events. |
private static File |
userFilesDirectory
The directory where uploaded files are stored. |
Constructor Summary | |
---|---|
Application()
|
Method Summary | |
---|---|
static boolean |
autoCompressionEnabled()
Check if auto-compression has been enabled or not. |
(package private) static boolean |
autoUnloadPlugins()
If external plug-in JAR files should automatically be unloaded if the are modified. |
private static void |
cleanSessionControlCache(boolean force)
Clean the cache from unused SessionControl objects. |
static String |
generateRandomId(int bytes)
Generate a random id. |
(package private) static Authenticator |
getAuthenticator()
Get an object of the class that is used for external authentication. |
static int |
getBuild()
Get the build number. |
(package private) static Timer |
getCoreTimer()
|
static String |
getDatabaseVersionString()
Gets the version of the database server |
(package private) static String |
getDynamicCatalog()
Get the name of the dynamic catalog. |
(package private) static String |
getDynamicSchema()
Get the name of the dynamic schema. |
(package private) static List<String> |
getExtendedPropertyFiles()
Get the path to the XML file containing extended properties. |
static String |
getHostName()
Get the host name of the server running BASE. |
(package private) static Logger |
getLogger()
Get the BASE core logger. |
(package private) static LogManagerFactory |
getLogManagerFactory()
Get the log manager factory, or null if not enabled. |
static String |
getMaintenanceVersion()
Get the maintenance version. |
static String |
getMajorVersion()
Get the major version. |
static String |
getMinorVersion()
Get the minor version. |
static File |
getNonCorePluginDirectory()
Get the directory where non-core plugins are located and installed |
(package private) static String |
getQueryFile()
Get the path to the XML file containing predefined queries for SQL and HQL. |
(package private) static List<String> |
getRawDataTypeFiles()
Get the path to the XML file containing raw data type definitions. |
static Scheduler |
getScheduler()
Get a scheduler that can be used for registering TimerTask
for executions. |
static int |
getSchemaVersion()
Get the current database schema version number. |
(package private) static SecondaryStorageController |
getSecondaryStorageController()
Get an object of the class that is used for seconary storage handling. |
static SessionControl |
getSessionControl(String sessionControlId,
String remoteId)
Get an existing SessionControl object if you know
the id. |
static StaticCache |
getStaticCache()
Get the static cache mananger. |
(package private) static File |
getUserFilesDirectory()
Get the path to the directory where uploaded files are stored. |
static String |
getVersionString()
Get the BASE version string. |
static boolean |
hasSecondaryStorage()
Checks if the server has configured a secondary storage or not. |
static boolean |
isRunning()
Check if BASE is running. |
static boolean |
isUsingInternalAuthentication()
Check if BASE is using internal or external authentication. |
static Application.Pinger |
newPinger(SessionControl sc)
Create a new Pinger object that is used
to keep a session control alive. |
(package private) static PluginSessionControl |
newPluginSessionControl(SessionControl parent,
PluginDefinition plugin,
Job job)
Create a new session control for executing plugins. |
static SessionControl |
newSessionControl(String externalClientId,
String remoteId,
String sessionControlId)
Create a new SessionControl object. |
static int |
permissionTimeout()
Get the maximum number of minutes permission information for a logged in user is kept in memory before beeing reloaded. |
static int |
sessionCacheTimeout()
Gets the maximum number of minutes before an active session is logged out. |
static void |
start()
Starts the BASE application. |
static void |
start(boolean useInternalJobQueue)
Starts the BASE application. |
(package private) static void |
start(boolean installation,
boolean verifySchemaVersion,
Boolean useInternalJobQueue)
Starts the BASE application. |
static void |
stop()
Stops the BASE application. |
private static void |
stopPinger(Application.Pinger p)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
private static boolean isRunning
private static String authenticationDriver
private static String secondaryStorageDriver
private static Map<String,SessionControl> sessionCache
private static int sessionCacheTimeout
private static volatile Timer timer
private static volatile Scheduler scheduler
private static int permissionTimeout
private static File userFilesDirectory
private static StaticCache staticCache
private static String queryFile
private static String extendedPropertiesFile
private static String rawDataTypesFile
private static String dynamicCatalog
private static String dynamicSchema
private static boolean autoUnloadPlugins
private static String hostName
private static InternalJobQueue internalJobQueue
private static String databaseVersionNumber
private static File nonCorePluginDirectory
private static boolean noAutoCompression
private static String logManagerFactoryDriver
private static LogManagerFactory logManagerFactory
private static Set<Application.Pinger> pingers
Constructor Detail |
---|
public Application()
Method Detail |
---|
public static String getMajorVersion()
public static String getMinorVersion()
public static String getMaintenanceVersion()
public static int getBuild()
public static String getVersionString()
public static int getSchemaVersion()
static Logger getLogger()
public static String getHostName()
public static String getDatabaseVersionString()
public static boolean isRunning()
start()
,
stop()
public static void start() throws BaseException
BaseException
- If BASE cannot be startedstop()
,
isRunning()
public static void start(boolean useInternalJobQueue)
useInternalJobQueue
- If the internal job queue should be
enabled or not
BaseException
- If BASE cannot be startedstart()
,
stop()
,
isRunning()
static void start(boolean installation, boolean verifySchemaVersion, Boolean useInternalJobQueue) throws BaseException
installation
- TRUE if we are starting the application for
installation, FALSE for a normal start
BaseException
- If BASE cannot be startedstart()
public static void stop() throws BaseException
BaseException
- If BASE cannot be stoppedstart()
,
isRunning()
public static boolean isUsingInternalAuthentication()
getAuthenticator()
static Authenticator getAuthenticator() throws BaseException
Authenticator
object, or null if
not using external authentication
BaseException
- If the authenticator class could not be loadedisUsingInternalAuthentication()
static LogManagerFactory getLogManagerFactory()
public static int permissionTimeout()
public static int sessionCacheTimeout()
public static boolean hasSecondaryStorage()
File.setLocation(Location)
static SecondaryStorageController getSecondaryStorageController()
SecondaryStorageController
object, or null if
BaseException
- If the controller class could not be loadedhasSecondaryStorage()
static File getUserFilesDirectory()
public static StaticCache getStaticCache()
static String getQueryFile()
PredefinedQuery
static List<String> getExtendedPropertyFiles()
ExtendedProperties
static List<String> getRawDataTypeFiles()
RawDataTypes
static String getDynamicCatalog()
static String getDynamicSchema()
static boolean autoUnloadPlugins()
public static File getNonCorePluginDirectory()
public static boolean autoCompressionEnabled()
File.setMimeTypeAuto(String, FileType)
and will automaically be compressed if auto-compression is enabled and
the MimeType.getAutoCompress()
returns TRUE.
public static SessionControl newSessionControl(String externalClientId, String remoteId, String sessionControlId) throws BaseException
SessionControl
object. If BASE is not
running it will be started.
externalClientId
- The external id for a registered client
application, or null if not importantremoteId
- An optional parameter identifying the remote
computer, for example the IP number. This should make it harder
to hijack a login by guessing a sessionControlId
.sessionControlId
- The id to give the new SessionControl
object, or null to generate a new id
ItemNotFoundException
- If no client with the specified
external id exists
ItemAlreadyExistsException
- If another SessionControl
with the given id already exists
BaseException
- If there is another errorSessionControl.getId()
static PluginSessionControl newPluginSessionControl(SessionControl parent, PluginDefinition plugin, Job job)
parent
- The parent session controlplugin
- The plugin to executejob
- The job that executes the plug-in, or null
public static SessionControl getSessionControl(String sessionControlId, String remoteId) throws ItemNotFoundException, BaseException
SessionControl
object if you know
the id.
sessionControlId
- The id of the SessionControl
objectremoteId
- If this parameter was passed to the newSessionControl
method, the same value must be passed here. Use, for example, the IP address
of the client computer. This should make it harder to hijack a login
by guessing a sessionControlId
SessionControl
object
ItemNotFoundException
- If an object with the specified id could not be found
PermissionDeniedException
- If the remote id is different from the remote id
that was passed when the SessionControl
object was created
BaseException
- If there is another errornewSessionControl(String,String,String)
,
SessionControl.getId()
private static void cleanSessionControlCache(boolean force)
SessionControl
objects.
force
- If TRUE all objects will be removed from the cache
regardless of if they are in use or notpublic static String generateRandomId(int bytes)
bytes
- The number of bytes of the id
static Timer getCoreTimer()
public static Scheduler getScheduler()
TimerTask
for executions. Each task that is added to the scheduler is executed in
it's own thread.
public static Application.Pinger newPinger(SessionControl sc)
Pinger
object that is used
to keep a session control alive.
sc
- The SessionControl that the pinger should protect
private static void stopPinger(Application.Pinger p)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |