01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.gl.service;
17:
18: import java.util.Collection;
19:
20: import org.kuali.module.gl.batch.collector.CollectorBatch;
21: import org.kuali.module.gl.util.CollectorReportData;
22: import org.kuali.module.gl.util.CollectorScrubberStatus;
23:
24: /**
25: * An interface declaring the methods needed to scrub Collector data
26: */
27: public interface CollectorScrubberService {
28: /**
29: * Runs the scrubber on the origin entries in the batch. Any OEs edits/removals result of the scrub and demerger are removed
30: * from the batch, and the same changes are reflected in the details in the same batch.
31: *
32: * @param batch the data read in by the Collector
33: * @param collectorReportData statistics generated by the scrub run on the Collector data
34: * @return an object with the collector scrubber status. Note that it contains references to at least 4 origin entry groups, and
35: * the origin entry group service and origin entry service under which these groups and their entries are stored. The
36: * groups and their entries are created to facilitate the scrub and reporting processes, and they should not be
37: * persisted after the collector finishes running. Therefore, an collection of all CollectorScrubberStatus objects
38: * returned in a single collector execution (i.e. from a nightly job) must be passed into a parameter to the
39: * {@link #removeTempGroups(Collection)} method.. The service definitions are needed because the collector may choose to
40: * store temporary origin entries and origin entry groups in another service segregated from the database.
41: */
42: public CollectorScrubberStatus scrub(CollectorBatch batch,
43: CollectorReportData collectorReportData);
44:
45: /**
46: * Removes any temporarily created origin entries and origin entry groups so that they won't be persisted after the transaction
47: * is committed.
48: *
49: * @param allStatusObjectsFromCollectorExecution a Collection of ScrubberStatus records to help find bad Collector data
50: */
51: public void removeTempGroups(
52: Collection<CollectorScrubberStatus> allStatusObjectsFromCollectorExecution);
53: }
|