Class SearchSourceBuilder
- java.lang.Object
-
- org.eclipse.ditto.services.utils.search.SearchSourceBuilder
-
public final class SearchSourceBuilder extends Object
Builder forSearchSource.
-
-
Constructor Summary
Constructors Constructor Description SearchSourceBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchSourcebuild()Create a search-source from this builder.SearchSourceBuilderconciergeForwarder(akka.actor.ActorSelection conciergeForwarder)Set the concierge forwarder to send commands.SearchSourceBuilderdittoHeaders(org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)Set the Ditto headers to use including authorization context and correlation ID.SearchSourceBuilderfields(String fieldsString)Set the selected fields of search results from a comma-separated string.SearchSourceBuilderfields(org.eclipse.ditto.json.JsonFieldSelector fields)Set the selected fields of search results.SearchSourceBuilderfilter(String filter)Set the filter string of the search command.SearchSourceBuilderlastThingId(String lastThingId)Set the last thing ID to resume from.SearchSourceBuildernamespaces(String namespacesString)Set the namespaces of the search command from a comma-separated string.SearchSourceBuildernamespaces(org.eclipse.ditto.json.JsonArray namespaces)Set the namespaces of the search command.SearchSourceBuilderoptions(String options)Set the sort option and sort fields from the value of the options parameter.SearchSourceBuilderpubSubMediator(akka.actor.ActorRef pubSubMediator)Set the pub-sub mediator for error reporting.SearchSourceBuildersearchAskTimeout(Duration searchAskTimeout)Set the timeout when asking the search actor.SearchSourceBuildersort(String sort)Set the sort option as a string with consideration to the default sort option.SearchSourceBuildersortValues(org.eclipse.ditto.json.JsonArray sortValues)Set the sort values for cursor computation.SearchSourceBuilderthingsAskTimeout(Duration thingsAskTimeout)Set the timeout when asking the things-shard-region.
-
-
-
Method Detail
-
build
public SearchSource build()
Create a search-source from this builder.- Returns:
- the search-source.
- Throws:
NullPointerException- if required fields are not set.org.eclipse.ditto.signals.commands.thingsearch.exceptions.InvalidOptionException- if the sort option is invalid.org.eclipse.ditto.model.base.exceptions.InvalidRqlExpressionException- if the filter expression is invalid.
-
pubSubMediator
public SearchSourceBuilder pubSubMediator(akka.actor.ActorRef pubSubMediator)
Set the pub-sub mediator for error reporting.- Parameters:
pubSubMediator- the pub-sub mediator.- Returns:
- this builder.
-
conciergeForwarder
public SearchSourceBuilder conciergeForwarder(akka.actor.ActorSelection conciergeForwarder)
Set the concierge forwarder to send commands.- Parameters:
conciergeForwarder- the concierge forwarder.- Returns:
- this builder.
-
fields
public SearchSourceBuilder fields(@Nullable org.eclipse.ditto.json.JsonFieldSelector fields)
Set the selected fields of search results.- Parameters:
fields- the selected fields.- Returns:
- this builder.
-
fields
public SearchSourceBuilder fields(@Nullable String fieldsString)
Set the selected fields of search results from a comma-separated string.- Parameters:
fieldsString- selected fields as comma-separated string.- Returns:
- this builder.
-
filter
public SearchSourceBuilder filter(@Nullable String filter)
Set the filter string of the search command.- Parameters:
filter- the filter.- Returns:
- this builder.
-
namespaces
public SearchSourceBuilder namespaces(@Nullable org.eclipse.ditto.json.JsonArray namespaces)
Set the namespaces of the search command.- Parameters:
namespaces- the namespaces.- Returns:
- this builder.
-
namespaces
public SearchSourceBuilder namespaces(@Nullable String namespacesString)
Set the namespaces of the search command from a comma-separated string.- Parameters:
namespacesString- namespaces as a comma-separated string.- Returns:
- this builder.
-
sort
public SearchSourceBuilder sort(@Nullable String sort)
Set the sort option as a string with consideration to the default sort option.- Parameters:
sort- the sort string.- Returns:
- this builder.
-
options
public SearchSourceBuilder options(@Nullable String options)
Set the sort option and sort fields from the value of the options parameter.- Parameters:
options- options as comma-separated string.- Returns:
- this builder.
-
sortValues
public SearchSourceBuilder sortValues(@Nullable org.eclipse.ditto.json.JsonArray sortValues)
Set the sort values for cursor computation.- Parameters:
sortValues- values of the sort fields of the last result of a previous search.- Returns:
- this builder.
-
dittoHeaders
public SearchSourceBuilder dittoHeaders(org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
Set the Ditto headers to use including authorization context and correlation ID.- Parameters:
dittoHeaders- the Ditto headers to use.- Returns:
- this builder.
-
thingsAskTimeout
public SearchSourceBuilder thingsAskTimeout(Duration thingsAskTimeout)
Set the timeout when asking the things-shard-region.- Parameters:
thingsAskTimeout- the timeout.- Returns:
- this builder.
-
searchAskTimeout
public SearchSourceBuilder searchAskTimeout(Duration searchAskTimeout)
Set the timeout when asking the search actor.- Parameters:
searchAskTimeout- the timeout.- Returns:
- this builder.
-
lastThingId
public SearchSourceBuilder lastThingId(String lastThingId)
Set the last thing ID to resume from.- Parameters:
lastThingId- the last thing ID.- Returns:
- this builder.
-
-