1 /*
2 * Copyright 2007 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
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.ole.gl.batch.service;
17
18 import java.util.Collection;
19
20 import org.kuali.ole.gl.batch.CollectorBatch;
21 import org.kuali.ole.gl.report.CollectorReportData;
22 import org.kuali.ole.gl.service.impl.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, CollectorReportData collectorReportData, String collectorFileDirectoryName);
43
44 /**
45 * Removes any temporarily created origin entries and origin entry groups so that they won't be persisted after the transaction
46 * is committed.
47 *
48 * @param allStatusObjectsFromCollectorExecution a Collection of ScrubberStatus records to help find bad Collector data
49 */
50 public void removeTempGroups(Collection<CollectorScrubberStatus> allStatusObjectsFromCollectorExecution);
51 }