@Override public void visit(BootstrapRequest request) { coapRequest = Request.newPost(); buildRequestSettings(); coapRequest.getOptions().addUriPath("bs"); coapRequest.getOptions().addUriQuery("ep=" + request.getEndpointName()); }
bootstrapServerInfo.isSecure(), new BootstrapRequest(endpoint), DEFAULT_TIMEOUT); if (response == null) { LOG.error("Unable to start bootstrap session: Timeout.");
BootstrapResponse response = bootstrapHandler.bootstrap(clientIdentity, new BootstrapRequest(endpoint)); if (response.isSuccess()) { exchange.respond(toCoapResponseCode(response.getCode()));
public BootstrapResponse bootstrap(Identity sender, BootstrapRequest request) { String endpoint = request.getEndpointName(); // Start session, checking the BS credentials final BootstrapSession session = this.sessionManager.begin(endpoint, sender); if (!session.isAuthorized()) { this.sessionManager.failed(session, UNAUTHORIZED, null); return BootstrapResponse.badRequest("Unauthorized"); } // Get the desired bootstrap config for the endpoint final BootstrapConfig cfg = store.getBootstrap(endpoint, sender); if (cfg == null) { LOG.debug("No bootstrap config for {}", endpoint); this.sessionManager.failed(session, NO_BOOTSTRAP_CONFIG, null); return BootstrapResponse.badRequest("no bootstrap config"); } // Start the bootstrap session e.execute(new Runnable() { @Override public void run() { sendDelete(session, cfg); } }); return BootstrapResponse.success(); }