use of org.eclipse.kapua.message.KapuaMessageFactory in project kapua by eclipse.
the class TranslatorKuraKapuaUtils method translate.
/**
* Translate {@link DevicePosition} to {@link KapuaPosition}
*
* @param kuraPosition
* @return
*/
public static KapuaPosition translate(DevicePosition kuraPosition) {
KapuaPosition kapuaPosition = null;
if (kuraPosition != null) {
KapuaLocator locator = KapuaLocator.getInstance();
KapuaMessageFactory kapuaMessageFactory = locator.getFactory(KapuaMessageFactory.class);
kapuaPosition = kapuaMessageFactory.newPosition();
kapuaPosition.setAltitude(kuraPosition.getAltitude());
kapuaPosition.setHeading(kuraPosition.getHeading());
kapuaPosition.setLatitude(kuraPosition.getLatitude());
kapuaPosition.setLongitude(kuraPosition.getLongitude());
kapuaPosition.setPrecision(kuraPosition.getPrecision());
kapuaPosition.setSatellites(kuraPosition.getSatellites());
kapuaPosition.setSpeed(kuraPosition.getSpeed());
kapuaPosition.setStatus(kuraPosition.getStatus());
kapuaPosition.setTimestamp(kuraPosition.getTimestamp());
}
return kapuaPosition;
}
Aggregations