// Path: src/main/java/eu/luminis/elastic/SingleClusterRestClientFactoryBean.java
// public static final String DEFAULT_CLUSTER_NAME = "default-cluster";


import static eu.luminis.elastic.SingleClusterRestClientFactoryBean.DEFAULT_CLUSTER_NAME;
package eu.luminis.elastic.document;


/**
 * Wrapper for the {@code DocumentService} without the option to work with multiple clusters. Only the default cluster
 * is available.
 */
public class SingleClusterDocumentService {
    private DocumentService documentService;

    /**
     * Default constructor
     *
     * @param documentService Wrapped document service
     */
    public SingleClusterDocumentService(DocumentService documentService) {
        this.documentService = documentService;
    }

    /**
     * By specifying the unique identification of an object we can return only that object. If we cannot find the object
     * we throw an {@link QueryByIdNotFoundException}.
     *
     * @param request Object containing the required parameters
     * @param <T>     Type of the object to be mapped to
     * @return Found object of type T
     */
    public <T> T queryById(QueryByIdRequest request) {
// Path: src/main/java/eu/luminis/elastic/SingleClusterRestClientFactoryBean.java
// public static final String DEFAULT_CLUSTER_NAME = "default-cluster";


// Path: src/main/java/eu/luminis/elastic/document/SingleClusterDocumentService.java
import static eu.luminis.elastic.SingleClusterRestClientFactoryBean.DEFAULT_CLUSTER_NAME;

package eu.luminis.elastic.document;


/**
 * Wrapper for the {@code DocumentService} without the option to work with multiple clusters. Only the default cluster
 * is available.
 */
public class SingleClusterDocumentService {
    private DocumentService documentService;

    /**
     * Default constructor
     *
     * @param documentService Wrapped document service
     */
    public SingleClusterDocumentService(DocumentService documentService) {
        this.documentService = documentService;
    }

    /**
     * By specifying the unique identification of an object we can return only that object. If we cannot find the object
     * we throw an {@link QueryByIdNotFoundException}.
     *
     * @param request Object containing the required parameters
     * @param <T>     Type of the object to be mapped to
     * @return Found object of type T
     */
    public <T> T queryById(QueryByIdRequest request) {
        return documentService.queryById(DEFAULT_CLUSTER_NAME, request);