001/**
002 * Copyright 2011 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015
016package org.kuali.mobility.push.dao;
017
018import java.util.List;
019
020import org.kuali.mobility.push.entity.Sender;
021
022/**
023 * Data Access Object Interface for Sender Objects
024 * 
025 * @author Kuali Mobility Team (mobility.dev@kuali.org)
026 * @since 2.0.0
027 */
028public interface SenderDao {
029
030        /**
031         * Persists a <code>Sender</code> object.
032         * @param sender Sender to persist.
033         */
034         void saveSender(Sender sender);
035
036        /**
037         * Removes a <code>Sender</code> object.
038         * @param sender Sender to remove.
039         */
040         boolean removeSender(Sender sender);
041
042        /**
043         * Determine validity/availability of the senderKey.
044         * @param senderKey SenderKey to determine if valid.
045         * @return validity of a senderKey.
046         */
047                boolean isValidSenderKey(String senderKey);
048        
049        /**
050         * Find and return all available <code>Sender</code> objects, useful for opt-in/opt-out preferences.
051         * @return List of all <code>Sender</code> objects.
052         */
053                List<Sender> findAllSenders();
054
055        /**
056         * Find and return all available <code>Sender</code> objects, useful for opt-in/opt-out preferences.
057         * @return List of all <code>Sender</code> objects whom are not set to be hidden.
058         */
059                List<Sender> findAllUnhiddenSenders();
060        
061        /**
062         * Find and return <code>Sender</code> object, using Id as search criteria.
063         * @param id Id for the <code>Sender</code> to find.
064         * @return <code>Sender</code> as determined by id.
065         */
066                Sender findSenderById(long id);
067
068        /**
069         * Find and return <code>Sender</code> object, using Name as search criteria.
070         * @param name Name of the <code>Sender</code> to find.
071         * @return <code>Sender</code> as determined by Name.
072         */     
073                Sender findSenderByName(String name);
074        
075        /**
076         * Find and return <code>Sender</code> object, using ShortName as search criteria.
077         * @param shortName ShortName for the <code>Sender</code> to find.
078         * @return <code>Sender</code> as determined by ShortName.
079         */
080                Sender findSenderByShortName(String shortName);
081        
082        /**
083         * Find and return <code>Sender</code> object, using SenderKey as search criteria.
084         * @param senderKey SenderKey for the <code>Sender</code> to find.
085         * @return <code>Sender</code> as determined by SenderKey.
086         */
087                Sender findSenderBySenderKey(String senderKey);
088        
089}