All Downloads are FREE. Search and download functionalities are using the official Maven repository.

run.halo.app.extension.ReactiveExtensionClient Maven / Gradle / Ivy

package run.halo.app.extension;

import java.util.Comparator;
import java.util.function.Predicate;
import org.springframework.data.domain.Sort;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import run.halo.app.extension.index.IndexedQueryEngine;

/**
 * ExtensionClient is an interface which contains some operations on Extension instead of
 * ExtensionStore.
 *
 * @author johnniang
 */
public interface ReactiveExtensionClient {

    /**
     * Lists Extensions by Extension type, filter and sorter.
     *
     * @param type is the class type of Extension.
     * @param predicate filters the reEnqueue.
     * @param comparator sorts the reEnqueue.
     * @param  is Extension type.
     * @return all filtered and sorted Extensions.
     */
     Flux list(Class type, Predicate predicate,
        Comparator comparator);

    /**
     * Lists Extensions by Extension type, filter, sorter and page info.
     *
     * @param type is the class type of Extension.
     * @param predicate filters the reEnqueue.
     * @param comparator sorts the reEnqueue.
     * @param page is page number which starts from 0.
     * @param size is page size.
     * @param  is Extension type.
     * @return a list of Extensions.
     */
     Mono> list(Class type, Predicate predicate,
        Comparator comparator, int page, int size);

     Flux listAll(Class type, ListOptions options, Sort sort);

     Mono> listBy(Class type, ListOptions options,
        PageRequest pageable);

    /**
     * Fetches Extension by its type and name.
     *
     * @param type is Extension type.
     * @param name is Extension name.
     * @param  is Extension type.
     * @return an optional Extension.
     */
     Mono fetch(Class type, String name);

    Mono fetch(GroupVersionKind gvk, String name);

     Mono get(Class type, String name);

    Mono getJsonExtension(GroupVersionKind gvk, String name);

    /**
     * Creates an Extension.
     *
     * @param extension is fresh Extension to be created. Please make sure the Extension name does
     * not exist.
     * @param  is Extension type.
     */
     Mono create(E extension);

    /**
     * Updates an Extension.
     *
     * @param extension is an Extension to be updated. Please make sure the resource version is
     * latest.
     * @param  is Extension type.
     */
     Mono update(E extension);

    /**
     * Deletes an Extension.
     *
     * @param extension is an Extension to be deleted. Please make sure the resource version is
     * latest.
     * @param  is Extension type.
     */
     Mono delete(E extension);

    IndexedQueryEngine indexedQueryEngine();

    void watch(Watcher watcher);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy