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.registry.Contact;
016
017import java.util.List;
018import java.util.UUID;
019import javax.validation.constraints.NotNull;
020
021public interface ContactService {
022
023  int addContact(@NotNull UUID targetEntityKey, @NotNull Contact contact);
024
025  void deleteContact(@NotNull UUID targetEntityKey, int contactKey);
026
027  List<Contact> listContacts(@NotNull UUID targetEntityKey);
028
029  /**
030   * Updates the given contact for the target entity.
031   * 
032   * @param targetEntityKey Which must be the the owner of the contact or else an exception will be thrown.
033   * @param contact To update
034   */
035  void updateContact(@NotNull UUID targetEntityKey, @NotNull Contact contact);
036
037}