01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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:
17: package org.compass.gps.device.hibernate.scrollable.snapshot;
18:
19: import java.util.List;
20:
21: import org.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping;
22: import org.compass.gps.spi.CompassGpsInterfaceDevice;
23: import org.hibernate.Session;
24:
25: /**
26: * A create and update snapshot event, works with
27: * {@link org.compass.gps.device.hibernate.scrollable.snapshot.HibernateSnapshotEventListener#onCreateAndUpdate(CreateAndUpdateSnapshotEvent)}.
28: * Holds the
29: * {@link org.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping} that
30: * maps to the result set that initiated the event, a list of
31: * {@link org.compass.gps.device.hibernate.scrollable.snapshot.HibernateAliasRowSnapshot} for all the
32: * row snapapshots that were created and a list for all the ones that were
33: * updated, and the <code>CompassTemplate</code> to use in order to reflect
34: * the changes to the index.
35: *
36: * @author kimchy
37: */
38: public class CreateAndUpdateSnapshotEvent extends AbstractSnapshotEvent {
39:
40: private ResultSetToResourceMapping mapping;
41:
42: private CompassGpsInterfaceDevice compassGps;
43:
44: private List createSnapshots;
45:
46: private List updateSnapshots;
47:
48: public CreateAndUpdateSnapshotEvent(Session session,
49: ResultSetToResourceMapping mapping, List createSnapshots,
50: List updateSnapshots, CompassGpsInterfaceDevice compassGps) {
51: super (session);
52: this .mapping = mapping;
53: this .createSnapshots = createSnapshots;
54: this .updateSnapshots = updateSnapshots;
55: this .compassGps = compassGps;
56: }
57:
58: public List getCreateSnapshots() {
59: return createSnapshots;
60: }
61:
62: public List getUpdateSnapshots() {
63: return updateSnapshots;
64: }
65:
66: public ResultSetToResourceMapping getMapping() {
67: return mapping;
68: }
69:
70: public CompassGpsInterfaceDevice getCompassGps() {
71: return compassGps;
72: }
73:
74: }
|