From 122a1a8556f659f2a9b43ef81d4250672bc72e22 Mon Sep 17 00:00:00 2001 From: Julien Vermillard Date: Mon, 8 Aug 2022 11:07:15 +0200 Subject: [PATCH] Typo: boostrap/bootstap => bootstrap Signed-off-by: Julien Vermillard --- .../bootstrap/demo/servlet/EventServlet.java | 20 +++++++++---------- .../client/californium/LeshanClient.java | 4 ++-- .../client/bootstrap/BootstrapHandler.java | 2 +- .../engine/DefaultRegistrationEngine.java | 12 +++++------ .../leshan/client/object/Security.java | 2 +- .../client/util/LinkFormatHelperTest.java | 4 ++-- .../leshan/client/demo/LeshanClientDemo.java | 4 ++-- .../util/BootstrapIntegrationTestHelper.java | 2 +- .../bootstrap/BootstrapHandlerFactory.java | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/leshan-bsserver-demo/src/main/java/org/eclipse/leshan/server/bootstrap/demo/servlet/EventServlet.java b/leshan-bsserver-demo/src/main/java/org/eclipse/leshan/server/bootstrap/demo/servlet/EventServlet.java index 4c8cbb5408..5552739e12 100644 --- a/leshan-bsserver-demo/src/main/java/org/eclipse/leshan/server/bootstrap/demo/servlet/EventServlet.java +++ b/leshan-bsserver-demo/src/main/java/org/eclipse/leshan/server/bootstrap/demo/servlet/EventServlet.java @@ -94,7 +94,7 @@ public void sessionInitiated(BootstrapRequest request, Identity clientIdentity) objectMapper.writeValueAsString(new BootstrapEvent("new session", endpointName, b.toString())), endpointName); } catch (JsonProcessingException e) { - LOG.error("Bootstap Event JSON serialization failed", e); + LOG.error("Bootstrap Event JSON serialization failed", e); } } @@ -112,7 +112,7 @@ public void unAuthorized(BootstrapRequest request, Identity clientIdentity) { objectMapper.writeValueAsString(new BootstrapEvent("unauthorized", endpointName, b.toString())), endpointName); } catch (JsonProcessingException e) { - LOG.error("Bootstap Event JSON serialization failed", e); + LOG.error("Bootstrap Event JSON serialization failed", e); } } @@ -128,7 +128,7 @@ public void authorized(BootstrapSession session) { objectMapper.writeValueAsString(new BootstrapEvent("authorized", endpointName, b.toString())), endpointName); } catch (JsonProcessingException e) { - LOG.error("Bootstap Event JSON serialization failed", e); + LOG.error("Bootstrap Event JSON serialization failed", e); } } @@ -143,7 +143,7 @@ public void noConfig(BootstrapSession session) { objectMapper.writeValueAsString(new BootstrapEvent("no config", endpointName, b.toString())), endpointName); } catch (JsonProcessingException e) { - LOG.error("Bootstap Event JSON serialization failed", e); + LOG.error("Bootstreap Event JSON serialization failed", e); } } @@ -185,7 +185,7 @@ public void sendRequest(BootstrapSession session, BootstrapDownlinkRequest objectEnablers; private final Map registeredServers; private final List registeringServers; - private final AtomicReference currentBoostrapServer; + private final AtomicReference currentBootstrapServer; // helpers private final LwM2mRequestSender sender; @@ -144,7 +144,7 @@ public DefaultRegistrationEngine(String endpoint, LwM2mObjectTree objectTree, En this.bsAdditionalAttributes = bsAdditionalAttributes; this.registeredServers = new ConcurrentHashMap<>(); this.registeringServers = new CopyOnWriteArrayList<>(); - this.currentBoostrapServer = new AtomicReference<>(); + this.currentBootstrapServer = new AtomicReference<>(); this.requestTimeoutInMs = requestTimeoutInMs; this.deregistrationTimeoutInMs = deregistrationTimeoutInMs; this.bootstrapSessionTimeoutInSec = bootstrapSessionTimeoutInSec; @@ -219,7 +219,7 @@ private ServerIdentity clientInitiatedBootstrap() throws InterruptedException { cancelUpdateTask(true); ServerIdentity bootstrapServer = endpointsManager.createEndpoint(bootstrapServerInfo, true); if (bootstrapServer != null) { - currentBoostrapServer.set(bootstrapServer); + currentBootstrapServer.set(bootstrapServer); } // Send bootstrap request @@ -240,7 +240,7 @@ private ServerIdentity clientInitiatedBootstrap() throws InterruptedException { LOG.info("Bootstrap started"); // Wait until it is finished (or too late) try { - boolean timeout = !bootstrapHandler.waitBoostrapFinished(bootstrapSessionTimeoutInSec); + boolean timeout = !bootstrapHandler.waitBootstrapFinished(bootstrapSessionTimeoutInSec); if (timeout) { LOG.info("Bootstrap sequence aborted: Timeout."); if (observer != null) { @@ -282,7 +282,7 @@ private ServerIdentity clientInitiatedBootstrap() throws InterruptedException { } return null; } finally { - currentBoostrapServer.set(null); + currentBootstrapServer.set(null); bootstrapHandler.closeSession(); } } else { @@ -868,7 +868,7 @@ public ServerIdentity getRegisteredServer(long serverId) { public boolean isAllowedToCommunicate(ServerIdentity foreingPeer) { if (foreingPeer == null) return false; - ServerIdentity bootstrapServer = currentBoostrapServer.get(); + ServerIdentity bootstrapServer = currentBootstrapServer.get(); if (bootstrapServer != null && foreingPeer.equals(bootstrapServer)) { return true; } else { diff --git a/leshan-client-core/src/main/java/org/eclipse/leshan/client/object/Security.java b/leshan-client-core/src/main/java/org/eclipse/leshan/client/object/Security.java index 2321903a8c..b46807e7ea 100644 --- a/leshan-client-core/src/main/java/org/eclipse/leshan/client/object/Security.java +++ b/leshan-client-core/src/main/java/org/eclipse/leshan/client/object/Security.java @@ -101,7 +101,7 @@ public static Security oscoreOnlyBootstrap(String serverUri, int oscoreObjectIns /** * Returns a new security instance (NoSec) for a bootstrap server. */ - public static Security noSecBootstap(String serverUri) { + public static Security noSecBootstrap(String serverUri) { return new Security(serverUri, true, SecurityMode.NO_SEC.code, new byte[0], new byte[0], new byte[0], null, CertificateUsage.DOMAIN_ISSUER_CERTIFICATE.code, new ObjectLink()); } diff --git a/leshan-client-core/src/test/java/org/eclipse/leshan/client/util/LinkFormatHelperTest.java b/leshan-client-core/src/test/java/org/eclipse/leshan/client/util/LinkFormatHelperTest.java index 022ad57ce7..3d40c0dfc9 100644 --- a/leshan-client-core/src/test/java/org/eclipse/leshan/client/util/LinkFormatHelperTest.java +++ b/leshan-client-core/src/test/java/org/eclipse/leshan/client/util/LinkFormatHelperTest.java @@ -248,7 +248,7 @@ public void encode_bootstrap_server_object_with_version() { public void encode_bootstrap_security_object() { Map instancesMap = new HashMap<>(); instancesMap.put(0, Security.noSec("coap://localhost:11", 111)); - instancesMap.put(1, Security.noSecBootstap("coap://localhost:1")); + instancesMap.put(1, Security.noSecBootstrap("coap://localhost:1")); instancesMap.put(2, Security.noSec("coap://localhost:22", 222)); instancesMap.put(3, Security.noSec("coap://localhost:33", 333)); LwM2mObjectEnabler objectEnabler = new ObjectEnabler(0, getObjectModel(0), instancesMap, null, @@ -272,7 +272,7 @@ public void encode_bootstrap_root() { // object 0 Map securityInstances = new HashMap<>(); securityInstances.put(0, Security.noSec("coap://localhost:11", 111)); - securityInstances.put(1, Security.noSecBootstap("coap://localhost:1")); + securityInstances.put(1, Security.noSecBootstrap("coap://localhost:1")); securityInstances.put(2, Security.noSec("coap://localhost:22", 222)); securityInstances.put(3, Security.noSec("coap://localhost:33", 333)); LwM2mObjectEnabler securityObjectEnabler = createObjectEnabler(getObjectModel(0), securityInstances); diff --git a/leshan-client-demo/src/main/java/org/eclipse/leshan/client/demo/LeshanClientDemo.java b/leshan-client-demo/src/main/java/org/eclipse/leshan/client/demo/LeshanClientDemo.java index c495c169e7..d521b28aa9 100644 --- a/leshan-client-demo/src/main/java/org/eclipse/leshan/client/demo/LeshanClientDemo.java +++ b/leshan-client-demo/src/main/java/org/eclipse/leshan/client/demo/LeshanClientDemo.java @@ -16,7 +16,7 @@ package org.eclipse.leshan.client.demo; import static org.eclipse.leshan.client.object.Security.noSec; -import static org.eclipse.leshan.client.object.Security.noSecBootstap; +import static org.eclipse.leshan.client.object.Security.noSecBootstrap; import static org.eclipse.leshan.client.object.Security.oscoreOnly; import static org.eclipse.leshan.client.object.Security.oscoreOnlyBootstrap; import static org.eclipse.leshan.client.object.Security.psk; @@ -188,7 +188,7 @@ public static LeshanClient createClient(LeshanClientDemoCLI cli, LwM2mModelRepos initializer.setInstancesForObject(SECURITY, oscoreOnlyBootstrap(cli.main.url, oscoreObjectInstanceId)); } else { - initializer.setInstancesForObject(SECURITY, noSecBootstap(cli.main.url)); + initializer.setInstancesForObject(SECURITY, noSecBootstrap(cli.main.url)); } initializer.setClassForObject(SERVER, Server.class); } diff --git a/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/util/BootstrapIntegrationTestHelper.java b/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/util/BootstrapIntegrationTestHelper.java index 5333793e97..7bca3af846 100644 --- a/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/util/BootstrapIntegrationTestHelper.java +++ b/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/util/BootstrapIntegrationTestHelper.java @@ -253,7 +253,7 @@ public Security withoutSecurityAndInstanceId(Integer id) { // Create Security Object (with bootstrap server only) String bsUrl = "coap://" + bootstrapServer.getUnsecuredAddress().getHostString() + ":" + bootstrapServer.getUnsecuredAddress().getPort(); - Security sec = Security.noSecBootstap(bsUrl); + Security sec = Security.noSecBootstrap(bsUrl); if (id != null) sec.setId(id); return sec; diff --git a/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapHandlerFactory.java b/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapHandlerFactory.java index 0fe8f4179a..75464f58b5 100644 --- a/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapHandlerFactory.java +++ b/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapHandlerFactory.java @@ -25,7 +25,7 @@ public interface BootstrapHandlerFactory { /** * Creates {@link BootstrapHandler}. * - * @param sender the class responsible to send LWM2M request during a bootstapSession. + * @param sender the class responsible to send LWM2M request during a bootstrapSession. * @param sessionManager the manager responsible to handle bootstrap session. * @param listener a listener of bootstrap session life-cycle. * @return the new {@link BootstrapHandler}.