001/*
002 * Copyright 2013 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.Network;
022
023import java.util.UUID;
024import javax.annotation.Nullable;
025
026public interface NetworkService
027  extends NetworkEntityService<Network> {
028
029  /**
030   * Pages through dataset constituents of a network, i.e. returns datasets which have an entry in the dataset_network
031   * table.
032   *
033   * @param networkKey the network identifier
034   */
035  PagingResponse<Dataset> listConstituents(UUID networkKey, @Nullable Pageable page);
036
037  /**
038   * Adds an existing dataset to the list of constituents of a network.
039   * @param networkKey the network to add the dataset to
040   * @param datasetKey the dataset to be added
041   */
042  void addConstituent(UUID networkKey, UUID datasetKey);
043
044  /**
045   * Removes an existing constituent dataset from a network.
046   * @param networkKey the network to remove the dataset from
047   * @param datasetKey the dataset to be removed
048   */
049  void removeConstituent(UUID networkKey, UUID datasetKey);
050}