| org.apache.derby.iapi.services.monitor.PersistentService
All known Subclasses: org.apache.derby.impl.services.monitor.StorageFactoryService,
PersistentService | public interface PersistentService (Code) | | A PersistentService modularises the access to persistent services,
abstracting out details such as finding the list of services to
be started at boot time, finding the service.properties file
and creating and deleting the persistent storage for a service.
These modules must only be used by the monitor.
Possible examples of implementations are:
- Store services in a directory in the file system.
- Store services in a zip file
- Service data is provided by a web server
- Service data is stored on the class path.
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.
|
Field Summary | |
final public static String | CLASSPATH Service stored on the class path (can be in a zip/jar on the class path). | final public static String | DIRECTORY Service stored in a directory. | final public static String | HTTP Service stored in a web server . | final public static String | HTTPS | final public static String | JAR Service stored in a jar/zip archive. | final public static String | PROPERTIES_NAME The typical name for the service's properties file. | final public static String | ROOT The root of any stored data. | final public static String | TYPE The type of PersistentService used to boot the service. |
Method Summary | |
public String | createServiceRoot(String name, boolean deleteExisting) Returns the canonical name of the service. | public Enumeration | getBootTimeServices() Return an Enumeration of service names descriptors (Strings) that should be
be started at boot time by the monitor. | public String | getCanonicalServiceName(String name) Convert a service name into its canonical form. | public Properties | getServiceProperties(String serviceName, Properties defaultProperties) For a service return its service properties, typically from the service.properties
file. | public StorageFactory | getStorageFactoryInstance(boolean useHome, String databaseName, String tempDirName, String uniqueName) Get an initialized StorageFactoryInstance
Parameters: useHome - If true and the database name is not absolute then the database directory will berelative to the home directory, if one is defined in the properties file. Parameters: databaseName - The name of the database (directory). | public String | getType() Return the type of this service. | public String | getUserServiceName(String serviceName) Return the user form of a service name. | public boolean | hasStorageFactory() | public boolean | isSameService(String serviceName1, String serviceName2) | public boolean | removeServiceRoot(String serviceName) Remove a service's root and its contents. | public void | saveServiceProperties(String serviceName, StorageFactory storageFactory, Properties properties, boolean replace) | public void | saveServiceProperties(String serviceName, Properties properties, boolean replace) Save to a backup file. |
CLASSPATH | final public static String CLASSPATH(Code) | | Service stored on the class path (can be in a zip/jar on the class path).
|
DIRECTORY | final public static String DIRECTORY(Code) | | Service stored in a directory.
|
HTTP | final public static String HTTP(Code) | | Service stored in a web server .
|
JAR | final public static String JAR(Code) | | Service stored in a jar/zip archive.
|
PROPERTIES_NAME | final public static String PROPERTIES_NAME(Code) | | The typical name for the service's properties file.
|
ROOT | final public static String ROOT(Code) | | The root of any stored data.
|
TYPE | final public static String TYPE(Code) | | The type of PersistentService used to boot the service.
|
getBootTimeServices | public Enumeration getBootTimeServices()(Code) | | Return an Enumeration of service names descriptors (Strings) that should be
be started at boot time by the monitor. The monitor will boot the service if getServiceProperties()
returns a Properties object and the properties does not indicate the service should not be
auto-booted.
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.
|
getCanonicalServiceName | public String getCanonicalServiceName(String name) throws StandardException(Code) | | Convert a service name into its canonical form. Returns null if the name
cannot be converted into a canonical form.
exception: No - canonical name, name probably invalid |
getServiceProperties | public Properties getServiceProperties(String serviceName, Properties defaultProperties) throws StandardException(Code) | | For a service return its service properties, typically from the service.properties
file.
A Properties object or null if serviceName does not represent a valid service. exception: StandardException - Service appears valid but the properties cannot be created. |
getStorageFactoryInstance | public StorageFactory getStorageFactoryInstance(boolean useHome, String databaseName, String tempDirName, String uniqueName) throws StandardException, IOException(Code) | | Get an initialized StorageFactoryInstance
Parameters: useHome - If true and the database name is not absolute then the database directory will berelative to the home directory, if one is defined in the properties file. Parameters: 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 containingthe databases. Parameters: tempDirName - The name of the temporary file directory set in properties. If null then a defaultdirectory should be used. Each database should get a separate temporary filedirectory within this one to avoid collisions. Parameters: 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. An initialized StorageFactory. |
getType | public String getType()(Code) | | Return the type of this service.
|
getUserServiceName | public String getUserServiceName(String serviceName)(Code) | | Return the user form of a service name. This name is only valid within
this system. The separator character used must be '/'
|
hasStorageFactory | public boolean hasStorageFactory()(Code) | | true if the PersistentService has a StorageFactory, false if not. |
removeServiceRoot | public boolean removeServiceRoot(String serviceName)(Code) | | Remove a service's root and its contents.
|
|
|