01: /*
02: * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.ubt.report.data.file.raw;
06:
07: import com.sun.portal.ubt.report.data.MinerCollection;
08: import com.sun.portal.ubt.report.data.UBTLogConstants;
09: import com.sun.portal.ubt.report.data.UBTLogLine;
10:
11: import java.util.TreeMap;
12: import java.util.TreeSet;
13:
14: /**
15: *
16: */
17: public class UserLoginMiner extends DataMinerAdapter {
18: TreeMap data = new TreeMap(); //TreeMap(container, TreeSet(timestamp))
19:
20: public void setMinerCollection(MinerCollection collection) {
21:
22: }
23:
24: public void mine(UBTLogLine logLine) throws Exception {
25: //if RENDER event and container is null - it is tab/page itself.
26: if (!logLine.getEventID().startsWith(
27: UBTLogConstants.EVENT_SESSION_START))
28: return;
29: String user = logLine.getUserID();
30: if (user == null)
31: return;
32: if (data.containsKey(user)) {
33: //get and add to the map
34: ((TreeSet) data.get(user)).add(logLine.getTimestamp());
35: } else {
36: TreeSet userLoginSet = new TreeSet();
37: userLoginSet.add(logLine.getTimestamp());
38: data.put(user, userLoginSet);
39: }
40: }
41:
42: public Object getData() {
43: return data;
44: }
45:
46: public void setData(Object newData) {
47: this .data = (TreeMap) newData;
48: }
49: }
|