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;
18:
19: import org.compass.gps.ActiveMirrorGpsDevice;
20: import org.compass.gps.device.jdbc.snapshot.JdbcSnapshotEventListener;
21: import org.compass.gps.device.jdbc.snapshot.JdbcSnapshotPersister;
22:
23: /**
24: * An extension of the {@link org.compass.gps.device.jdbc.JdbcGpsDevice} that
25: * can also detect real time data changes made to the database and reflect them
26: * to the index.
27: * <p>
28: * The device will use the
29: * {@link org.compass.gps.device.jdbc.snapshot.JdbcSnapshotEventListener} to
30: * handle database change events (which should be reflected to the index).
31: * <p>
32: * The device will use the provided
33: * {@link org.compass.gps.device.jdbc.snapshot.JdbcSnapshotPersister} to persist
34: * the snapshot information and load it.
35: *
36: * @author kimchy
37: */
38: public interface JdbcActiveMirrorGpsDevice extends JdbcGpsDevice,
39: ActiveMirrorGpsDevice {
40:
41: /**
42: * Returns the jdbc snapshot event listener that will handle database change
43: * events.
44: *
45: * @return The jdbc snapshot event listener.
46: */
47: JdbcSnapshotEventListener getSnapshotEventListener();
48:
49: /**
50: * Sets the jdbc snapshot event listener that will handle database change
51: * events.
52: *
53: * @param snapshotEventListener
54: */
55: void setSnapshotEventListener(
56: JdbcSnapshotEventListener snapshotEventListener);
57:
58: /**
59: * Returns the snapshot persister that will persist and load the snapshot
60: * information.
61: *
62: * @return The Jdbc snapshot persister.
63: */
64: JdbcSnapshotPersister getSnapshotPersister();
65:
66: /**
67: * Sets the snapshot persister that will persist and load the snapshot
68: * information.
69: *
70: * @param snapshotPersister
71: */
72: void setSnapshotPersister(JdbcSnapshotPersister snapshotPersister);
73:
74: /**
75: * Should the snapshot be saved/persisted after each mirroring operation.
76: * <p>
77: * Note that it is persisted when the gps device stops.
78: *
79: * @return <code>true</code> if the snapshot should be persisted after each mirroring operation.
80: */
81: boolean isSaveSnapshotAfterMirror();
82:
83: /**
84: * Sets if the snapshot be saved/persisted after each mirroring operation.
85: * <p>
86: * Note that it is persisted when the gps device stops.
87: *
88: * @param saveSnapshotAfterMirror
89: */
90: void setSaveSnapshotAfterMirror(boolean saveSnapshotAfterMirror);
91: }
|