Skip to content

Commit

Permalink
add @nullable annotations to some variables and methods;
Browse files Browse the repository at this point in the history
extend javadoc;

Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed Dec 7, 2021
1 parent 6f92391 commit dd7d4b3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public final class DittoSearchConfig implements SearchConfig, WithConfigPath {

private final DittoServiceConfig dittoServiceConfig;
@Nullable private final String mongoHintsByNamespace;
private final String queryCriteriaValidator;
private final String searchUpdateMapper;
private final String searchUpdateObserver;
@Nullable private final String queryCriteriaValidator;
@Nullable private final String searchUpdateMapper;
@Nullable private final String searchUpdateObserver;
private final UpdaterConfig updaterConfig;
private final HealthCheckConfig healthCheckConfig;
private final IndexInitializationConfig indexInitializationConfig;
Expand Down Expand Up @@ -88,16 +88,19 @@ public Optional<String> getMongoHintsByNamespace() {
return Optional.ofNullable(mongoHintsByNamespace);
}

@Nullable
@Override
public String getQueryValidatorImplementation() {
return queryCriteriaValidator;
}

@Nullable
@Override
public String getSearchUpdateMapperImplementation() {
return searchUpdateMapper;
}

@Nullable
@Override
public String getSearchUpdateObserverImplementation() {
return searchUpdateObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.util.Optional;

import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;

import org.eclipse.ditto.base.service.config.ServiceSpecificConfig;
Expand All @@ -37,22 +38,25 @@ public interface SearchConfig extends ServiceSpecificConfig, WithHealthCheckConf
* {@link org.eclipse.ditto.rql.query.criteria.Criteria} of a
* {@link org.eclipse.ditto.thingsearch.model.signals.commands.query.ThingSearchQueryCommand}.
*
* @return the config.
* @return the query validator implementation or {@code null}.
*/
@Nullable
String getQueryValidatorImplementation();

/**
* Returns the {@code SearchUpdateMapper} to be used for additional processing of search updates.
*
* @return the config.
* @return the search update mapper implementation or {@code null}.
*/
@Nullable
String getSearchUpdateMapperImplementation();

/**
* Returns the {@code SearchUpdateObserver} to be used for additional processing of search updates.
*
* @return the name of the implementing class.
* @return the name of the implementing class or {@code null}.
*/
@Nullable
String getSearchUpdateObserverImplementation();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*/
package org.eclipse.ditto.thingsearch.service.updater.actors;

import javax.annotation.Nullable;

import org.eclipse.ditto.json.JsonObject;
import org.eclipse.ditto.thingsearch.service.persistence.write.model.Metadata;

Expand All @@ -27,7 +29,7 @@ public DefaultSearchUpdateObserver(final ActorSystem system) {
}

@Override
public void process(final Metadata metadata, final JsonObject thingJson) {
public void process(final Metadata metadata, @Nullable final JsonObject thingJson) {
// noop
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ public abstract class SearchUpdateObserver implements Extension {
/**
* Load a {@code SearchUpdateObserver} dynamically according to the search configuration.
*
* @param actorSystem The actor system in which to load the observer.
* @return The thing event observer.
* @param actorSystem the actor system in which to load the observer.
* @return the thing event observer.
*/
public static SearchUpdateObserver get(final ActorSystem actorSystem) {
return EXTENSION_ID.get(actorSystem);
}

/**
* Process the given {@code ThingEvent}.
* Process the given {@code Metadata} and thing as {@code JsonObject}.
*
* @param metadata the thing event
* @param metadata the metadata for the update.
* @param thingJson the thing used for the update as jsonObject.
*/
public abstract void process(final Metadata metadata, @Nullable final JsonObject thingJson);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private Metadata exportMetadataWithSender(final boolean shouldAcknowledge,
/**
* Push metadata of this updater to the queue of thing-changes to be streamed into the persistence.
*
* @param updateReason TODO
* @param updateReason the reason why the search index is updated.
*/
private void enqueueMetadata(final UpdateReason updateReason) {
enqueueMetadata(exportMetadata(null, null).withUpdateReason(updateReason));
Expand Down

0 comments on commit dd7d4b3

Please sign in to comment.