Skip to content

Commit

Permalink
BS Builder now create an InMemoryBoostrapConfigStore by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Jul 2, 2019
1 parent 7eef1c9 commit 91d30d1
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@
import org.eclipse.leshan.core.model.LwM2mModel;
import org.eclipse.leshan.core.model.ObjectLoader;
import org.eclipse.leshan.server.bootstrap.BootstrapConfig;
import org.eclipse.leshan.server.bootstrap.BootstrapConfigStore;
import org.eclipse.leshan.server.bootstrap.BootstrapHandler;
import org.eclipse.leshan.server.bootstrap.BootstrapHandlerFactory;
import org.eclipse.leshan.server.bootstrap.BootstrapSessionManager;
import org.eclipse.leshan.server.bootstrap.BootstrapConfigStore;
import org.eclipse.leshan.server.bootstrap.DefaultBootstrapHandler;
import org.eclipse.leshan.server.bootstrap.InMemoryBootstrapConfigStore;
import org.eclipse.leshan.server.bootstrap.LwM2mBootstrapRequestSender;
import org.eclipse.leshan.server.californium.impl.LeshanBootstrapServer;
import org.eclipse.leshan.server.californium.impl.LwM2mBootstrapPskStore;
Expand Down Expand Up @@ -210,7 +211,7 @@ public <T extends Certificate> LeshanBootstrapServerBuilder setTrustedCertificat
/**
* Set the {@link BootstrapConfigStore} containing bootstrap configuration to apply to each devices.
* <p>
* WARNING: There is not default implementation and this store is mandatory to create a bootstrap server.
* By default an {@link InMemoryBootstrapConfigStore} is used.
* <p>
* See {@link BootstrapConfig} to see what is could be done during a bootstrap session.
*
Expand Down Expand Up @@ -376,7 +377,7 @@ public LeshanBootstrapServer build() {

// TODO we should have default implementation for BootstrapStore in leshan.server project.
if (configStore == null)
throw new IllegalStateException("BootstrapStore is mandatory");
configStore = new InMemoryBootstrapConfigStore();

if (sessionManager == null)
sessionManager = new DefaultBootstrapSessionManager(securityStore);
Expand Down Expand Up @@ -554,8 +555,9 @@ public BootstrapHandler create(BootstrapConfigStore store, LwM2mBootstrapRequest
* @return the LWM2M Bootstrap server.
*/
protected LeshanBootstrapServer createBootstrapServer(CoapEndpoint unsecuredEndpoint, CoapEndpoint securedEndpoint,
BootstrapConfigStore bsStore, BootstrapSecurityStore bsSecurityStore, BootstrapSessionManager bsSessionManager,
BootstrapHandlerFactory bsHandlerFactory, LwM2mModel model, NetworkConfig coapConfig) {
BootstrapConfigStore bsStore, BootstrapSecurityStore bsSecurityStore,
BootstrapSessionManager bsSessionManager, BootstrapHandlerFactory bsHandlerFactory, LwM2mModel model,
NetworkConfig coapConfig) {
return new LeshanBootstrapServer(unsecuredEndpoint, securedEndpoint, bsStore, bsSecurityStore, bsSessionManager,
bsHandlerFactory, model, coapConfig);
}
Expand Down

0 comments on commit 91d30d1

Please sign in to comment.