Class IpLikeSearchProvider
- java.lang.Object
-
- org.opennms.features.topology.api.topo.AbstractSearchProvider
-
- org.opennms.features.topology.app.internal.IpLikeSearchProvider
-
- All Implemented Interfaces:
HistoryAwareSearchProvider,SearchProvider
public class IpLikeSearchProvider extends AbstractSearchProvider implements HistoryAwareSearchProvider
Implementation of theAPI that allows the user to specify an IPLIKE query. The query itself is returned in the set as a collapsible selection as well as the "distinct" list of IPs from the DB that are also collapsible since multiple nodes may have the same IP. The supports adding all the nodes having the selected IP. FIXME: Improve the label to support showing how many vertices are supported by each - Author:
- David Hustace
-
-
Constructor Summary
Constructors Constructor Description IpLikeSearchProvider(IpInterfaceProvider ipInterfaceProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVertexHopCriteria(SearchResult searchResult, GraphContainer container)Creates a criteria that providesmatching the IPLIKE query from the users query stored in the that was created by this class during the query method. CriteriabuildCriteriaFromQuery(SearchResult input, GraphContainer container)booleancontributesTo(String namespace)This is the topology provider namespace to which this search provider contributes.StringgetSearchProviderNamespace()This is a namespace for search providers...Set<VertexRef>getVertexRefsBy(SearchResult searchResult, GraphContainer container)This method is called when the topology UI needs to know whatare associated with a particular . voidonCenterSearchResult(SearchResult searchResult, GraphContainer graphContainer)This method called when the user clicks the focus icon on the. voidonDefocusSearchResult(SearchResult searchResult, OperationContext operationContext)This method is called from the UI when the user wants to remove a vertex that currently in the focus list.voidonFocusSearchResult(SearchResult searchResult, OperationContext operationContext)This method is called from the UI when the user wants to add a vertex that is in the current context to the focus list.voidonToggleCollapse(SearchResult searchResult, GraphContainer graphContainer)This method is called if theprovided by the implementation of this API is flagged as collapsible and the user has clicked the toggle icon. List<SearchResult>query(SearchQuery searchQuery, GraphContainer graphContainer)This method processes thethat the user has typed and returns a list of matching IP addresses as well as the query string itself, which is collapsible, to act as a subnet container. voidremoveVertexHopCriteria(SearchResult searchResult, GraphContainer container)When the user requests that the current SearchResult be removed from focus, the search provider should remove thefrom the booleansupportsPrefix(String searchPrefix)This method is called by topology app the user is searching to setup prefixes that will only match from a-
Methods inherited from class org.opennms.features.topology.api.topo.AbstractSearchProvider
supportsPrefix
-
-
-
-
Constructor Detail
-
IpLikeSearchProvider
public IpLikeSearchProvider(IpInterfaceProvider ipInterfaceProvider)
-
-
Method Detail
-
getSearchProviderNamespace
public String getSearchProviderNamespace()
Description copied from interface:SearchProviderThis is a namespace for search providers...- Specified by:
getSearchProviderNamespacein interfaceSearchProvider- Returns:
-
contributesTo
public boolean contributesTo(String namespace)
Description copied from interface:SearchProviderThis is the topology provider namespace to which this search provider contributes.- Specified by:
contributesToin interfaceSearchProvider- Returns:
- returns true if the provider support the <@param namespace>.
-
query
public List<SearchResult> query(SearchQuery searchQuery, GraphContainer graphContainer)
This method processes thethat the user has typed and returns a list of matching IP addresses as well as the query string itself, which is collapsible, to act as a subnet container. - Specified by:
queryin interfaceSearchProvider- Parameters:
searchQuery- This is an API for Vaadin UI code for implementing various search queries types.- Returns:
- A list of SearchResults
-
supportsPrefix
public boolean supportsPrefix(String searchPrefix)
Description copied from interface:SearchProviderThis method is called by topology app the user is searching to setup prefixes that will only match from a- Specified by:
supportsPrefixin interfaceSearchProvider- Returns:
-
getVertexRefsBy
public Set<VertexRef> getVertexRefsBy(SearchResult searchResult, GraphContainer container)
Description copied from interface:SearchProviderThis method is called when the topology UI needs to know whatare associated with a particular . - Specified by:
getVertexRefsByin interfaceSearchProvider- Returns:
-
onCenterSearchResult
public void onCenterSearchResult(SearchResult searchResult, GraphContainer graphContainer)
Description copied from interface:SearchProviderThis method called when the user clicks the focus icon on the. No implementation is required unless you want to enhance the zoom behavior. This call will be followed by a call to getVertexRefsBy. - Specified by:
onCenterSearchResultin interfaceSearchProvider- Overrides:
onCenterSearchResultin classAbstractSearchProvider
-
onFocusSearchResult
public void onFocusSearchResult(SearchResult searchResult, OperationContext operationContext)
Description copied from interface:SearchProviderThis method is called from the UI when the user wants to add a vertex that is in the current context to the focus list.- Specified by:
onFocusSearchResultin interfaceSearchProvider- Overrides:
onFocusSearchResultin classAbstractSearchProvider
-
onDefocusSearchResult
public void onDefocusSearchResult(SearchResult searchResult, OperationContext operationContext)
Description copied from interface:SearchProviderThis method is called from the UI when the user wants to remove a vertex that currently in the focus list.- Specified by:
onDefocusSearchResultin interfaceSearchProvider- Overrides:
onDefocusSearchResultin classAbstractSearchProvider
-
addVertexHopCriteria
public void addVertexHopCriteria(SearchResult searchResult, GraphContainer container)
Creates a criteria that providesmatching the IPLIKE query from the users query stored in the that was created by this class during the query method. The SearchResult and the Criterion use the OnmsIpinterfaceId as the ID for dereferencing in the container. - Specified by:
addVertexHopCriteriain interfaceSearchProvider
-
removeVertexHopCriteria
public void removeVertexHopCriteria(SearchResult searchResult, GraphContainer container)
Description copied from interface:SearchProviderWhen the user requests that the current SearchResult be removed from focus, the search provider should remove thefrom the - Specified by:
removeVertexHopCriteriain interfaceSearchProvider
-
onToggleCollapse
public void onToggleCollapse(SearchResult searchResult, GraphContainer graphContainer)
Description copied from interface:SearchProviderThis method is called if theprovided by the implementation of this API is flagged as collapsible and the user has clicked the toggle icon. This requires that the implementation created by the implemenation of this API should be able to implement the API. The set of provided by the Criteria will not change, however, the criteria should be able to provide the both the collapsed and uncollapsed representations of the SearchResult. - Specified by:
onToggleCollapsein interfaceSearchProvider- Overrides:
onToggleCollapsein classAbstractSearchProvider
-
buildCriteriaFromQuery
public Criteria buildCriteriaFromQuery(SearchResult input, GraphContainer container)
- Specified by:
buildCriteriaFromQueryin interfaceHistoryAwareSearchProvider
-
-