| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| KualiExceptionIncidentService |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2007-2008 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.kns.service; | |
| 17 | ||
| 18 | import java.util.Map; | |
| 19 | ||
| 20 | import org.kuali.rice.kns.exception.KualiExceptionIncident; | |
| 21 | ||
| 22 | /** | |
| 23 | * This is used for sending report of an incident | |
| 24 | * | |
| 25 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 26 | * | |
| 27 | */ | |
| 28 | public interface KualiExceptionIncidentService { | |
| 29 | ||
| 30 | /** | |
| 31 | * This method send email to the defined mailing list with a specified subject and | |
| 32 | * message. | |
| 33 | * | |
| 34 | * @param subject | |
| 35 | * @param message | |
| 36 | * @throws Exception | |
| 37 | */ | |
| 38 | public void emailReport(String subject, String message) throws Exception; | |
| 39 | ||
| 40 | /** | |
| 41 | * This method send email to the defined mailing list using the exception incident | |
| 42 | * instance. | |
| 43 | * | |
| 44 | * @param exceptionIncident | |
| 45 | * @throws Exception | |
| 46 | */ | |
| 47 | public void report(KualiExceptionIncident exceptionIncident) throws Exception; | |
| 48 | ||
| 49 | /** | |
| 50 | * This method create an instance of the KualiExceptionIncident from its factory. | |
| 51 | * | |
| 52 | * @param exception | |
| 53 | * @param properties Additional information when the exception is thrown | |
| 54 | * <p>example: | |
| 55 | * <ul> | |
| 56 | * <li>Document id</li> | |
| 57 | * <li>User email</li> | |
| 58 | * <li>User name</li> | |
| 59 | * <li>Component name</li> | |
| 60 | * </ul> | |
| 61 | * @return | |
| 62 | */ | |
| 63 | public KualiExceptionIncident getExceptionIncident( | |
| 64 | Exception exception, Map<String, String> properties); | |
| 65 | ||
| 66 | /** | |
| 67 | * This method create an instance of the KualiExceptionIncident from its factory. | |
| 68 | * This method is used when the thrown exception is not available. It's an implicit | |
| 69 | * initialization. | |
| 70 | * | |
| 71 | * @param properties The list of name-value pairs containing the thrown exception | |
| 72 | * information | |
| 73 | * @return | |
| 74 | */ | |
| 75 | public KualiExceptionIncident getExceptionIncident(Map<String, String> properties); | |
| 76 | } |