001/*
002 * Copyright 2020 Global Biodiversity Information Facility (GBIF)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.gbif.api.service.registry;
017
018import org.gbif.api.model.common.paging.Pageable;
019import org.gbif.api.model.common.paging.PagingResponse;
020import org.gbif.api.model.registry.Dataset;
021import org.gbif.api.model.registry.Installation;
022import org.gbif.api.model.registry.Organization;
023import org.gbif.api.model.registry.search.InstallationRequestSearchParams;
024import org.gbif.api.model.registry.search.KeyTitleResult;
025import org.gbif.api.model.registry.search.OrganizationRequestSearchParams;
026import org.gbif.api.vocabulary.InstallationType;
027
028import java.util.List;
029import java.util.UUID;
030
031import javax.annotation.Nullable;
032import javax.validation.constraints.NotNull;
033
034@SuppressWarnings("unused")
035public interface InstallationService
036    extends NetworkEntityService<Installation> {
037
038  /**
039   * Provides paging service to list datasets hosted by a specific installation.
040   *
041   * @param page paging parameters to use, if {@code page} is {@code null} sensible defaults will be
042   *     used
043   */
044  PagingResponse<Dataset> getHostedDatasets(@NotNull UUID installationKey, @Nullable Pageable page);
045
046  /** Provides access to deleted installations. */
047  PagingResponse<Installation> listDeleted(InstallationRequestSearchParams searchParams);
048
049  /** Provides access to installations that serve no datasets. */
050  PagingResponse<Installation> listNonPublishing(@Nullable Pageable page);
051
052  /** Provides a simple suggest service. */
053  List<KeyTitleResult> suggest(@Nullable String q);
054
055  /**
056   * Provides paging service to list installations filtered by a particular installation type.
057   *
058   * @param type the installation type filter
059   * @return list of installations ordered by creation date with latest coming first
060   */
061  PagingResponse<Installation> listByType(InstallationType type, @Nullable Pageable page);
062
063  /**
064   * Provides paging service to list installations that can be filtered by multiple parameters.
065   *
066   * @param searchParams {@link InstallationRequestSearchParams}
067   * @return list of installations ordered by creation date with the latest coming first
068   */
069  PagingResponse<Installation> list(InstallationRequestSearchParams searchParams);
070}