com.endeca.portal.data.config
Class DataSourceConfigHelper

java.lang.Object
  extended by com.endeca.portal.data.config.DataSourceConfigHelper

public class DataSourceConfigHelper
extends java.lang.Object


Field Summary
static java.lang.String DATA_SOURCE_CONFIG_DIRECTORY
           
 
Constructor Summary
DataSourceConfigHelper()
           
 
Method Summary
static void addDataSourceConfiguration(MDEXState d)
          This method adds an MDEXState to the persistence layer and increments the cache version to indicate an update is necessary.
static java.lang.String expandLiferayHomeToken(java.lang.String value)
          Expands tokens in a path string representing the data source directory.
static java.util.Map<java.lang.String,MDEXState> getDataSourceConfigurations()
          This method returns the currently cached Map of MDEXState's, which are keyed off of their data source id.
static long getDataSourceConfigVersion()
          This returns the current version of the data sources
static java.io.File getFileFromPath(java.lang.String path)
           
static void incrementDataSourceConfigVersion()
          Increases the version of the datasources stored in the database by 1
static void loadDataSourceConfigurationFromDisk()
          Deprecated.  
static void removeDataSourceConfiguration(java.lang.String id)
          This method removes an MDEXState from the persistence layer and increments the cache version to indicate an update is necessary.
static void resetDataSourceStatusPoller()
          Cancel the existing timer and reset from value in FrameworkSettings
static MDEXState testConnection(java.lang.String id)
          This method takes a data source id, find's the corresponding MDEX State, and pings the MDEX to see if it is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_SOURCE_CONFIG_DIRECTORY

public static final java.lang.String DATA_SOURCE_CONFIG_DIRECTORY
See Also:
Constant Field Values
Constructor Detail

DataSourceConfigHelper

public DataSourceConfigHelper()
Method Detail

resetDataSourceStatusPoller

public static void resetDataSourceStatusPoller()
Cancel the existing timer and reset from value in FrameworkSettings


getDataSourceConfigurations

public static java.util.Map<java.lang.String,MDEXState> getDataSourceConfigurations()
This method returns the currently cached Map of MDEXState's, which are keyed off of their data source id. If the cache is out of date, this method will update the cache before returning.

Returns:
Map

incrementDataSourceConfigVersion

public static void incrementDataSourceConfigVersion()
Increases the version of the datasources stored in the database by 1


getDataSourceConfigVersion

public static long getDataSourceConfigVersion()
This returns the current version of the data sources

Returns:
long

addDataSourceConfiguration

public static void addDataSourceConfiguration(MDEXState d)
                                       throws DataSourceConfigUpdateException
This method adds an MDEXState to the persistence layer and increments the cache version to indicate an update is necessary.

Parameters:
d -
Throws:
DataSourceConfigUpdateException

removeDataSourceConfiguration

public static void removeDataSourceConfiguration(java.lang.String id)
                                          throws DataSourceConfigUpdateException
This method removes an MDEXState from the persistence layer and increments the cache version to indicate an update is necessary.

Parameters:
id -
Throws:
DataSourceConfigUpdateException

testConnection

public static MDEXState testConnection(java.lang.String id)
This method takes a data source id, find's the corresponding MDEX State, and pings the MDEX to see if it is available. It returns the MDEX State of the data source ID with the corresponding status.

Parameters:
id -
Returns:
MDEXState

loadDataSourceConfigurationFromDisk

public static void loadDataSourceConfigurationFromDisk()
Deprecated. 

Method to pull datasource files from disk, process them into the database and mark them as processed. This no longer tracks errors, it will only log them appropriately. This should only be called at startup in the UpdateFramework class to support backwards compatibility.

Throws:
java.io.IOException

expandLiferayHomeToken

public static java.lang.String expandLiferayHomeToken(java.lang.String value)
Expands tokens in a path string representing the data source directory. Currently the only acceptable token is "${liferay.home}"

Parameters:
value - the tokenized path string
Returns:
the path string with tokens replaced

getFileFromPath

public static java.io.File getFileFromPath(java.lang.String path)