void handlePostEvent(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); uploadEventMessage(ctx, device.getTenantId(), device.getDeviceId()); } else { handle401(ctx); } }
void handlePostTelemetry(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); uploadTelemetryMessage(ctx, device.getTenantId(), device.getDeviceId()); } else { handle401(ctx); } }
void handlePostTelemetry(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); uploadTelemetryMessage(ctx, device.getTenantId(), device.getDeviceId()); } else { handle401(ctx); } }
void handlePostEvent(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); uploadEventMessage(ctx, device.getTenantId(), device.getDeviceId()); } else { handle401(ctx); } }
void assertTenant(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); if (device.getTenantId().equals(getTenantParam(ctx))) { ctx.next(); } else { ctx.fail(new ClientErrorException(HttpURLConnection.HTTP_FORBIDDEN, "not authorized to upload data for device from other tenant")); } } else { handle401(ctx); } } }
void assertTenant(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); if (device.getTenantId().equals(getTenantParam(ctx))) { ctx.next(); } else { ctx.fail(new ClientErrorException(HttpURLConnection.HTTP_FORBIDDEN, "not authorized to upload data for device from other tenant")); } } else { handle401(ctx); } } }
void handlePostCommandResponse(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); uploadCommandResponseMessage(ctx, device.getTenantId(), device.getDeviceId(), getCommandRequestIdParam(ctx), getCommandResponseStatusParam(ctx)); } else { handle401(ctx); } }
void handlePostCommandResponse(final RoutingContext ctx) { if (Device.class.isInstance(ctx.user())) { final Device device = (Device) ctx.user(); uploadCommandResponseMessage(ctx, device.getTenantId(), device.getDeviceId(), getCommandRequestIdParam(ctx), getCommandResponseStatusParam(ctx)); } else { handle401(ctx); } }