01: package com.sun.portal.ubt.report.data.file.aggregate;
02:
03: import com.sun.portal.ubt.report.data.DataMiner;
04: import com.sun.portal.ubt.report.data.MinerCollection;
05: import com.sun.portal.ubt.report.data.UBTLogLine;
06: import com.sun.portal.ubt.report.view.IllegalMinerException;
07:
08: import java.util.Vector;
09:
10: /**
11: *
12: */
13: public abstract class DataMinerAggregatorAdapter implements
14: DataMinerAggregator {
15:
16: protected String minerClassName = null;
17: protected MinerCollection miners = new MinerCollection();
18: protected String PortalID;
19:
20: public void setPortalID(String PortalID) {
21: this .PortalID = PortalID;
22: }
23:
24: public String getPortalID() {
25: return this .PortalID;
26: }
27:
28: private void validate(DataMiner miner) throws IllegalMinerException {
29: // This validation resulted in 6480022.
30: //if (!minerClassName.equals(miner.getClass().getName())){
31: // throw new IllegalMinerException();
32: //}
33: }
34:
35: public final void aggregate() {
36: Vector minersVector = miners.getCollection();
37: for (int i = 0; i < minersVector.size(); i++) {
38: add(((DataMiner) minersVector.get(i)).getData());
39: }
40: }
41:
42: protected abstract void add(Object o);
43:
44: public final void addMiner(DataMiner miner)
45: throws IllegalMinerException {
46: validate(miner);
47: miners.add(miner);
48: }
49:
50: public void setMinerCollection(MinerCollection collection) {
51: }
52:
53: public void mine(UBTLogLine logLine) throws Exception {
54: }
55:
56: }
|