StorageFactoryService
public interface PersistentService
These modules must only be used by the monitor.
Possible examples of implementations are:
This class also serves as the registry the defined name for all the implementations of PersistentService. These need to be kept track of as they can be used in JDBC URLS.
An implementation of PersistentService can implement ModuleSupportable but must not implement ModuleControl. This is because the monitor will not execute ModuleControl methods for a PersistentService.
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
CLASSPATH |
Service stored on the class path (can be in a zip/jar on the class path).
|
static java.lang.String |
DB_README_FILE_NAME |
The readme file cautioning users against touching the files in
the database directory
|
static java.lang.String |
DIRECTORY |
Service stored in a directory.
|
static java.lang.String |
HTTP |
Service stored in a web server .
|
static java.lang.String |
HTTPS |
|
static java.lang.String |
INMEMORY |
Service stored in memory only (not persistent), virtual file memory.
|
static java.lang.String |
JAR |
Service stored in a jar/zip archive.
|
static java.lang.String |
PROPERTIES_NAME |
The typical name for the service's properties file.
|
static java.lang.String |
ROOT |
The root of any stored data.
|
static java.lang.String |
TYPE |
The type of PersistentService used to boot the service.
|
Modifier and Type | Method | Description |
---|---|---|
void |
createDataWarningFile(StorageFactory sf) |
Put a readme file in database directory which will caution users
against touching any files in the directory.
|
java.lang.String |
createServiceRoot(java.lang.String name,
boolean deleteExisting) |
Returns the canonical name of the service.
|
java.util.Enumeration |
getBootTimeServices() |
Return an Enumeration of service names descriptors (Strings) that should be
be started at boot time by the monitor.
|
java.lang.String |
getCanonicalServiceName(java.lang.String name) |
Convert a service name into its canonical form.
|
java.util.Properties |
getServiceProperties(java.lang.String serviceName,
java.util.Properties defaultProperties) |
For a service return its service properties, typically from the service.properties
file.
|
StorageFactory |
getStorageFactoryInstance(boolean useHome,
java.lang.String databaseName,
java.lang.String tempDirName,
java.lang.String uniqueName) |
Get an initialized StorageFactoryInstance
|
java.lang.String |
getType() |
Return the type of this service.
|
java.lang.String |
getUserServiceName(java.lang.String serviceName) |
Return the user form of a service name.
|
boolean |
hasStorageFactory() |
|
boolean |
isSameService(java.lang.String serviceName1,
java.lang.String serviceName2) |
|
boolean |
removeServiceRoot(java.lang.String serviceName) |
Remove a service's root and its contents.
|
void |
saveServiceProperties(java.lang.String serviceName,
java.util.Properties properties) |
Save to a backup file.
|
void |
saveServiceProperties(java.lang.String serviceName,
StorageFactory storageFactory,
java.util.Properties properties,
boolean replace) |
static final java.lang.String DIRECTORY
static final java.lang.String CLASSPATH
static final java.lang.String JAR
static final java.lang.String HTTP
static final java.lang.String HTTPS
static final java.lang.String INMEMORY
static final java.lang.String DB_README_FILE_NAME
static final java.lang.String PROPERTIES_NAME
static final java.lang.String ROOT
static final java.lang.String TYPE
java.lang.String getType()
java.util.Enumeration getBootTimeServices()
This method may return null if there are no services that need to be booted automatically at boot time.
The service name returned by the Enumeration must be in its canonical form.
void createDataWarningFile(StorageFactory sf) throws StandardException
sf
- StorageFactory will be used to create the fileStandardException
- File can't be createdjava.util.Properties getServiceProperties(java.lang.String serviceName, java.util.Properties defaultProperties) throws StandardException
StandardException
- Service appears valid but the properties cannot be created.void saveServiceProperties(java.lang.String serviceName, StorageFactory storageFactory, java.util.Properties properties, boolean replace) throws StandardException
StandardException
- Properties cannot be saved.void saveServiceProperties(java.lang.String serviceName, java.util.Properties properties) throws StandardException
StandardException
- Properties cannot be saved.java.lang.String createServiceRoot(java.lang.String name, boolean deleteExisting) throws StandardException
StandardException
- Service root cannot be created.boolean removeServiceRoot(java.lang.String serviceName)
java.lang.String getCanonicalServiceName(java.lang.String name) throws StandardException
StandardException
- if an error happens when converting the
name (name probably invalid)java.lang.String getUserServiceName(java.lang.String serviceName)
boolean isSameService(java.lang.String serviceName1, java.lang.String serviceName2)
boolean hasStorageFactory()
StorageFactory getStorageFactoryInstance(boolean useHome, java.lang.String databaseName, java.lang.String tempDirName, java.lang.String uniqueName) throws StandardException, java.io.IOException
useHome
- If true and the database name is not absolute then the database directory will be
relative to the home directory, if one is defined in the properties file.databaseName
- The name of the database (directory). The name does not include the subSubProtocol.
If null then the storage factory will only be used to deal with the directory containing
the databases.tempDirName
- The name of the temporary file directory set in properties. If null then a default
directory should be used. Each database should get a separate temporary file
directory within this one to avoid collisions.uniqueName
- A unique name that can be used to create the temporary file directory for this database.
If null then temporary files will not be created in this StorageFactory instance.StandardException
java.io.IOException
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.