| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| MessagingService |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2005-2011 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl2.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.rice.kcb.api.service; | |
| 17 | ||
| 18 | import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; | |
| 19 | import org.kuali.rice.kcb.api.message.MessageDTO; | |
| 20 | import org.kuali.rice.kcb.api.exception.MessageDeliveryException; | |
| 21 | import org.kuali.rice.kcb.api.exception.MessageDismissalException; | |
| 22 | ||
| 23 | /** | |
| 24 | * The KCB MessagingService provides an API to deliver messages | |
| 25 | * to arbitrary multiple endpoints. | |
| 26 | * | |
| 27 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 28 | */ | |
| 29 | public interface MessagingService { | |
| 30 | /** | |
| 31 | * Delivers a message | |
| 32 | * | |
| 33 | * @param message message to deliver | |
| 34 | * @return identifier for the message | |
| 35 | */ | |
| 36 | public Long deliver(MessageDTO message) throws MessageDeliveryException, RiceIllegalArgumentException; | |
| 37 | /** | |
| 38 | * Removes a specific message and all deliveries | |
| 39 | * | |
| 40 | * @param messageId id of the message to remove | |
| 41 | * @param user the user under which the action was taken | |
| 42 | * @param cause the cause or action taken to remove the message | |
| 43 | */ | |
| 44 | public void remove(long messageId, String user, String cause) throws MessageDismissalException, RiceIllegalArgumentException; | |
| 45 | ||
| 46 | /** | |
| 47 | * Removes a specific message and all deliveries. Does not throw an exception if no message with the origin | |
| 48 | * id is found. | |
| 49 | * | |
| 50 | * @param originId origin id of the message to remove | |
| 51 | * @param user the user under which the action was taken | |
| 52 | * @param cause the cause or action taken to remove the message | |
| 53 | * @return Long the message id of the message removed, if any | |
| 54 | */ | |
| 55 | public Long removeByOriginId(String originId, String user, String cause) throws MessageDismissalException, RiceIllegalArgumentException; | |
| 56 | } |