Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2004 Regents of the University of California and the
4
 *             National Center for Ecological Analysis and Synthesis
5
 *
6
 *   '$Author: tao $'
7
 *     '$Date: 2015-02-06 11:55:38 -0800 (Fri, 06 Feb 2015) $'
8
 * '$Revision: 9098 $'
9
 *
10
 * This program is free software; you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation; either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program; if not, write to the Free Software
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
 */
24
package edu.ucsb.nceas.metacat;
25

    
26
/**
27
 * A data structure holding the information to be logged about an event.
28
 * 
29
 * TODO: add a timestamp field for when the event occurred.
30
 * 
31
 * @author jones
32
 */
33
public class EventLogData {
34
	private String ipAddress;
35
	private String userAgent;
36
	private String principal;
37
	private String docid;
38
	private String event;
39
	
40
	
41
	/**
42
	 * Construct an EventLogData object with event log information.
43
	 * 
44
	 * @param ipAddress the internet protocol address for the event
45
	 * @param principal the principal for the event (a username, etc)
46
	 * @param docid the identifier of the document to which the event applies
47
	 * @param revision the revision of the document to which the event applies
48
	 * @param event the string code for the event
49
	 */
50
	public EventLogData(String ipAddress, String userAgent, String principal, String docid, String event) {
51
		this.ipAddress = ipAddress;
52
		this.userAgent = userAgent;
53
		this.principal = principal;
54
		this.docid = docid;
55
		this.event = event;
56
	}
57
	
58
	/**
59
	 * Get the current value of the document identifier.
60
	 * @return Returns the docid.
61
	 */
62
	public String getDocid() {
63
		return docid;
64
	}
65
	
66
	/**
67
	 * Set the document identifier.
68
	 * 
69
	 * @param docid The docid to set.
70
	 */
71
	public void setDocid(String docid) {
72
		this.docid = docid;
73
	}
74
	
75
	/**
76
	 * Get the current value of the event.
77
	 * 
78
	 * @return Returns the event.
79
	 */
80
	public String getEvent() {
81
		return event;
82
	}
83
	
84
	/**
85
	 * Set the current value of the event.
86
	 * 
87
	 * @param event The event to set.
88
	 */
89
	public void setEvent(String event) {
90
		this.event = event;
91
	}
92
	
93
	/**
94
	 * Get the current value of the internet protocol address.
95
	 * 
96
	 * @return Returns the ipAddress.
97
	 */
98
	public String getIpAddress() {
99
		return ipAddress;
100
	}
101
	
102
	/**
103
	 * Set the current value of the internet protocol address.
104
	 * 
105
	 * @param ipAddress The ipAddress to set.
106
	 */
107
	public void setIpAddress(String ipAddress) {
108
		this.ipAddress = ipAddress;
109
	}
110
	
111
	/**
112
	 * Get the current value of the principal.  This will be a username or 
113
	 * other user identifier.
114
	 * 
115
	 * @return Returns the principal.
116
	 */
117
	public String getPrincipal() {
118
		return principal;
119
	}
120
	
121
	/**
122
	 * Set the current value of the principal.  This will be a username or 
123
	 * other user identifier.
124
	 * 
125
	 * @param principal The principal to set.
126
	 */
127
	public void setPrincipal(String principal) {
128
		this.principal = principal;
129
	}
130

    
131
	public String getUserAgent() {
132
		return userAgent;
133
	}
134

    
135
	public void setUserAgent(String userAgent) {
136
		this.userAgent = userAgent;
137
	}
138
}
(35-35/64)