Interface DeviceConfigDao
-
- All Superinterfaces:
OnmsDao<DeviceConfig,Long>
- All Known Implementing Classes:
DeviceConfigDaoImpl
public interface DeviceConfigDao extends OnmsDao<DeviceConfig,Long>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createEmptyDeviceConfig(OnmsIpInterface ipInterface, String serviceName, String configType)
List<DeviceConfig>
findConfigsForInterfaceSortedByDate(OnmsIpInterface ipInterface, String serviceName)
List<DeviceConfig>
findStaleConfigs(OnmsIpInterface ipInterface, String serviceName, Date staleDate, Optional<Long> excludedId)
Find device configs for the given interface and service, excluding the given 'excludedId' if present, that are older than the 'staleDate'.List<DeviceConfig>
getAllDeviceConfigsWithAnInterfaceId(Integer ipInterfaceId)
int
getLatestConfigCountForEachInterface(String searchTerm, Set<DeviceConfigStatus> statuses)
List<DeviceConfigQueryResult>
getLatestConfigForEachInterface(Integer limit, Integer offset, String orderBy, String sortOrder, String searchTerm, Set<DeviceConfigStatus> statuses)
Get latest device configuration for each interface.Optional<DeviceConfig>
getLatestConfigForInterface(OnmsIpInterface ipInterface, String serviceName)
Optional<Long>
updateDeviceConfigContent(OnmsIpInterface ipInterface, String serviceName, String configType, String encoding, byte[] deviceConfigBytes, String filename)
Update the content of the specific device config.void
updateDeviceConfigFailure(OnmsIpInterface ipInterface, String serviceName, String configType, String encoding, String reason)
-
Methods inherited from interface org.opennms.netmgt.dao.api.OnmsDao
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
findConfigsForInterfaceSortedByDate
List<DeviceConfig> findConfigsForInterfaceSortedByDate(OnmsIpInterface ipInterface, String serviceName)
-
findStaleConfigs
List<DeviceConfig> findStaleConfigs(OnmsIpInterface ipInterface, String serviceName, Date staleDate, Optional<Long> excludedId)
Find device configs for the given interface and service, excluding the given 'excludedId' if present, that are older than the 'staleDate'. Used to find state device configs - records that are not the latest good config and are older than the staleDate.- Parameters:
ipInterface
- TheOnmsIpInterface
to filter onserviceName
- The name of the service to usestaleDate
- Records returned will be older than this dateexcludedId
- If supplied, an id of aDeviceConfig
record to exclude
-
getLatestConfigForInterface
Optional<DeviceConfig> getLatestConfigForInterface(OnmsIpInterface ipInterface, String serviceName)
-
getLatestConfigForEachInterface
List<DeviceConfigQueryResult> getLatestConfigForEachInterface(Integer limit, Integer offset, String orderBy, String sortOrder, String searchTerm, Set<DeviceConfigStatus> statuses)
Get latest device configuration for each interface. Returns a single record per device/config type combination.- Parameters:
limit
- Limit of number of records to return; defaults to 20offset
- Zero-based offset of records to return, used for pagination; defaults to 0.orderBy
- Property to order by, see implementation for exact options. Default is "lastUpdated".sortOrder
- Sort order for the sort type specified in 'orderBy'. Options are "desc" and "asc", defaults to "desc"searchTerm
- Search term to filter by, Currently searches device name and ip address.statuses
- If provided, a list ofDeviceConfigStatus
to filter on. If null or empty, does not do any filtering.- Returns:
- A list of
DeviceConfigQueryResult
objects
-
getLatestConfigCountForEachInterface
int getLatestConfigCountForEachInterface(String searchTerm, Set<DeviceConfigStatus> statuses)
-
getAllDeviceConfigsWithAnInterfaceId
List<DeviceConfig> getAllDeviceConfigsWithAnInterfaceId(Integer ipInterfaceId)
-
updateDeviceConfigContent
Optional<Long> updateDeviceConfigContent(OnmsIpInterface ipInterface, String serviceName, String configType, String encoding, byte[] deviceConfigBytes, String filename)
Update the content of the specific device config.- Returns:
- An
Optional
containing the id of theDeviceConfig
record that was updated.
-
updateDeviceConfigFailure
void updateDeviceConfigFailure(OnmsIpInterface ipInterface, String serviceName, String configType, String encoding, String reason)
-
createEmptyDeviceConfig
void createEmptyDeviceConfig(OnmsIpInterface ipInterface, String serviceName, String configType)
-
-