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.metasync.MetasyncHistory;
021
022import java.util.UUID;
023
024import javax.annotation.Nullable;
025import javax.validation.Valid;
026import javax.validation.constraints.NotNull;
027
028/**
029 * Interface to access and persists historical metadata synchronization results.
030 */
031@SuppressWarnings("unused")
032public interface MetasyncHistoryService {
033
034  /**
035   * Persists the {@link MetasyncHistory} object.
036   */
037  void createMetasync(@NotNull @Valid MetasyncHistory metasyncHistory);
038
039  /**
040   * Retrieves a pageable result of all the metasync history records.
041   */
042  PagingResponse<MetasyncHistory> listMetasync(@Nullable Pageable page);
043
044  /**
045   * Lists the {@link MetasyncHistory} of a installation. The result is sorted by the sync date.
046   */
047  PagingResponse<MetasyncHistory> listMetasync(@NotNull UUID installationKey, @Nullable Pageable page);
048
049}