001/*******************************************************************************
002 * Copyright 2014 The MITRE Corporation
003 *   and the MIT Kerberos and Internet Trust Consortium
004 * 
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 * 
009 *   http://www.apache.org/licenses/LICENSE-2.0
010 * 
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 ******************************************************************************/
017package org.mitre.openid.connect.repository;
018
019import org.mitre.openid.connect.model.Address;
020
021/**
022 * Address repository interface
023 *
024 * @author Michael Joseph Walsh
025 *
026 */
027public interface AddressRepository {
028
029        /**
030         * Returns the Address for the given id
031         * 
032         * @param id
033         *            id the id of the Address
034         * @return a valid Address if it exists, null otherwise
035         */
036        public Address getById(Long id);
037
038        /**
039         * Removes the given Address from the repository
040         * 
041         * @param address
042         *            the Address object to remove
043         */
044        public void remove(Address address);
045
046        /**
047         * Removes an Address from the repository
048         * 
049         * @param id
050         *            the id of the Address to remove
051         */
052        public void removeById(Long id);
053
054        /**
055         * Persists a Address
056         * 
057         * @param address
058         *            the Address to be saved
059         * @return
060         */
061        public Address save(Address address);
062}