use of org.eclipse.leshan.server.bootstrap.BootstrapStore in project leshan by eclipse.
the class LeshanBootstrapServerBuilderTest method start.
@Before
public void start() {
builder = new LeshanBootstrapServerBuilder();
builder.setConfigStore(new BootstrapStore() {
@Override
public BootstrapConfig getBootstrap(String endpoint) {
return null;
}
});
}
use of org.eclipse.leshan.server.bootstrap.BootstrapStore in project leshan by eclipse.
the class BootstrapIntegrationTestHelper method createBootstrapServer.
public void createBootstrapServer(BootstrapSecurityStore securityStore) {
BootstrapStore bsStore = new BootstrapStore() {
@Override
public BootstrapConfig getBootstrap(String endpoint) {
BootstrapConfig bsConfig = new BootstrapConfig();
// security for BS server
ServerSecurity bsSecurity = new ServerSecurity();
bsSecurity.serverId = 1111;
bsSecurity.bootstrapServer = true;
bsSecurity.uri = "coap://" + bootstrapServer.getUnsecuredAddress().getHostString() + ":" + bootstrapServer.getUnsecuredAddress().getPort();
bsSecurity.securityMode = SecurityMode.NO_SEC;
bsConfig.security.put(0, bsSecurity);
// security for DM server
ServerSecurity dmSecurity = new ServerSecurity();
dmSecurity.uri = "coap://" + server.getUnsecuredAddress().getHostString() + ":" + server.getUnsecuredAddress().getPort();
dmSecurity.serverId = 2222;
dmSecurity.securityMode = SecurityMode.NO_SEC;
bsConfig.security.put(1, dmSecurity);
// DM server
ServerConfig dmConfig = new ServerConfig();
dmConfig.shortId = 2222;
bsConfig.servers.put(0, dmConfig);
return bsConfig;
}
};
if (securityStore == null) {
securityStore = dummyBsSecurityStore();
}
LeshanBootstrapServerBuilder builder = new LeshanBootstrapServerBuilder();
builder.setConfigStore(bsStore);
builder.setSecurityStore(securityStore);
builder.setLocalAddress(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
builder.setLocalSecureAddress(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
bootstrapServer = builder.build();
}
Aggregations