Class QueueingForeignSourceRepository
- java.lang.Object
-
- org.opennms.netmgt.provision.persist.QueueingForeignSourceRepository
-
- All Implemented Interfaces:
ForeignSourceRepository
,org.springframework.beans.factory.InitializingBean
public class QueueingForeignSourceRepository extends java.lang.Object implements ForeignSourceRepository, org.springframework.beans.factory.InitializingBean
-
-
Constructor Summary
Constructors Constructor Description QueueingForeignSourceRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
clear()
Delete all requisitions and foreign source definitions and return to defaults.void
delete(ForeignSource foreignSource)
deletevoid
delete(Requisition requisition)
deletevoid
flush()
For performance reasons, a get after a save on a ForeignSourceRepository is not guaranteed to return the latest saved data unless you flush first.java.util.Set<java.lang.String>
getActiveForeignSourceNames()
getActiveForeignSourceNamesForeignSource
getDefaultForeignSource()
getDefaultForeignSourceForeignSource
getForeignSource(java.lang.String foreignSourceName)
getForeignSourceint
getForeignSourceCount()
getForeignSourceCountForeignSourceRepository
getForeignSourceRepository()
java.util.Set<ForeignSource>
getForeignSources()
getForeignSourcesOnmsNodeRequisition
getNodeRequisition(java.lang.String foreignSource, java.lang.String foreignId)
getNodeRequisitionRequisition
getRequisition(java.lang.String foreignSourceName)
getRequisitionRequisition
getRequisition(ForeignSource foreignSource)
getRequisitionjava.util.Date
getRequisitionDate(java.lang.String foreignSource)
getRequisitionDatejava.util.Set<Requisition>
getRequisitions()
getRequisitionsjava.net.URL
getRequisitionURL(java.lang.String foreignSource)
getRequisitionURLRequisition
importResourceRequisition(org.springframework.core.io.Resource resource)
importResourceRequisitionvoid
putDefaultForeignSource(ForeignSource foreignSource)
putDefaultForeignSourcevoid
resetDefaultForeignSource()
resetDefaultForeignSourcevoid
save(ForeignSource foreignSource)
savevoid
save(Requisition requisition)
savevoid
setForeignSourceRepository(ForeignSourceRepository fsr)
void
validate(ForeignSource foreignSource)
void
validate(Requisition requisition)
-
-
-
Method Detail
-
flush
public void flush() throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
For performance reasons, a get after a save on a ForeignSourceRepository is not guaranteed to return the latest saved data unless you flush first.- Specified by:
flush
in interfaceForeignSourceRepository
- Throws:
ForeignSourceRepositoryException
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
getForeignSourceRepository
public ForeignSourceRepository getForeignSourceRepository()
-
setForeignSourceRepository
public void setForeignSourceRepository(ForeignSourceRepository fsr)
-
getActiveForeignSourceNames
public java.util.Set<java.lang.String> getActiveForeignSourceNames()
Description copied from interface:ForeignSourceRepository
getActiveForeignSourceNames
- Specified by:
getActiveForeignSourceNames
in interfaceForeignSourceRepository
- Returns:
- a
Set
object.
-
getForeignSourceCount
public int getForeignSourceCount() throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getForeignSourceCount
- Specified by:
getForeignSourceCount
in interfaceForeignSourceRepository
- Returns:
- a int.
- Throws:
ForeignSourceRepositoryException
- if any.
-
getForeignSources
public java.util.Set<ForeignSource> getForeignSources() throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getForeignSources
- Specified by:
getForeignSources
in interfaceForeignSourceRepository
- Returns:
- a
Set
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getForeignSource
public ForeignSource getForeignSource(java.lang.String foreignSourceName) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getForeignSource
- Specified by:
getForeignSource
in interfaceForeignSourceRepository
- Parameters:
foreignSourceName
- aString
object.- Returns:
- a
ForeignSource
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
save
public void save(ForeignSource foreignSource) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
save
- Specified by:
save
in interfaceForeignSourceRepository
- Parameters:
foreignSource
- aForeignSource
object.- Throws:
ForeignSourceRepositoryException
- if any.
-
delete
public void delete(ForeignSource foreignSource) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
delete
- Specified by:
delete
in interfaceForeignSourceRepository
- Parameters:
foreignSource
- aForeignSource
object.- Throws:
ForeignSourceRepositoryException
- if any.
-
getRequisitions
public java.util.Set<Requisition> getRequisitions() throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getRequisitions
- Specified by:
getRequisitions
in interfaceForeignSourceRepository
- Returns:
- a
Set
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getRequisition
public Requisition getRequisition(java.lang.String foreignSourceName) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getRequisition
- Specified by:
getRequisition
in interfaceForeignSourceRepository
- Parameters:
foreignSourceName
- aString
object.- Returns:
- a
Requisition
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getRequisition
public Requisition getRequisition(ForeignSource foreignSource) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getRequisition
- Specified by:
getRequisition
in interfaceForeignSourceRepository
- Parameters:
foreignSource
- aForeignSource
object.- Returns:
- a
Requisition
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getRequisitionDate
public java.util.Date getRequisitionDate(java.lang.String foreignSource)
Description copied from interface:ForeignSourceRepository
getRequisitionDate
- Specified by:
getRequisitionDate
in interfaceForeignSourceRepository
- Parameters:
foreignSource
- the Foreign Source name of the requisition.- Returns:
- The date-stamp of the requisition, as a
Date
-
getRequisitionURL
public java.net.URL getRequisitionURL(java.lang.String foreignSource)
Description copied from interface:ForeignSourceRepository
getRequisitionURL
- Specified by:
getRequisitionURL
in interfaceForeignSourceRepository
- Parameters:
foreignSource
- aString
object.- Returns:
- a
URL
object.
-
save
public void save(Requisition requisition) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
save
- Specified by:
save
in interfaceForeignSourceRepository
- Parameters:
requisition
- aRequisition
object.- Throws:
ForeignSourceRepositoryException
- if any.
-
delete
public void delete(Requisition requisition) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
delete
- Specified by:
delete
in interfaceForeignSourceRepository
- Parameters:
requisition
- aRequisition
object.- Throws:
ForeignSourceRepositoryException
- if any.
-
getDefaultForeignSource
public ForeignSource getDefaultForeignSource() throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getDefaultForeignSource
- Specified by:
getDefaultForeignSource
in interfaceForeignSourceRepository
- Returns:
- a
ForeignSource
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
putDefaultForeignSource
public void putDefaultForeignSource(ForeignSource foreignSource) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
putDefaultForeignSource
- Specified by:
putDefaultForeignSource
in interfaceForeignSourceRepository
- Parameters:
foreignSource
- aForeignSource
object.- Throws:
ForeignSourceRepositoryException
- if any.
-
resetDefaultForeignSource
public void resetDefaultForeignSource() throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
resetDefaultForeignSource
- Specified by:
resetDefaultForeignSource
in interfaceForeignSourceRepository
- Throws:
ForeignSourceRepositoryException
- if any.
-
importResourceRequisition
public Requisition importResourceRequisition(org.springframework.core.io.Resource resource) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
importResourceRequisition
- Specified by:
importResourceRequisition
in interfaceForeignSourceRepository
- Parameters:
resource
- aResource
object.- Returns:
- a
Requisition
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
getNodeRequisition
public OnmsNodeRequisition getNodeRequisition(java.lang.String foreignSource, java.lang.String foreignId) throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
getNodeRequisition
- Specified by:
getNodeRequisition
in interfaceForeignSourceRepository
- Parameters:
foreignSource
- aString
object.foreignId
- aString
object.- Returns:
- a
OnmsNodeRequisition
object. - Throws:
ForeignSourceRepositoryException
- if any.
-
validate
public void validate(ForeignSource foreignSource) throws ForeignSourceRepositoryException
- Specified by:
validate
in interfaceForeignSourceRepository
- Throws:
ForeignSourceRepositoryException
-
validate
public void validate(Requisition requisition) throws ForeignSourceRepositoryException
- Specified by:
validate
in interfaceForeignSourceRepository
- Throws:
ForeignSourceRepositoryException
-
clear
public void clear() throws ForeignSourceRepositoryException
Description copied from interface:ForeignSourceRepository
Delete all requisitions and foreign source definitions and return to defaults.- Specified by:
clear
in interfaceForeignSourceRepository
- Throws:
ForeignSourceRepositoryException
-
-