diff options
author | Jennie Jia <Jennie.Jia@amdocs.com> | 2019-03-21 12:26:50 -0400 |
---|---|---|
committer | Jennie Jia <Jennie.Jia@amdocs.com> | 2019-03-21 12:27:48 -0400 |
commit | 6883914961f7e85bac9f04c0f93fad0133ce04bc (patch) | |
tree | 6443cfaebcfec635826d9107ebdc6f9f4a579220 /sparkybe-onap-service/src/main | |
parent | d9c077726cbf0a83860b103da5d409a817a49a83 (diff) |
Add Default Method in SP
Issue-ID: AAI-2268
Change-Id: I0dfec3f79a75604bb3be84d0877b87c33413e27c
Signed-off-by: Jennie Jia <Jennie.Jia@amdocs.com>
Diffstat (limited to 'sparkybe-onap-service/src/main')
-rw-r--r-- | sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java | 7 | ||||
-rw-r--r-- | sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java index dfcc518..953424c 100644 --- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java @@ -95,7 +95,12 @@ public class UnifiedSearchProcessor { int totalSuggestionsFromProviders = 0; List<SearchSuggestion> suggestions = null; for (SearchProvider searchProvider : searchProviderRegistry.getSearchProviders()) { - suggestions = searchProvider.search(searchRequest); + if (searchProvider.isPassThrough()){ + suggestions = searchProvider.searchPassThrough(payload); + } else { + suggestions = searchProvider.search(searchRequest); + } + totalSuggestionsFromProviders += suggestions.size(); searchProviderSuggestions.put(searchProvider.getClass().getCanonicalName(), suggestions); } diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java index fce4550..f9eb503 100644 --- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java @@ -29,4 +29,12 @@ public interface SearchProvider { List<SearchSuggestion> search(QuerySearchEntity queryRequest); + default boolean isPassThrough() { + return false; + } + + default List<SearchSuggestion> searchPassThrough(String payload) { + return null; + } + } |