001/*
002 * Copyright 2013 Global Biodiversity Information Facility (GBIF)
003 * Licensed under the Apache License, Version 2.0 (the "License");
004 * you may not use this file except in compliance with the License.
005 * You may obtain a copy of the License at
006 * http://www.apache.org/licenses/LICENSE-2.0
007 * Unless required by applicable law or agreed to in writing, software
008 * distributed under the License is distributed on an "AS IS" BASIS,
009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
010 * See the License for the specific language governing permissions and
011 * limitations under the License.
012 */
013package org.gbif.api.service.registry;
014
015import org.gbif.api.model.common.paging.Pageable;
016import org.gbif.api.model.common.paging.PagingResponse;
017import org.gbif.api.model.registry.metasync.MetasyncHistory;
018
019import java.util.UUID;
020
021import javax.annotation.Nullable;
022import javax.validation.constraints.NotNull;
023
024/**
025 * Interface to access and persists historical metadata synchronization results.
026 */
027public interface MetasyncHistoryService {
028
029  /**
030   * Persists the {@link MetasyncHistory} object.
031   */
032  void createMetasync(@NotNull MetasyncHistory metasyncHistory);
033
034  /**
035   * Retrieves a pageable result of all the metasync history records.
036   */
037  PagingResponse<MetasyncHistory> listMetasync(@Nullable Pageable page);
038
039  /**
040   * Lists the {@link MetasyncHistory} of a installation. The result is sorted by the sync date.
041   */
042  PagingResponse<MetasyncHistory> listMetasync(@NotNull UUID installationKey, @Nullable Pageable page);
043
044}