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.jdbc.snapshot;
18:
19: import org.compass.gps.device.jdbc.JdbcGpsDeviceException;
20:
21: /**
22: * An interface for listening for real time data changes in the databases. The
23: * events are fired by a
24: * {@link org.compass.gps.device.jdbc.JdbcActiveMirrorGpsDevice}.
25: *
26: * @author kimchy
27: */
28: public interface JdbcSnapshotEventListener {
29:
30: /**
31: * A configure event fired when the systems starts.
32: *
33: * @param configureSnapshotEvent
34: * @throws JdbcGpsDeviceException
35: */
36: void configure(ConfigureSnapshotEvent configureSnapshotEvent)
37: throws JdbcGpsDeviceException;
38:
39: /**
40: * A create and update event. Fired with all the created rows and updated
41: * rows for a given result set when the <code>performMirroring</code> is
42: * called.
43: *
44: * @param createAndUpdateSnapshotEvent
45: * @throws JdbcGpsDeviceException
46: */
47: void onCreateAndUpdate(
48: CreateAndUpdateSnapshotEvent createAndUpdateSnapshotEvent)
49: throws JdbcGpsDeviceException;
50:
51: /**
52: * A delete event. Fired with all the deleted rows for a given result set
53: * when the <code>performMirroring</code> is called.
54: *
55: * @param deleteSnapshotEvent
56: * @throws JdbcGpsDeviceException
57: */
58: void onDelete(DeleteSnapshotEvent deleteSnapshotEvent)
59: throws JdbcGpsDeviceException;
60: }
|