001/**
002 * Copyright 2005-2017 The Kuali Foundation
003 *
004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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.kuali.rice.ksb.messaging.dao;
017
018import org.kuali.rice.ksb.messaging.PersistedMessageBO;
019import org.kuali.rice.ksb.messaging.PersistedMessagePayload;
020
021import javax.xml.namespace.QName;
022import java.util.List;
023import java.util.Map;
024
025
026public interface MessageQueueDAO {
027
028    public void remove(PersistedMessageBO routeQueue);
029
030    public PersistedMessageBO save(PersistedMessageBO routeQueue);
031
032    public PersistedMessageBO findByRouteQueueId(Long routeQueueId);
033
034    public List<PersistedMessageBO> findAll();
035
036    public List<PersistedMessageBO> findAll(int maxRows);
037
038    public List<PersistedMessageBO> getNextDocuments(Integer maxDocuments);
039
040    public List<PersistedMessageBO> findByServiceName(QName serviceName, String methodName);
041
042    /**
043         * Finds the persisted messages that match the values passed into the criteriaValues Map, with an EqualTo criteria
044         * for each.
045         * 
046         * @param criteriaValues
047         *                A Map of Key/Value pairs, where the Key is a string holding the field name, and the Value is a
048         *                string holding the value to match.
049         * @return A populated (or empty) list containing the results of the search. If no matches are made, an empty list
050         *         will be returned.
051         */
052    public List<PersistedMessageBO> findByValues(Map<String, String> criteriaValues, int maxRows);
053
054    public PersistedMessagePayload findByPersistedMessageByRouteQueueId(Long routeQueueId);
055}