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 java.util.Set<java.lang.String>
getActiveForeignSourceNames()
getActiveForeignSourceNamesForeignSource
getForeignSource(java.lang.String foreignSourceName)
getForeignSourceint
getForeignSourceCount()
getForeignSourceCountjava.util.Set<ForeignSource>
getForeignSources()
getForeignSourcesDirectoryWatcher<ForeignSource>
getForeignSourcesDirectoryWatcher()
Gets the foreign sources directory watcher.Requisition
getRequisition(java.lang.String foreignSourceName)
getRequisitionjava.util.Set<Requisition>
getRequisitions()
getRequisitionsDirectoryWatcher<Requisition>
getRequisitionsDirectoryWatcher()
Gets the requisitions directory watcher.java.net.URL
getRequisitionURL(java.lang.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 java.util.Set<java.lang.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 java.util.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(java.lang.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 java.util.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(java.lang.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 java.net.URL getRequisitionURL(java.lang.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
-
-