01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.messaging;
18:
19: import java.util.List;
20: import java.util.Map;
21:
22: import javax.xml.namespace.QName;
23:
24: /**
25: * Service for interfacing with the queue of asynchronous messages.
26: *
27: * @see PersistedMessage
28: *
29: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
30: */
31: public interface MessageQueueService {
32:
33: public List<PersistedMessage> findByServiceName(QName serviceName,
34: String methodName);
35:
36: public void delete(PersistedMessage routeQueue);
37:
38: public void save(PersistedMessage routeQueue);
39:
40: public List<PersistedMessage> findAll();
41:
42: public List<PersistedMessage> findAll(int maxRows);
43:
44: /**
45: * Finds the PersistedMessage identified by the passed-in primary key, if one is
46: * available, otherwise returns a null object.
47: *
48: * @param routeQueueId The primary key routeQueueId of the message desired.
49: * @return A populated PersistedMessage instance, if the routeQueueId exists, otherwise
50: * a null object.
51: */
52: public PersistedMessage findByRouteQueueId(Long routeQueueId);
53:
54: // public List getNextDocuments();
55:
56: /**
57: * Returns a List of RouteQueue documents which are queued for routing. Will not
58: * return more RouteQueues than the value of maxDocuments.
59: */
60: public List<PersistedMessage> getNextDocuments(Integer maxDocuments);
61:
62: public PersistedMassagePayload findByPersistedMessageByRouteQueueId(
63: Long routeQueueId);
64:
65: /**
66: * Finds the persisted messages that match the values passed into the
67: * criteriaValues Map, with an auto-wildcard function, if no wildcard
68: * is passed in.
69: *
70: * @param criteriaValues A Map of Key/Value pairs, where the Key is a string holding the field
71: * name, and the Value is a string holding the value to match.
72: * @param maxRows the maximum number of rows to return from the query. If -1, then all rows will be returned.
73: * @return A populated (or empty) list containing the results of the search. If no matches are made,
74: * an empty list will be returned.
75: */
76: public List<PersistedMessage> findByValues(
77: Map<String, String> criteriaValues, int maxRows);
78:
79: /**
80: * Used to determine the maximum number of retries allowed by the system before the
81: * message goes into Exception.
82: *
83: * @return The max retry attempts set in the system.
84: */
85: public Integer getMaxRetryAttempts();
86:
87: public PersistedMessage getMessage(ServiceInfo serviceInfo,
88: AsynchronousCall methodCall);
89: }
|