001/**
002 * Copyright 2005-2016 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.krad.service;
017
018import org.kuali.rice.krad.exception.KualiExceptionIncident;
019
020import java.util.Map;
021
022/**
023 * This is used for sending report of an incident
024 * 
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 *
027 */
028public interface KualiExceptionIncidentService extends KualiFeedbackService {
029
030    /**
031     * This method send email to the defined mailing list using the exception incident
032     * instance.
033     * 
034     * @param exceptionIncident
035     * @throws Exception
036     */
037    public void report(KualiExceptionIncident exceptionIncident) throws Exception;
038    
039    /**
040     * This method create an instance of the KualiExceptionIncident from its factory.
041     * 
042     * @param exception
043     * @param properties Additional information when the exception is thrown
044     * <p>example:
045     * <ul>
046     * <li>Document id</li>
047     * <li>User email</li>
048     * <li>User name</li>
049     * <li>Component name</li>
050     * </ul>
051     * @return
052     */
053    public KualiExceptionIncident getExceptionIncident(
054            Exception exception, Map<String, String> properties);
055
056    /**
057     * This method create an instance of the KualiExceptionIncident from its factory.
058     * This method is used when the thrown exception is not available. It's an implicit
059     * initialization.
060     * 
061     * @param properties The list of name-value pairs containing the thrown exception
062     * information
063     * @return
064     */
065    public KualiExceptionIncident getExceptionIncident(Map<String, String> properties);
066}