org.opennms.netmgt.dao.castor
Class AbstractCastorConfigDao<K,V>

java.lang.Object
  extended by org.opennms.netmgt.dao.castor.AbstractCastorConfigDao<K,V>
Type Parameters:
K - Castor class
V - Configuration object that is stored in memory (might be the same as the Castor class or could be a different class)
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
DefaultAckdConfigurationDao, DefaultDatabaseReportConfigDao, DefaultDataCollectionConfigDao, DefaultEndPointConfigurationDao, DefaultEventConfDao, DefaultJasperReportConfigDao, DefaultJavamailConfigurationDao, DefaultLinkAdapterConfigurationDao, DefaultMicroblogConfigurationDao, DefaultOnmsReportConfigDao, DefaultProvisiondConfigurationDao, DefaultReportdConfigurationDao, DefaultStatisticsDaemonConfigDao, DefaultSurveillanceViewConfigDao, DefaultTl1ConfigurationDao, PollOutagesConfigManager

public abstract class AbstractCastorConfigDao<K,V>
extends Object
implements org.springframework.beans.factory.InitializingBean

Abstract AbstractCastorConfigDao class.

Version:
$Id: $
Author:
DJ Gregor

Nested Class Summary
 class AbstractCastorConfigDao.CastorReloadCallback
           
 
Constructor Summary
AbstractCastorConfigDao(Class<K> entityClass, String description)
          Constructor for AbstractCastorConfigDao.
 
Method Summary
 void afterPropertiesSet()
          afterPropertiesSet
protected  String createLoadedLogMessage(V translatedConfig, long diffTime)
          createLoadedLogMessage
 org.springframework.core.io.Resource getConfigResource()
          getConfigResource
protected  FileReloadContainer<V> getContainer()
          getContainer
 String getDescription()
          getDescription
 Long getReloadCheckInterval()
          getReloadCheckInterval
protected  V loadConfig(org.springframework.core.io.Resource resource)
          loadConfig
protected  ThreadCategory log()
          log
 void setConfigResource(org.springframework.core.io.Resource configResource)
          setConfigResource
 void setReloadCheckInterval(Long reloadCheckInterval)
          setReloadCheckInterval
abstract  V translateConfig(K castorConfig)
          translateConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCastorConfigDao

public AbstractCastorConfigDao(Class<K> entityClass,
                               String description)

Constructor for AbstractCastorConfigDao.

Type Parameters:
K - a K object.
V - a V object.
Parameters:
entityClass - a Class object.
description - a String object.
Method Detail

translateConfig

public abstract V translateConfig(K castorConfig)

translateConfig

Parameters:
castorConfig - a K object.
Returns:
a V object.

log

protected ThreadCategory log()

log

Returns:
a ThreadCategory object.

loadConfig

protected V loadConfig(org.springframework.core.io.Resource resource)

loadConfig

Parameters:
resource - a Resource object.
Returns:
a V object.

createLoadedLogMessage

protected String createLoadedLogMessage(V translatedConfig,
                                        long diffTime)

createLoadedLogMessage

Parameters:
translatedConfig - a V object.
diffTime - a long.
Returns:
a String object.

afterPropertiesSet

public void afterPropertiesSet()

afterPropertiesSet

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

getConfigResource

public org.springframework.core.io.Resource getConfigResource()

getConfigResource

Returns:
a Resource object.

setConfigResource

public void setConfigResource(org.springframework.core.io.Resource configResource)

setConfigResource

Parameters:
configResource - a Resource object.

getContainer

protected FileReloadContainer<V> getContainer()

getContainer

Returns:
a FileReloadContainer object.

getReloadCheckInterval

public Long getReloadCheckInterval()

getReloadCheckInterval

Returns:
a Long object.

setReloadCheckInterval

public void setReloadCheckInterval(Long reloadCheckInterval)

setReloadCheckInterval

Parameters:
reloadCheckInterval - a Long object.

getDescription

public String getDescription()

getDescription

Returns:
a String object.


Copyright © 2011. All Rights Reserved.