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.device.jdbc.snapshot.JdbcSnapshotEventListener;
20: import org.compass.gps.device.jdbc.snapshot.JdbcSnapshotPersister;
21: import org.compass.gps.device.jdbc.snapshot.RAMJdbcSnapshotPersister;
22:
23: /**
24: * A helper base class for Jdbc active mirror gps device.
25: *
26: * @author kimchy
27: */
28: public abstract class AbstractJdbcActiveMirrorGpsDevice extends
29: AbstractJdbcGpsDevice implements JdbcActiveMirrorGpsDevice {
30:
31: private boolean mirrorDataChanges = true;
32:
33: private JdbcSnapshotPersister snapshotPersister = new RAMJdbcSnapshotPersister();
34:
35: private JdbcSnapshotEventListener snapshotEventListener = new ResultSetSnapshotEventListener();
36:
37: private boolean saveSnapshotAfterMirror = false;
38:
39: public boolean isMirrorDataChanges() {
40: return mirrorDataChanges;
41: }
42:
43: public void setMirrorDataChanges(boolean mirrorDataChanges) {
44: this .mirrorDataChanges = mirrorDataChanges;
45: }
46:
47: public JdbcSnapshotEventListener getSnapshotEventListener() {
48: return snapshotEventListener;
49: }
50:
51: public void setSnapshotEventListener(
52: JdbcSnapshotEventListener snapshotEventListener) {
53: this .snapshotEventListener = snapshotEventListener;
54: }
55:
56: public JdbcSnapshotPersister getSnapshotPersister() {
57: return snapshotPersister;
58: }
59:
60: public void setSnapshotPersister(
61: JdbcSnapshotPersister snapshotPersister) {
62: this .snapshotPersister = snapshotPersister;
63: }
64:
65: public boolean isSaveSnapshotAfterMirror() {
66: return saveSnapshotAfterMirror;
67: }
68:
69: public void setSaveSnapshotAfterMirror(
70: boolean saveSnapshotAfterMirror) {
71: this.saveSnapshotAfterMirror = saveSnapshotAfterMirror;
72: }
73: }
|