Package org.opennms.netmgt.graph.search
Class NodeSearchProvider
- java.lang.Object
-
- org.opennms.netmgt.graph.search.NodeSearchProvider
-
- All Implemented Interfaces:
SearchProvider
public class NodeSearchProvider extends java.lang.Object implements SearchProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
CONTEXT
-
Constructor Summary
Constructors Constructor Description NodeSearchProvider(NodeDao nodeDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canSuggest(GraphService graphService, java.lang.String namespace)
Defines if the search can provide suggestions to the given namespacejava.util.List<SearchSuggestion>
getSuggestions(SearchContext searchContext, java.lang.String namespace, java.lang.String input)
Provide suggestions for the given namespace, given the input.java.util.List<GenericVertex>
resolve(GraphService graphService, SearchCriteria searchCriteria)
Resolves the given SearchCriteria to a list of vertices.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.graph.api.search.SearchProvider
getProviderId
-
-
-
-
Field Detail
-
CONTEXT
protected static final java.lang.String CONTEXT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NodeSearchProvider
public NodeSearchProvider(NodeDao nodeDao)
-
-
Method Detail
-
canSuggest
public boolean canSuggest(GraphService graphService, java.lang.String namespace)
Description copied from interface:SearchProvider
Defines if the search can provide suggestions to the given namespace- Specified by:
canSuggest
in interfaceSearchProvider
namespace
- The namespace to make suggestions to.- Returns:
- True if suggestions can be made, false otherwise
-
getSuggestions
public java.util.List<SearchSuggestion> getSuggestions(SearchContext searchContext, java.lang.String namespace, java.lang.String input)
Description copied from interface:SearchProvider
Provide suggestions for the given namespace, given the input. Be aware that the input may only contain snippets of the actual input, e.g. `Rout` instead of `Routers` (type ahead).- Specified by:
getSuggestions
in interfaceSearchProvider
- Parameters:
searchContext
- The SearchContext to allow access to graphs and other configurationnamespace
- The namespace of the current selected provider to make mappingsinput
- The current input, may be a snippet of the final input for type ahead support. It is never null or empty.- Returns:
- A list of suggestions the SearchProvider can use later to resolve to actual Vertices. Be aware, that this should only return actual results, e.g. "Routers" when input was "Rout".
-
resolve
public java.util.List<GenericVertex> resolve(GraphService graphService, SearchCriteria searchCriteria)
Description copied from interface:SearchProvider
Resolves the given SearchCriteria to a list of vertices.- Specified by:
resolve
in interfaceSearchProvider
- Parameters:
graphService
- The GraphService to get access to a graphsearchCriteria
- The SearchCriteria to resolve- Returns:
- A list of vertices matching the SearchCriteria.
-
-