Skip to content

Commit 81007a9

Browse files
authored
refactor(position): updated name of position service api (#5456)
* refactor: updated name of position service api Signed-off-by: SimoneFiorani <[email protected]> * fix: jaxrs repaired Signed-off-by: SimoneFiorani <[email protected]> * test: added missing import Signed-off-by: SimoneFiorani <[email protected]> --------- Signed-off-by: SimoneFiorani <[email protected]>
1 parent 608c818 commit 81007a9

File tree

12 files changed

+18
-18
lines changed

12 files changed

+18
-18
lines changed

kura/emulator/org.eclipse.kura.emulator.position/src/main/java/org/eclipse/kura/emulator/position/PositionServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public LocalDateTime getDateTime() {
246246
}
247247

248248
@Override
249-
public Set<GNSSType> getGnssType() {
249+
public Set<GNSSType> getGnssTypes() {
250250
return new HashSet<>(Arrays.asList(GNSSType.GPS));
251251
}
252252
}

kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/position/PositionService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public interface PositionService {
121121
*
122122
* @since 2.8
123123
*/
124-
public Set<GNSSType> getGnssType();
124+
public Set<GNSSType> getGnssTypes();
125125

126126
/**
127127
* Registers position listener

kura/org.eclipse.kura.linux.position/src/main/java/org/eclipse/kura/linux/position/GpsDevice.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public synchronized String getTimeNmea() {
8383
return this.nmeaParser.getTimeNmea();
8484
}
8585

86-
public synchronized Set<GNSSType> getGnssType() {
87-
return this.nmeaParser.getGnssType();
86+
public synchronized Set<GNSSType> getGnssTypes() {
87+
return this.nmeaParser.getGnssTypes();
8888
}
8989

9090
public void disconnect() {

kura/org.eclipse.kura.linux.position/src/main/java/org/eclipse/kura/linux/position/GpsdPositionProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public PositionProviderType getType() {
171171
}
172172

173173
@Override
174-
public Set<GNSSType> getGnssType() {
174+
public Set<GNSSType> getGnssTypes() {
175175
return this.gnssType.get();
176176
}
177177

kura/org.eclipse.kura.linux.position/src/main/java/org/eclipse/kura/linux/position/NMEAParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ public char getLongitudeHemisphere() {
440440
return this.longitudeHemisphere;
441441
}
442442

443-
public Set<GNSSType> getGnssType() {
443+
public Set<GNSSType> getGnssTypes() {
444444
return this.gnssType;
445445
}
446446

kura/org.eclipse.kura.linux.position/src/main/java/org/eclipse/kura/linux/position/PositionProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public void init(PositionServiceOptions configuration, Listener gpsDeviceListene
4646

4747
public PositionProviderType getType();
4848

49-
public Set<GNSSType> getGnssType();
49+
public Set<GNSSType> getGnssTypes();
5050

5151
}

kura/org.eclipse.kura.linux.position/src/main/java/org/eclipse/kura/linux/position/PositionServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ public LocalDateTime getDateTime() {
213213
}
214214

215215
@Override
216-
public Set<GNSSType> getGnssType() {
216+
public Set<GNSSType> getGnssTypes() {
217217
if (this.options.isEnabled()) {
218218

219219
if (!this.options.isStatic() && this.currentProvider != null) {
220-
return this.currentProvider.getGnssType();
220+
return this.currentProvider.getGnssTypes();
221221
} else if (this.options.isStatic()) {
222222
return new HashSet<>(Arrays.asList(this.staticGnssType));
223223
}

kura/org.eclipse.kura.linux.position/src/main/java/org/eclipse/kura/linux/position/SerialDevicePositionProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ public PositionProviderType getType() {
230230
}
231231

232232
@Override
233-
public Set<GNSSType> getGnssType() {
234-
return this.gpsDevice.getGnssType();
233+
public Set<GNSSType> getGnssTypes() {
234+
return this.gpsDevice.getGnssTypes();
235235
}
236236

237237
protected GpsDevice getGpsDevice() {

kura/org.eclipse.kura.rest.position.provider/src/main/java/org/eclipse/kura/internal/rest/position/PositionRestService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void unsetRequestHandlerRegistry(final RequestHandlerRegistry registry) {
8484
@Produces(MediaType.APPLICATION_JSON)
8585
public PositionDTO getPosition() {
8686
if (positionServiceImpl.isLocked()) {
87-
return new PositionDTO(positionServiceImpl.getPosition(), positionServiceImpl.getGnssType());
87+
return new PositionDTO(positionServiceImpl.getPosition(), positionServiceImpl.getGnssTypes());
8888
}
8989

9090
throw DefaultExceptionHandler.toWebApplicationException(

kura/test/org.eclipse.kura.linux.position.test/src/test/java/org/eclipse/kura/linux/position/PositionServiceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public void testActivateStatic() throws IOException {
242242
assertEquals(300.0d, position.getAltitude().getValue(), EPS);
243243

244244
assertNotNull(fixture.ps.getDateTime());
245-
assertEquals(new HashSet<>(Arrays.asList(GNSSType.GPS)), fixture.ps.getGnssType());
245+
assertEquals(new HashSet<>(Arrays.asList(GNSSType.GPS)), fixture.ps.getGnssTypes());
246246

247247
final NmeaPosition nmeaPosition = fixture.ps.getNmeaPosition();
248248

@@ -452,7 +452,7 @@ public void testSwitchToStatic() throws IOException {
452452
assertEquals(40.0d, position.getAltitude().getValue(), EPS);
453453

454454
assertNotNull(fixture.ps.getDateTime());
455-
assertEquals(new HashSet<>(Arrays.asList(GNSSType.GLONASS)), fixture.ps.getGnssType());
455+
assertEquals(new HashSet<>(Arrays.asList(GNSSType.GLONASS)), fixture.ps.getGnssTypes());
456456

457457
verify(fixture.eventAdmin, times(1)).postEvent(argThat(isPositionLockedEvent));
458458
}
@@ -533,7 +533,7 @@ public void testPositionDataFromGps() throws IOException, InterruptedException {
533533
final String date = fixture.ps.getNmeaDate();
534534
final String time = fixture.ps.getNmeaTime();
535535
final String lastSentence = fixture.ps.getLastSentence();
536-
final Set<GNSSType> gnssType = fixture.ps.getGnssType();
536+
final Set<GNSSType> gnssTypes = fixture.ps.getGnssTypes();
537537

538538
// from GGA
539539
assertEquals(1, nmeaPosition.getFixQuality());
@@ -564,7 +564,7 @@ public void testPositionDataFromGps() throws IOException, InterruptedException {
564564

565565
assertEquals("$GNVTG,,,,,,,12.34,,,,*4a\n", lastSentence);
566566

567-
assertEquals(new HashSet<>(Arrays.asList(GNSSType.GPS, GNSSType.GLONASS)), gnssType);
567+
assertEquals(new HashSet<>(Arrays.asList(GNSSType.GPS, GNSSType.GLONASS)), gnssTypes);
568568

569569
fixture.ps.deactivate();
570570

0 commit comments

Comments
 (0)