Interface DeviceConfigDao

    • Method Detail

      • 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 - The OnmsIpInterface to filter on
        serviceName - The name of the service to use
        staleDate - Records returned will be older than this date
        excludedId - If supplied, an id of a DeviceConfig record to exclude
      • 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 20
        offset - 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 of DeviceConfigStatus 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)