| 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: FileEvent.java,v 1.3 2006/09/07 20:32:35 ktcguru Exp $ |
| 19 | |
| 20 | package org.ktc.rbutils.api.audit.event; |
| 21 | |
| 22 | import java.util.Locale; |
| 23 | |
| 24 | /** |
| 25 | * Event that occurs on a <code>File</code>. |
| 26 | * @since RbUtils 0.9.3.3 |
| 27 | * @version $Revision: 1.3 $ |
| 28 | * @author moishi |
| 29 | */ |
| 30 | public class FileEvent extends RbEvent { |
| 31 | /** |
| 32 | * Automaticly generated field for backward compatibility. |
| 33 | */ |
| 34 | private static final long serialVersionUID = -598274677534570872L; |
| 35 | |
| 36 | /** Name of the <code>File</code> on which this Event occurs. */ |
| 37 | protected String filename; |
| 38 | |
| 39 | /** |
| 40 | * The Locale of the File on which this Event occurs. |
| 41 | */ |
| 42 | protected Locale locale; |
| 43 | |
| 44 | /** Name of the class corresponding to the processed file. */ |
| 45 | protected String classname; |
| 46 | |
| 47 | /** |
| 48 | * Constructs an Event that occurs on a <code>File</code>. |
| 49 | * @param source the object on which the Event initially occurred. |
| 50 | * @param filename the name of the File on which the Event initially occurred. |
| 51 | * @param locale the Locale of the File. |
| 52 | * @param classname the name of the class corresponding to the processed file. |
| 53 | */ |
| 54 | public FileEvent(final Object source, final String filename, final Locale locale, |
| 55 | final String classname) |
| 56 | { |
| 57 | super(source); |
| 58 | this.filename = filename; |
| 59 | this.locale = locale; |
| 60 | this.classname = classname; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Constructs a prototypical <code>RbEvent</code>. |
| 65 | * @param source the object on which the Event initially occurred. |
| 66 | * @exception IllegalArgumentException if source is <code>null</code>. |
| 67 | */ |
| 68 | public FileEvent(final Object source) { |
| 69 | this(source, null, null, null); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Gets the name of the <code>File</code> on which this Event occurs. |
| 74 | * @return the file. |
| 75 | */ |
| 76 | public final String getFileName() { |
| 77 | return this.filename; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Gets the <code>Locale</code> of the <code>File</code> on which this Event occurs. |
| 82 | * <p> |
| 83 | * This should be the Locale of the File. |
| 84 | * @return the locale. |
| 85 | */ |
| 86 | public final Locale getLocale() { |
| 87 | return this.locale; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Returns the name of the class corresponding to the processed file. |
| 92 | * @return the name of the class corresponding to the processed file. |
| 93 | */ |
| 94 | public final String getClassName() { |
| 95 | return this.classname; |
| 96 | } |
| 97 | |
| 98 | } |