1 | /* |
2 | * Copyright 2005-2006 The RbUtils Project |
3 | * |
4 | * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0 |
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 | */ |
17 | |
18 | // $Id$ |
19 | |
20 | package org.ktc.rbutils.api.audit.event; |
21 | |
22 | import org.ktc.rbutils.api.audit.MessageType; |
23 | import org.ktc.rbutils.api.i18n.Message; |
24 | |
25 | |
26 | /** |
27 | * Event that occur during the process of an audit in the RbUtils project. |
28 | * @since RbUtils 0.9.3.3 |
29 | * @version $Revision$ |
30 | * @author moishi |
31 | */ |
32 | public class ProcessEvent extends RbEvent { |
33 | /** |
34 | * Automaticly generated field for backward compatibility. |
35 | */ |
36 | private static final long serialVersionUID = 2896833141842651379L; |
37 | |
38 | /** |
39 | * Adds information to the <code>Message</code> of this Event. |
40 | */ |
41 | protected String detailledMessage; |
42 | |
43 | /** |
44 | * Message contained by this Event. |
45 | */ |
46 | protected Message message; |
47 | |
48 | /** |
49 | * Type of Message that defined this Event. |
50 | */ |
51 | protected MessageType messagetype; |
52 | |
53 | /** |
54 | * Constructs a <code>ProcessEvent</code>. |
55 | * @param source the object on which the Event initially occurred. |
56 | * @throws IllegalArgumentException if source is <code>null</code>. |
57 | */ |
58 | public ProcessEvent(final Object source) { |
59 | this(source, null, null, null); |
60 | } |
61 | |
62 | /** |
63 | * Constructs a <code>ProcessEvent</code>. |
64 | * @param source the object on which the Event initially occurred. |
65 | * @param messagetype the type of the message. |
66 | * @param message the Message of this Event. |
67 | * @param detailledMessage an additionnal message. |
68 | * @throws IllegalArgumentException if source is <code>null</code>. |
69 | */ |
70 | public ProcessEvent(final Object source, final MessageType messagetype, final Message message, |
71 | final String detailledMessage) |
72 | { |
73 | super(source); |
74 | this.messagetype = messagetype; |
75 | this.message = message; |
76 | this.detailledMessage = detailledMessage; |
77 | } |
78 | |
79 | /** |
80 | * Returns the display form of the Message of this Event. |
81 | * @return the display form of the Message of this Event. |
82 | */ |
83 | public String getMessageDisplay() { |
84 | return message.getMessage(); |
85 | } |
86 | |
87 | /** |
88 | * Returns the display form of the MessageType of this Event. |
89 | * @return the display form of the MessageType of this Event. |
90 | */ |
91 | public String getMessageTypeDisplay() { |
92 | return messagetype.getDisplay(); |
93 | } |
94 | |
95 | /** |
96 | * Returns the detailled message of this Event. |
97 | * @return the detailled message of this Event. |
98 | */ |
99 | public String getDetailledMessage() { |
100 | return detailledMessage; |
101 | } |
102 | |
103 | } |