blackboard.platform.config
Interface ConfigurationService

All Superinterfaces:
blackboard.platform.CorePlatformService, blackboard.platform.SingletonService

public interface ConfigurationService
extends blackboard.platform.CorePlatformService, blackboard.platform.SingletonService

Core platform service that provides access to file-system based configuration information. System registry configuration should be loaded through the RegistryDbLoader.

Since:
Bb 5.5

Method Summary
 void addCustomProperties(java.lang.String configName, java.io.File customConfigFile, boolean mustExist)
          Provision for implementations of ApplicationLauncher to provide non-relative locations for client manipulated configuration properties.
 void configServiceInit(java.io.File blackboardRootDir, java.util.Properties bbServicesProps)
           
 java.io.File createTempFile()
          Creates a temp file in the Bb temp file space.
 java.util.Properties getBbProperties()
          Returns aggregate of bb-config.properties and properties from active service manager config.
 java.lang.String getBbProperty(java.lang.String key)
          Shortcut to return an individual property from bb-config.properties or from this service manager's config file.
 java.lang.String getBbProperty(java.lang.String key, java.lang.String defaultIfNotFound)
          Shortcut to return an individual property from bb-config.properties or from this service manager's config file.
 java.io.File getBlackboardDir()
          Returns the directory in which the Blackboard application is installed.
 java.io.File getConfiguredFile(java.lang.String propertyName, boolean mustExist)
          Utility for service implementations to get a file path from the configured properties.
 java.io.File[] getConfiguredFiles(java.lang.String propertyName, boolean mustExist)
          Utility for service implementations to get a file list from the configured properties.
 java.util.Properties getCustomProperties(java.lang.String configName, boolean mustExist)
          Provision for implementations of ApplicationLauncher to provide non-relative locations for client manipulated configuration properties.
 java.lang.String getDefaultEncoding()
          Get default charset from bb config properties file.
 java.io.File getLocaleDir()
          Returns the base directory in which locale packs are installed.
 java.io.File getSharedContentDir()
          Returns the directory in which shared content is kept
 java.io.File getTempDir()
           
 java.io.File resolveFile(java.lang.String relativePath)
          Resolves the specified file.
 java.io.File resolveFile(java.lang.String relativePath, boolean bMustExist)
          Resolves the specified file.
 
Methods inherited from interface blackboard.platform.CorePlatformService
getServiceInterface, serviceInit, serviceShutdown, serviceStartup
 

Method Detail

configServiceInit

void configServiceInit(java.io.File blackboardRootDir,
                       java.util.Properties bbServicesProps)
                       throws InitializationException
Throws:
InitializationException

getBbProperties

java.util.Properties getBbProperties()
Returns aggregate of bb-config.properties and properties from active service manager config.


getBbProperty

java.lang.String getBbProperty(java.lang.String key)
Shortcut to return an individual property from bb-config.properties or from this service manager's config file.


getBbProperty

java.lang.String getBbProperty(java.lang.String key,
                               java.lang.String defaultIfNotFound)
Shortcut to return an individual property from bb-config.properties or from this service manager's config file.


getDefaultEncoding

java.lang.String getDefaultEncoding()
Get default charset from bb config properties file. If not found, set charset to "UTF-8"


getBlackboardDir

java.io.File getBlackboardDir()
Returns the directory in which the Blackboard application is installed.


getSharedContentDir

java.io.File getSharedContentDir()
Returns the directory in which shared content is kept


getLocaleDir

java.io.File getLocaleDir()
Returns the base directory in which locale packs are installed.


resolveFile

java.io.File resolveFile(java.lang.String relativePath)
                         throws InitializationException
Resolves the specified file. Path may be use forward or back slash as separator. If not absolute, then file is resolved as relative to the blackboard directory.

Throws:
InitializationException - if file does not exist

resolveFile

java.io.File resolveFile(java.lang.String relativePath,
                         boolean bMustExist)
                         throws InitializationException
Resolves the specified file. Path may be use forward or back slash as separator. If not absolute, then file is resolved as relative to the blackboard directory.

Throws:
InitializationException - if file does not exist

getTempDir

java.io.File getTempDir()
                        throws java.io.IOException
Throws:
java.io.IOException

createTempFile

java.io.File createTempFile()
                            throws java.io.IOException
Creates a temp file in the Bb temp file space. The file will automatically be deleted when the VM exits.

Throws:
java.io.IOException

getConfiguredFile

java.io.File getConfiguredFile(java.lang.String propertyName,
                               boolean mustExist)
                               throws InitializationException
Utility for service implementations to get a file path from the configured properties.

Throws:
InitializationException - if the property is not found in the config file or if the requested file does not exist when required (mustExist == true ).

getConfiguredFiles

java.io.File[] getConfiguredFiles(java.lang.String propertyName,
                                  boolean mustExist)
                                  throws InitializationException
Utility for service implementations to get a file list from the configured properties.

Throws:
InitializationException - if the property is not found in the config file or if the requested file does not exist when required (mustExist == true ).

addCustomProperties

void addCustomProperties(java.lang.String configName,
                         java.io.File customConfigFile,
                         boolean mustExist)
                         throws InitializationException
Provision for implementations of ApplicationLauncher to provide non-relative locations for client manipulated configuration properties.

Parameters:
configName - String designating unique to identify custom property collection.
customConfigFile - File designation for location of property file.
mustExist - boolean> flag denoting if proper loading of file is required.
Throws:
InitializationException - if the requested file does not exist when required ( mustExist == true ).

getCustomProperties

java.util.Properties getCustomProperties(java.lang.String configName,
                                         boolean mustExist)
                                         throws InitializationException
Provision for implementations of ApplicationLauncher to provide non-relative locations for client manipulated configuration properties.

Parameters:
configName - String designating unique to identify custom property collection.
mustExist - boolean flag denoting if proper loading of file is required.
Returns:
Properties Custom properties relevant to Application implementation.
Throws:
InitializationException - if the requested property designation does not exist when required ( mustExist == true ).


Copyright © 2012 Blackboard, Inc. All Rights Reserved.