
pl.allegro.tech.hermes.management.domain.owner.OwnerSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-management Show documentation
Show all versions of hermes-management Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.management.domain.owner;
import java.util.List;
import java.util.Optional;
import pl.allegro.tech.hermes.api.ErrorCode;
import pl.allegro.tech.hermes.api.Owner;
import pl.allegro.tech.hermes.management.domain.ManagementException;
public interface OwnerSource {
String name();
boolean exists(String ownerId);
Owner get(String id) throws OwnerNotFound;
default boolean isDeprecated() {
return false;
}
/** Override if the implemented owner source supports autocompletion. */
default Optional autocompletion() {
return Optional.empty();
}
interface Autocompletion {
List ownersMatching(String searchString);
}
class OwnerNotFound extends ManagementException {
public OwnerNotFound(String source, String id) {
super("Owner of id '" + id + "' not found in source " + source);
}
@Override
public ErrorCode getCode() {
return ErrorCode.OWNER_NOT_FOUND;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy