Class MockNodeDao

    • Constructor Detail

      • MockNodeDao

        public MockNodeDao()
    • Method Detail

      • get

        public OnmsNode get​(java.lang.String lookupCriteria)
        Description copied from interface: NodeDao
        Get a node based on it's node ID or foreignSource:foreignId
        Specified by:
        get in interface NodeDao
        Parameters:
        lookupCriteria - the criteria, either the node ID, or a colon-separated string of foreignSource:foreignId
        Returns:
        the node
      • getLabelForId

        public java.lang.String getLabelForId​(java.lang.Integer id)
        Description copied from interface: NodeDao
        Light weight call to simply get the node label without loading the entire node.
        Specified by:
        getLabelForId in interface NodeDao
        Returns:
        A String representing the provisioned label for the node. Returns null if not found.
      • getLocationForId

        public java.lang.String getLocationForId​(java.lang.Integer id)
        Description copied from interface: NodeDao
        Light weight call to simply get the node location without loading the entire node.
        Specified by:
        getLocationForId in interface NodeDao
        Returns:
        A String representing the provisioned label for the node. Returns null if not found.
      • findByLabel

        public java.util.List<OnmsNode> findByLabel​(java.lang.String label)
        Description copied from interface: NodeDao

        findByLabel

        Specified by:
        findByLabel in interface NodeDao
        Parameters:
        label - a String object.
        Returns:
        a Collection object.
      • getHierarchy

        public OnmsNode getHierarchy​(java.lang.Integer id)
        Description copied from interface: NodeDao

        getHierarchy

        Specified by:
        getHierarchy in interface NodeDao
        Parameters:
        id - a Integer object.
        Returns:
        a OnmsNode object.
      • getForeignIdToNodeIdMap

        public java.util.Map<java.lang.String,​java.lang.Integer> getForeignIdToNodeIdMap​(java.lang.String foreignSource)
        Description copied from interface: NodeDao

        getForeignIdToNodeIdMap

        Specified by:
        getForeignIdToNodeIdMap in interface NodeDao
        Parameters:
        foreignSource - a String object.
        Returns:
        a Map object.
      • findAllByVarCharAssetColumn

        public java.util.List<OnmsNode> findAllByVarCharAssetColumn​(java.lang.String columnName,
                                                                    java.lang.String columnValue)
        Description copied from interface: NodeDao

        findAllByVarCharAssetColumn

        Specified by:
        findAllByVarCharAssetColumn in interface NodeDao
        Parameters:
        columnName - a String object.
        columnValue - a String object.
        Returns:
        a Collection object.
      • findAllByVarCharAssetColumnCategoryList

        public java.util.List<OnmsNode> findAllByVarCharAssetColumnCategoryList​(java.lang.String columnName,
                                                                                java.lang.String columnValue,
                                                                                java.util.Collection<OnmsCategory> categories)
        Description copied from interface: NodeDao

        findAllByVarCharAssetColumnCategoryList

        Specified by:
        findAllByVarCharAssetColumnCategoryList in interface NodeDao
        Parameters:
        columnName - a String object.
        columnValue - a String object.
        categories - a Collection object.
        Returns:
        a Collection object.
      • findAllByCategoryList

        public java.util.List<OnmsNode> findAllByCategoryList​(java.util.Collection<OnmsCategory> categories)
        Description copied from interface: NodeDao

        findAllByCategoryList

        Specified by:
        findAllByCategoryList in interface NodeDao
        Parameters:
        categories - a Collection object.
        Returns:
        a Collection object.
      • findAllByCategoryLists

        public java.util.List<OnmsNode> findAllByCategoryLists​(java.util.Collection<OnmsCategory> rowCatNames,
                                                               java.util.Collection<OnmsCategory> colCatNames)
        Description copied from interface: NodeDao

        findAllByCategoryLists

        Specified by:
        findAllByCategoryLists in interface NodeDao
        Parameters:
        rowCatNames - a Collection object.
        colCatNames - a Collection object.
        Returns:
        a Collection object.
      • findByForeignSource

        public java.util.List<OnmsNode> findByForeignSource​(java.lang.String foreignSource)
        Description copied from interface: NodeDao

        findByForeignSource

        Specified by:
        findByForeignSource in interface NodeDao
        Parameters:
        foreignSource - a String object.
        Returns:
        a List object.
      • findByIpAddressAndService

        public java.util.List<OnmsNode> findByIpAddressAndService​(java.net.InetAddress ipAddress,
                                                                  java.lang.String serviceName)
        Specified by:
        findByIpAddressAndService in interface NodeDao
      • findByForeignId

        public OnmsNode findByForeignId​(java.lang.String foreignSource,
                                        java.lang.String foreignId)
        Description copied from interface: NodeDao

        findByForeignId

        Specified by:
        findByForeignId in interface NodeDao
        Parameters:
        foreignSource - a String object.
        foreignId - a String object.
        Returns:
        a OnmsNode object.
      • getNodeCountForForeignSource

        public int getNodeCountForForeignSource​(java.lang.String foreignSource)
        Description copied from interface: NodeDao

        getNodeCountForForeignSource

        Specified by:
        getNodeCountForForeignSource in interface NodeDao
        Parameters:
        foreignSource - a String object.
        Returns:
        a int.
      • getForeignIdsPerForeignSourceMap

        public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getForeignIdsPerForeignSourceMap()
        Description copied from interface: NodeDao

        getForeignIdsPerForeignSourceMap

        Specified by:
        getForeignIdsPerForeignSourceMap in interface NodeDao
        Returns:
        a Map object.
      • getForeignIdsPerForeignSource

        public java.util.Set<java.lang.String> getForeignIdsPerForeignSource​(java.lang.String foreignSource)
        Description copied from interface: NodeDao

        getForeignIdsPerForeignSource

        Specified by:
        getForeignIdsPerForeignSource in interface NodeDao
        Parameters:
        foreignSource - a String object.
        Returns:
        a Set object.
      • findAllProvisionedNodes

        public java.util.List<OnmsNode> findAllProvisionedNodes()
        Description copied from interface: NodeDao

        findAllProvisionedNodes

        Specified by:
        findAllProvisionedNodes in interface NodeDao
        Returns:
        a List object.
      • findObsoleteIpInterfaces

        public java.util.List<OnmsIpInterface> findObsoleteIpInterfaces​(java.lang.Integer nodeId,
                                                                        java.util.Date scanStamp)
        Description copied from interface: NodeDao

        findObsoleteIpInterfaces

        Specified by:
        findObsoleteIpInterfaces in interface NodeDao
        Parameters:
        nodeId - a Integer object.
        scanStamp - a Date object.
        Returns:
        a List object.
      • findObsoleteSnmpInterfaces

        public java.util.List<OnmsSnmpInterface> findObsoleteSnmpInterfaces​(java.lang.Integer nodeId,
                                                                            java.util.Date scanStamp)
      • deleteObsoleteInterfaces

        public void deleteObsoleteInterfaces​(java.lang.Integer nodeId,
                                             java.util.Date scanStamp)
        Description copied from interface: NodeDao

        deleteObsoleteInterfaces

        Specified by:
        deleteObsoleteInterfaces in interface NodeDao
        Parameters:
        nodeId - a Integer object.
        scanStamp - a Date object.
      • updateNodeScanStamp

        public void updateNodeScanStamp​(java.lang.Integer nodeId,
                                        java.util.Date scanStamp)
        Description copied from interface: NodeDao

        updateNodeScanStamp

        Specified by:
        updateNodeScanStamp in interface NodeDao
        Parameters:
        nodeId - a Integer object.
        scanStamp - a Date object.
      • getNodeIds

        public java.util.Collection<java.lang.Integer> getNodeIds()
        Description copied from interface: NodeDao

        getNodeIds

        Specified by:
        getNodeIds in interface NodeDao
        Returns:
        a Collection object.
      • findByForeignSourceAndIpAddress

        public java.util.List<OnmsNode> findByForeignSourceAndIpAddress​(java.lang.String foreignSource,
                                                                        java.lang.String ipAddress)
        Description copied from interface: NodeDao

        findByForeignSourceAndIpAddress

        Specified by:
        findByForeignSourceAndIpAddress in interface NodeDao
        Parameters:
        foreignSource - a String object.
        ipAddress - a String object.
        Returns:
        a List object.
      • getNextNodeId

        public java.lang.Integer getNextNodeId​(java.lang.Integer nodeId)
        Specified by:
        getNextNodeId in interface NodeDao
      • getPreviousNodeId

        public java.lang.Integer getPreviousNodeId​(java.lang.Integer nodeId)
        Specified by:
        getPreviousNodeId in interface NodeDao
      • getAllLabelsById

        public java.util.Map<java.lang.Integer,​java.lang.String> getAllLabelsById()
        Description copied from interface: NodeDao
        Retrieves all of node id/label tuples. Can be used as a lightweight alternative to findAll().
        Specified by:
        getAllLabelsById in interface NodeDao
        Returns:
        a Map containing all node ids and their associated labels.
      • getNumberOfNodesBySysOid

        public java.util.Map<java.lang.String,​java.lang.Long> getNumberOfNodesBySysOid()
        Description copied from interface: NodeDao
        Retrieves the number of nodes for each sysOid.
        Specified by:
        getNumberOfNodesBySysOid in interface NodeDao
        Returns:
        a Map containing the number of nodes for each sysOid
      • getNextNodeId

        public int getNextNodeId()
      • findByLabelForLocation

        public java.util.List<OnmsNode> findByLabelForLocation​(java.lang.String label,
                                                               java.lang.String location)
        Description copied from interface: NodeDao

        findByLabel

        Specified by:
        findByLabelForLocation in interface NodeDao
        Parameters:
        label - a String object.
        location - a String object.
        Returns:
        a Collection object.
      • findByForeignId

        public java.util.List<OnmsNode> findByForeignId​(java.lang.String foreignId)
        Description copied from interface: NodeDao

        findByForeignId

        Specified by:
        findByForeignId in interface NodeDao
        Parameters:
        foreignId - a String object.
        Returns:
        a List object.
      • findByForeignIdForLocation

        public java.util.List<OnmsNode> findByForeignIdForLocation​(java.lang.String foreignId,
                                                                   java.lang.String location)
        Description copied from interface: NodeDao

        findByForeignIdForLocation

        Specified by:
        findByForeignIdForLocation in interface NodeDao
        Parameters:
        foreignId - a String object.
        location - a String object.
        Returns:
        a List object.
      • markHavingFlows

        public void markHavingFlows​(java.util.Collection<java.lang.Integer> ingressIds,
                                    java.util.Collection<java.lang.Integer> egressIds)
        Specified by:
        markHavingFlows in interface NodeDao
      • findNodeWithMetaData

        public java.util.List<OnmsNode> findNodeWithMetaData​(java.lang.String context,
                                                             java.lang.String key,
                                                             java.lang.String value)
        Specified by:
        findNodeWithMetaData in interface NodeDao