Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo: boostrap/bootstap => bootstrap #1296

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down Expand Up @@ -185,7 +185,7 @@ public void sendRequest(BootstrapSession session, BootstrapDownlinkRequest<? ext
}

} catch (JsonProcessingException e) {
LOG.error("Bootstap Event JSON serialization failed", e);
LOG.error("Bootstrap Event JSON serialization failed", e);
}
}

Expand Down Expand Up @@ -214,7 +214,7 @@ public void onResponseSuccess(BootstrapSession session,
endpointName);
}
} catch (JsonProcessingException e) {
LOG.error("Bootstap Event JSON serialization failed", e);
LOG.error("Bootstrap Event JSON serialization failed", e);
}
}

Expand All @@ -235,7 +235,7 @@ public void onResponseError(BootstrapSession session, BootstrapDownlinkRequest<?
new BootstrapEvent("receive error response", endpointName, b.toString())),
endpointName);
} catch (JsonProcessingException e) {
LOG.error("Bootstap Event JSON serialization failed", e);
LOG.error("Bootstrap Event JSON serialization failed", e);
}
}

Expand All @@ -250,7 +250,7 @@ public void onRequestFailure(BootstrapSession session,
sendEvent(EVENT_BOOTSTRAP_SESSION, objectMapper.writeValueAsString(
new BootstrapEvent("request failure", endpointName, b.toString())), endpointName);
} catch (JsonProcessingException e) {
LOG.error("Bootstap Event JSON serialization failed", e);
LOG.error("Bootstrap Event JSON serialization failed", e);
}
}

Expand All @@ -277,7 +277,7 @@ public void end(BootstrapSession session) {
objectMapper.writeValueAsString(new BootstrapEvent("finished", endpointName, b.toString())),
endpointName);
} catch (JsonProcessingException e) {
LOG.error("Bootstap Event JSON serialization failed", e);
LOG.error("Bootstrap Event JSON serialization failed", e);
}
}

Expand All @@ -293,7 +293,7 @@ public void failed(BootstrapSession session, BootstrapFailureCause cause) {
objectMapper.writeValueAsString(new BootstrapEvent("failed", endpointName, b.toString())),
endpointName);
} catch (JsonProcessingException e) {
LOG.error("Bootstap Event JSON serialization failed", e);
LOG.error("Bootstrap Event JSON serialization failed", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public LeshanClient(String endpoint, InetSocketAddress localAddress,
this.encoder = encoder;
this.linkSerializer = linkSerializer;
observers = createClientObserverDispatcher();
bootstrapHandler = createBoostrapHandler(objectTree, checker);
bootstrapHandler = createBootstrapHandler(objectTree, checker);
endpointsManager = createEndpointsManager(localAddress, coapConfig, dtlsConfigBuilder, trustStore,
endpointFactory);
requestSender = createRequestSender(endpointsManager, sharedExecutor, encoder, objectTree.getModel(),
Expand Down Expand Up @@ -162,7 +162,7 @@ public void onUnexpectedError(Throwable unexpectedError) {
return observer;
}

protected BootstrapHandler createBoostrapHandler(LwM2mObjectTree objectTree, BootstrapConsistencyChecker checker) {
protected BootstrapHandler createBootstrapHandler(LwM2mObjectTree objectTree, BootstrapConsistencyChecker checker) {
return new BootstrapHandler(objectTree.getObjectEnablers(), checker);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public synchronized boolean isBootstrapping() {
return bootstrapping;
}

public boolean waitBoostrapFinished(long timeInSeconds) throws InterruptedException, InvalidStateException {
public boolean waitBootstrapFinished(long timeInSeconds) throws InterruptedException, InvalidStateException {
boolean finished = bootstrappingLatch.await(timeInSeconds, TimeUnit.SECONDS);
if (finished) {
if (lastConsistencyError != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private static enum Status {
private final Map<Integer /* objectId */, LwM2mObjectEnabler> objectEnablers;
private final Map<String /* registrationId */, ServerIdentity> registeredServers;
private final List<ServerIdentity> registeringServers;
private final AtomicReference<ServerIdentity> currentBoostrapServer;
private final AtomicReference<ServerIdentity> currentBootstrapServer;

// helpers
private final LwM2mRequestSender sender;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -282,7 +282,7 @@ private ServerIdentity clientInitiatedBootstrap() throws InterruptedException {
}
return null;
} finally {
currentBoostrapServer.set(null);
currentBootstrapServer.set(null);
bootstrapHandler.closeSession();
}
} else {
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void encode_bootstrap_server_object_with_version() {
public void encode_bootstrap_security_object() {
Map<Integer, LwM2mInstanceEnabler> 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,
Expand All @@ -272,7 +272,7 @@ public void encode_bootstrap_root() {
// object 0
Map<Integer, LwM2mInstanceEnabler> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down