View Javadoc

1   /*
2    * $HeadURL: $
3    * $Date: $
4    * $Revision: $
5    * $Author: $
6    * 
7    * Copyright (c) 2006 MindTree Consulting Ltd. 
8    * 
9    * This file is part of Insight.
10   * 
11   * Insight is free software: you can redistribute it and/or modify it under the 
12   * terms of the GNU General Public License as published by the Free Software 
13   * Foundation, either version 3 of the License, or (at your option) any later 
14   * version.
15   * 
16   * Insight is distributed in the hope that it will be useful, but 
17   * WITHOUT ANY WARRANTY; without even the implied warranty of 
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
19   * Public License for more details.
20   * 
21   * You should have received a copy of the GNU General Public License along with 
22   * Insight.  If not, see <http://www.gnu.org/licenses/>.
23   */
24  package com.mindtree.techworks.insight.reporting.jobs.message;
25  
26  import java.io.Serializable;
27  
28  import com.mindtree.techworks.insight.filter.criteria.FilterCriteria;
29  
30  /**
31   * A <code>JobMessage</code> is the data passed on to a <code>Job</code> for
32   * executing its task. Specializations of this class would have additional
33   * information regardin the data content and action modifiers for the
34   * <code>Job</code>. For example, an email message might have data like the
35   * mesage body, the recepients address, etc.
36   * <p>
37   * A <code>JobMessage</code> is uniquely identified by the type string
38   * returned by the object (the <code>#getJobMessageType()</code> method).
39   * </p>
40   * <p>
41   * The <code>DefaultJobMessage</code> implementation provided is supported by 
42   * all <code>Job</code>s.
43   * </p>
44   * 
45   * @see com.mindtree.techworks.insight.reporting.jobs.Job
46   * @see com.mindtree.techworks.insight.reporting.jobs.message.DefaultJobMessage
47   * 
48   * @author <a href="mailto:bindul_bhowmik@mindtree.com">Bindul Bhowmik</a>
49   * @version $Revision: 27 $ $Date: 2007-12-16 04:58:03 -0700 (Sun, 16 Dec 2007) $
50   * @since Insight 1.5
51   */
52  public interface JobMessage extends Serializable {
53  	
54  	// -------------------------------------------------------------------------
55  	// Constants
56  	// -------------------------------------------------------------------------
57  	
58  	/**
59  	 * Indicates that the message was generated while Insight was running in the
60  	 * Interactive mode.
61  	 */
62  	public static final short MODE_INTERACTIVE = 0;
63  	
64  	/**
65  	 * Indicates that the message was generated while Insight was running in the
66  	 * Daemon mode.
67  	 */
68  	public static final short MODE_DAEMON = 1;
69  	
70  	/**
71  	 * Indicates that the message was generated from a Filter action.
72  	 */
73  	public static final int ACTION_FILTER = 1;
74  	
75  	// -------------------------------------------------------------------------
76  	// Public Methods
77  	// -------------------------------------------------------------------------
78  	
79  	/**
80  	 * Returns the type of the message. A message may be identified uniquely by
81  	 * the fully qualified class name of the <code>JobMessage</code> class.
82  	 * 
83  	 * @return The type of the message.
84  	 */
85  	public String getJobMessageType();
86  
87  	/**
88  	 * Returns the criteria that was in use on the action while the message was
89  	 * generated.
90  	 * 
91  	 * @return The criteria in use to generate the message.
92  	 */
93  	public FilterCriteria getFilterCriteria();
94  	
95  	/**
96  	 * Returns the mode in which Insight was running when the message was
97  	 * generated. It would be one of the <i>MODE_</i> constants.
98  	 * 
99  	 * @return The mode in which Insight is running.
100 	 */
101 	public short getInsightMode();
102 	
103 	/**
104 	 * Returns the action which caused the message. See the <i>ACTION_</i>
105 	 * constants.
106 	 * 
107 	 * @return The action which caused the message.
108 	 */
109 	public int getAction();
110 }