001/*
002 * JDrupes Builder
003 * Copyright (C) 2026 Michael N. Lipp
004 * 
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
017 */
018
019package org.jdrupes.builder.api;
020
021import java.util.function.Consumer;
022import java.util.stream.Stream;
023
024/// The interface BoundResourceQuery.
025///
026@Deprecated
027public interface BoundResourceQuery<T extends Resource> {
028
029    /// Exclude the given provider when fetching resources.
030    ///
031    /// @param provider the provider
032    /// @return the bound resource query
033    ///
034    BoundResourceQuery<T> without(ResourceProvider provider);
035
036    /// Exclude providers of the given type when fetching resources.
037    ///
038    /// @param providerType the provider type
039    /// @return the bound resource query
040    ///
041    BoundResourceQuery<T>
042            without(Class<? extends ResourceProvider> providerType);
043
044    /// Register a callback for logging the provider invocation.
045    ///
046    /// @param hook the hook
047    /// @return the bound resource query
048    ///
049    BoundResourceQuery<T> onBeforeFetch(Consumer<ResourceProvider> hook);
050
051    /// Returns the requested resources using the context and providers 
052    /// passed to the record's constructor.
053    ///
054    /// @param <T> the generic type
055    /// @param request the request
056    /// @return the stream
057    ///
058    Stream<T> fetch();
059
060}