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 ContainerRenderMiner extends DataMinerAdapter {
18: //TODO TreeSet Bug = if same container is requested at the same time, only one is registered.
19: TreeMap data = new TreeMap(); //TreeMap(container, TreeSet(timestamp))
20:
21: public void setMinerCollection(MinerCollection collection) {
22:
23: }
24:
25: public void mine(UBTLogLine logLine) throws Exception {
26: //if RENDER event and container is null - it is tab/page itself.
27: if (!logLine.getEventID().startsWith(
28: UBTLogConstants.EVENT_PROVIDER_RENDER))
29: return;
30: if (logLine.getContainerName() != null)
31: return;
32: String container = logLine.getChannelName();
33: if (data.containsKey(container)) {
34: //get and add to the map
35: ((TreeSet) data.get(container)).add(logLine.getTimestamp());
36: } else {
37: TreeSet containerHitsSet = new TreeSet();
38: containerHitsSet.add(logLine.getTimestamp());
39: data.put(container, containerHitsSet);
40: }
41: }
42:
43: public Object getData() {
44: return data;
45: }
46:
47: public void setData(Object newData) {
48: this .data = (TreeMap) newData;
49: }
50: }
|