Class FasterFilesystemForeignSourceRepository
- java.lang.Object
-
- org.opennms.netmgt.provision.persist.AbstractForeignSourceRepository
-
- org.opennms.netmgt.provision.persist.FilesystemForeignSourceRepository
-
- org.opennms.netmgt.provision.persist.FasterFilesystemForeignSourceRepository
-
- All Implemented Interfaces:
ForeignSourceRepository
,org.springframework.beans.factory.InitializingBean
public class FasterFilesystemForeignSourceRepository extends FilesystemForeignSourceRepository implements org.springframework.beans.factory.InitializingBean
FasterFilesystemForeignSourceRepository class.
The directory watcher should keep a cache of all requisitions on disk.
The directory watcher will always return the object from the cache, and the cache should be updated when changes are detected on the directories.
The method AbstractForeignSourceRepository.importResourceRequisition will read the requisition and update the copy on disk. This should trigger the update of the cache.
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.provision.persist.FilesystemForeignSourceRepository
m_foreignSourcePath, m_globalLock, m_readLock, m_requisitionPath, m_writeLock
-
-
Constructor Summary
Constructors Constructor Description FasterFilesystemForeignSourceRepository()
Instantiates a new faster filesystem foreign source repository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getActiveForeignSourceNames()
getActiveForeignSourceNamesForeignSource
getForeignSource(String foreignSourceName)
getForeignSourceint
getForeignSourceCount()
getForeignSourceCountSet<ForeignSource>
getForeignSources()
getForeignSourcesDirectoryWatcher<ForeignSource>
getForeignSourcesDirectoryWatcher()
Gets the foreign sources directory watcher.Requisition
getRequisition(String foreignSourceName)
getRequisitionSet<Requisition>
getRequisitions()
getRequisitionsDirectoryWatcher<Requisition>
getRequisitionsDirectoryWatcher()
Gets the requisitions directory watcher.URL
getRequisitionURL(String foreignSource)
getRequisitionURLRequisition
importResourceRequisition(org.springframework.core.io.Resource resource)
importResourceRequisition-
Methods inherited from class org.opennms.netmgt.provision.persist.FilesystemForeignSourceRepository
afterPropertiesSet, delete, delete, flush, getRequisition, getRequisitionDate, save, save, setForeignSourcePath, setRequisitionPath
-
Methods inherited from class org.opennms.netmgt.provision.persist.AbstractForeignSourceRepository
clear, getDefaultForeignSource, getNodeRequisition, putDefaultForeignSource, resetDefaultForeignSource, validate, validate
-
-
-
-
Constructor Detail
-
FasterFilesystemForeignSourceRepository
public FasterFilesystemForeignSourceRepository() throws ForeignSourceRepositoryException
Instantiates a new faster filesystem foreign source repository.- Throws:
ForeignSourceRepositoryException
- the foreign source repository exception
-
-
Method Detail
-
importResourceRequisition
public Requisition importResourceRequisition(org.springframework.core.io.Resource resource) throws ForeignSourceRepositoryException
Description copied from class:AbstractForeignSourceRepository
importResourceRequisition
- Specified by:
importResourceRequisition
in interfaceForeignSourceRepository
- Overrides:
importResourceRequisition
in classAbstractForeignSourceRepository
- Parameters:
resource
- aResource
object.- Returns:
- a
Requisition
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getActiveForeignSourceNames
public Set<String> getActiveForeignSourceNames()
Description copied from class:FilesystemForeignSourceRepository
getActiveForeignSourceNames
- Specified by:
getActiveForeignSourceNames
in interfaceForeignSourceRepository
- Overrides:
getActiveForeignSourceNames
in classFilesystemForeignSourceRepository
- Returns:
- a
Set
object.
-
getForeignSourceCount
public int getForeignSourceCount() throws ForeignSourceRepositoryException
Description copied from class:FilesystemForeignSourceRepository
getForeignSourceCount
- Specified by:
getForeignSourceCount
in interfaceForeignSourceRepository
- Overrides:
getForeignSourceCount
in classFilesystemForeignSourceRepository
- Returns:
- a int.
- Throws:
ForeignSourceRepositoryException
- if any.
-
getForeignSources
public Set<ForeignSource> getForeignSources() throws ForeignSourceRepositoryException
Description copied from class:FilesystemForeignSourceRepository
getForeignSources
- Specified by:
getForeignSources
in interfaceForeignSourceRepository
- Overrides:
getForeignSources
in classFilesystemForeignSourceRepository
- Returns:
- a
Set
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getForeignSource
public ForeignSource getForeignSource(String foreignSourceName) throws ForeignSourceRepositoryException
Description copied from class:FilesystemForeignSourceRepository
getForeignSource
- Specified by:
getForeignSource
in interfaceForeignSourceRepository
- Overrides:
getForeignSource
in classFilesystemForeignSourceRepository
- Parameters:
foreignSourceName
- aString
object.- Returns:
- a
ForeignSource
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getRequisitions
public Set<Requisition> getRequisitions() throws ForeignSourceRepositoryException
Description copied from class:FilesystemForeignSourceRepository
getRequisitions
- Specified by:
getRequisitions
in interfaceForeignSourceRepository
- Overrides:
getRequisitions
in classFilesystemForeignSourceRepository
- Returns:
- a
Set
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getRequisition
public Requisition getRequisition(String foreignSourceName) throws ForeignSourceRepositoryException
Description copied from class:FilesystemForeignSourceRepository
getRequisition
- Specified by:
getRequisition
in interfaceForeignSourceRepository
- Overrides:
getRequisition
in classFilesystemForeignSourceRepository
- Parameters:
foreignSourceName
- aString
object.- Returns:
- a
Requisition
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getRequisitionURL
public URL getRequisitionURL(String foreignSource) throws ForeignSourceRepositoryException
Description copied from class:FilesystemForeignSourceRepository
getRequisitionURL
- Specified by:
getRequisitionURL
in interfaceForeignSourceRepository
- Overrides:
getRequisitionURL
in classFilesystemForeignSourceRepository
- Parameters:
foreignSource
- aString
object.- Returns:
- a
URL
object. - Throws:
ForeignSourceRepositoryException
-
getForeignSourcesDirectoryWatcher
public DirectoryWatcher<ForeignSource> getForeignSourcesDirectoryWatcher() throws ForeignSourceRepositoryException
Gets the foreign sources directory watcher.- Returns:
- the foreign sources directory watcher
- Throws:
ForeignSourceRepositoryException
- the foreign source repository exception
-
getRequisitionsDirectoryWatcher
public DirectoryWatcher<Requisition> getRequisitionsDirectoryWatcher() throws ForeignSourceRepositoryException
Gets the requisitions directory watcher.- Returns:
- the requisitions directory watcher
- Throws:
ForeignSourceRepositoryException
- the foreign source repository exception
-
-