001: /*
002: * CoadunationLib: The coaduntion implementation library.
003: * Copyright (C) 2007 Rift IT Contracting
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
018: *
019: * AuditTrailEntry.java
020: */
021:
022: // package path
023: package com.rift.coad.lib.audit;
024:
025: // imports
026: import java.util.Date;
027:
028: /**
029: * This object responsible for storing the information pertinant to a
030: * single audit trail event.
031: *
032: * @author brett chaldecott
033: */
034: public class AuditTrailEntry implements java.io.Serializable {
035:
036: // private member variables
037: private Date recordTime = new Date();
038: private String user = null;
039: private String target = null;
040: private String method = null;
041: private Throwable cause = null;
042:
043: /**
044: * Creates a new instance of AuditTrailEntry
045: *
046: * @param user The user of the entry.
047: * @param target The target of the entry.
048: * @param method The begin called.
049: */
050: public AuditTrailEntry(String user, String target, String method) {
051: this .user = user;
052: this .target = target;
053: this .method = method;
054: }
055:
056: /**
057: * Creates a new instance of AuditTrailEntry
058: *
059: * @param user The user of the entry.
060: * @param target The target of the entry.
061: * @param method The begin called.
062: * @param cause The cause of the error.
063: */
064: public AuditTrailEntry(String user, String target, String method,
065: Throwable cause) {
066: this .user = user;
067: this .target = target;
068: this .method = method;
069: this .cause = cause;
070: }
071:
072: /**
073: * This method returns the record time.
074: *
075: * @return The record time for the audit trail entry.
076: */
077: public Date getRecordTime() {
078: return recordTime;
079: }
080:
081: /**
082: * This method returns the user name.
083: */
084: public String getUser() {
085: return user;
086: }
087:
088: /**
089: * This method returns the target object of the audit trail entry.
090: *
091: * @return The string containing the target information.
092: */
093: public String getTarget() {
094: return target;
095: }
096:
097: /**
098: * This method returns the string name method information.
099: *
100: * @return The string containing the method information.
101: */
102: public String getMethod() {
103: return method;
104: }
105:
106: /**
107: * This method returns the cause of the audit trail error.
108: *
109: * @return The cause of the audit trail entry.
110: */
111: public Throwable getCause() {
112: return cause;
113: }
114: }
|