001/******************************************************************************* 002 * Copyright 2018 The MIT Internet Trust Consortium 003 * 004 * Portions copyright 2011-2013 The MITRE Corporation 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 *******************************************************************************/ 018package org.mitre.openid.connect.service; 019 020import java.util.Collection; 021 022import org.mitre.openid.connect.model.WhitelistedSite; 023 024/** 025 * Interface for WhitelistedSite service 026 * 027 * @author Michael Joseph Walsh, aanganes 028 * 029 */ 030public interface WhitelistedSiteService { 031 032 /** 033 * Return a collection of all WhitelistedSite managed by this service 034 * 035 * @return the WhitelistedSite collection, or null 036 */ 037 public Collection<WhitelistedSite> getAll(); 038 039 /** 040 * Returns the WhitelistedSite for the given id 041 * 042 * @param id 043 * id the id of the WhitelistedSite 044 * @return a valid WhitelistedSite if it exists, null otherwise 045 */ 046 public WhitelistedSite getById(Long id); 047 048 /** 049 * Find a WhitelistedSite by its associated ClientDetails reference 050 * 051 * @param client the Relying Party 052 * @return the corresponding WhitelistedSite if one exists for the RP, or null 053 */ 054 public WhitelistedSite getByClientId(String clientId); 055 056 057 058 /** 059 * Removes the given WhitelistedSite from the repository 060 * 061 * @param address 062 * the WhitelistedSite object to remove 063 */ 064 public void remove(WhitelistedSite whitelistedSite); 065 066 /** 067 * Persists a new WhitelistedSite 068 * 069 * @param whitelistedSite 070 * the WhitelistedSite to be saved 071 * @return 072 */ 073 public WhitelistedSite saveNew(WhitelistedSite whitelistedSite); 074 075 /** 076 * Updates an existing whitelisted site 077 */ 078 public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite); 079 080}