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;
18:
19: /**
20: * <code>CompassGps</code> is responsible for managing
21: * {@link org.compass.gps.CompassGpsDevice}s. It can hold one or more
22: * devices, and manage their lifecycle. It is also resposible for creating an
23: * abstraction between devices and their repectice <code>Compass</code>
24: * instances, as part of the internal contract between
25: * <code>CompassGps</code> and its devices and should not be used by a
26: * non-device code (see
27: * {@link org.compass.gps.spi.CompassGpsInterfaceDevice}).
28: *
29: * @author kimchy
30: */
31: public interface CompassGps {
32:
33: /**
34: * Adds a {@link CompassGpsDevice} to be managed.
35: *
36: * @param gpsDevice
37: */
38: void addGpsDevice(CompassGpsDevice gpsDevice);
39:
40: /**
41: * Sets a list of {@link CompassGpsDevice}s that will be managed.
42: *
43: * @param devices
44: */
45: void setGpsDevices(CompassGpsDevice[] devices);
46:
47: /**
48: * Start <code>CompassGps</code> (also starts all the devices).
49: *
50: * @throws CompassGpsException
51: */
52: void start() throws CompassGpsException;
53:
54: /**
55: * Stops <code>CompassGps</code> (also starts all the devices).
56: *
57: * @throws CompassGpsException
58: */
59: void stop() throws CompassGpsException;
60:
61: /**
62: * Return <code>true</code> is started.
63: */
64: boolean isRunning();
65:
66: /**
67: * Retuns <code>true</code> if the devide performs the index operaiton.
68: */
69: public boolean isPerformingIndexOperation();
70:
71: /**
72: * Indexes all the different devices (by calling their respective
73: * <code>index()</code> operation.
74: *
75: * @throws CompassGpsException
76: */
77: void index() throws CompassGpsException, IllegalStateException;
78: }
|