/** * Copy information from SPI into Mongo {@link Document}. * * @param source * @param target */ public static void toDocument(IDeviceElementMapping source, Document target) { target.append(PROP_DEVICE_ELEMENT_SCHEMA_PATH, source.getDeviceElementSchemaPath()); target.append(PROP_DEVICE_TOKEN, source.getDeviceToken()); }
/** * Copy information from SPI into Mongo {@link Document}. * * @param source * @param target */ public static void toDocument(IDeviceElementMapping source, Document target) { target.append(PROP_DEVICE_ELEMENT_SCHEMA_PATH, source.getDeviceElementSchemaPath()); target.append(PROP_HARDWARE_ID, source.getHardwareId()); }
public static DeviceElementMapping copy(IDeviceElementMapping input) { DeviceElementMapping result = new DeviceElementMapping(); result.setDeviceElementSchemaPath(input.getDeviceElementSchemaPath()); result.setHardwareId(input.getHardwareId()); return result; } }
public static DeviceElementMapping copy(IDeviceElementMapping input) { DeviceElementMapping result = new DeviceElementMapping(); result.setDeviceElementSchemaPath(input.getDeviceElementSchemaPath()); result.setDeviceToken(input.getDeviceToken()); return result; } }
/** * Convert device element mapping from API to GRPC. * * @param api * @return * @throws SiteWhereException */ public static GDeviceElementMapping asGrpcDeviceElementMapping(IDeviceElementMapping api) throws SiteWhereException { GDeviceElementMapping.Builder grpc = GDeviceElementMapping.newBuilder(); grpc.setDeviceToken(api.getDeviceToken()); grpc.setSchemaPath(api.getDeviceElementSchemaPath()); return grpc.build(); }
DeviceSpecificationUtils.getDeviceSlotByPath(specification, request.getDeviceElementSchemaPath()); List<DeviceElementMapping> newMappings = new ArrayList<DeviceElementMapping>(); for (IDeviceElementMapping mapping : existing) { if (mapping.getDeviceElementSchemaPath().equals(request.getDeviceElementSchemaPath())) { throw new SiteWhereSystemException(ErrorCode.DeviceElementMappingExists, ErrorLevel.ERROR);
DeviceTypeUtils.getDeviceSlotByPath(deviceType, request.getDeviceElementSchemaPath()); List<DeviceElementMapping> newMappings = new ArrayList<DeviceElementMapping>(); for (IDeviceElementMapping mapping : existing) { if (mapping.getDeviceElementSchemaPath().equals(request.getDeviceElementSchemaPath())) { throw new SiteWhereSystemException(ErrorCode.DeviceElementMappingExists, ErrorLevel.ERROR);
IDeviceElementMapping match = null; for (IDeviceElementMapping mapping : existing) { if (mapping.getDeviceElementSchemaPath().equals(path)) { match = mapping; } else {
IDeviceElementMapping match = null; for (IDeviceElementMapping mapping : existing) { if (mapping.getDeviceElementSchemaPath().equals(path)) { match = mapping; } else {
nested.setPath(mapping.getDeviceElementSchemaPath()); return nested;
nested.setPath(mapping.getDeviceElementSchemaPath()); return nested;
ProtobufMarshaler.DeviceElementMapping.Builder ebuilder = ProtobufMarshaler.DeviceElementMapping .newBuilder(); ebuilder.setDeviceElementSchemaPath(mapping.getDeviceElementSchemaPath()); ebuilder.setHardwareId(mapping.getHardwareId()); builder.addDeviceElementMappings(ebuilder.build());