forked from eclipse-leshan/leshan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eclipse-leshanGH-1395: Add Builder to Server/BootstrapServer Endpoint…
…Factory.
- Loading branch information
1 parent
92c1f02
commit 7b8c4d9
Showing
13 changed files
with
542 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...server/californium/bootstrap/endpoint/coap/CoapBootstrapServerEndpointFactoryBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Sierra Wireless and others. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* and Eclipse Distribution License v1.0 which accompany this distribution. | ||
* | ||
* The Eclipse Public License is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* and the Eclipse Distribution License is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.html. | ||
* | ||
* Contributors: | ||
* Sierra Wireless - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.leshan.server.californium.bootstrap.endpoint.coap; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.californium.elements.config.Configuration; | ||
import org.eclipse.californium.elements.config.Configuration.ModuleDefinitionsProvider; | ||
import org.eclipse.leshan.core.endpoint.Protocol; | ||
import org.eclipse.leshan.server.californium.endpoint.AbstractEndpointFactoryBuilder; | ||
import org.eclipse.leshan.server.californium.endpoint.coap.CoapServerEndpointFactory; | ||
|
||
public class CoapBootstrapServerEndpointFactoryBuilder extends | ||
AbstractEndpointFactoryBuilder<CoapBootstrapServerEndpointFactoryBuilder, CoapBootstrapServerEndpointFactory> { | ||
|
||
@Override | ||
protected Protocol getSupportedProtocol() { | ||
return CoapServerEndpointFactory.getSupportedProtocol(); | ||
} | ||
|
||
@Override | ||
public void applyDefaultValue(Configuration configuration) { | ||
CoapServerEndpointFactory.applyDefaultValue(configuration); | ||
|
||
} | ||
|
||
@Override | ||
public List<ModuleDefinitionsProvider> getModuleDefinitionsProviders() { | ||
return CoapServerEndpointFactory.getModuleDefinitionsProviders(); | ||
} | ||
|
||
@Override | ||
public CoapBootstrapServerEndpointFactory build() { | ||
return new CoapBootstrapServerEndpointFactory(uri, loggingTagPrefix, configuration, | ||
coapEndpointConfigInitializer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...rver/californium/bootstrap/endpoint/coaps/CoapsBootstrapServerEndpointFactoryBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Sierra Wireless and others. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* and Eclipse Distribution License v1.0 which accompany this distribution. | ||
* | ||
* The Eclipse Public License is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* and the Eclipse Distribution License is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.html. | ||
* | ||
* Contributors: | ||
* Sierra Wireless - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.leshan.server.californium.bootstrap.endpoint.coaps; | ||
|
||
import java.util.List; | ||
import java.util.function.Consumer; | ||
|
||
import org.eclipse.californium.elements.config.Configuration; | ||
import org.eclipse.californium.elements.config.Configuration.ModuleDefinitionsProvider; | ||
import org.eclipse.californium.scandium.config.DtlsConnectorConfig; | ||
import org.eclipse.leshan.core.endpoint.Protocol; | ||
import org.eclipse.leshan.server.californium.endpoint.AbstractEndpointFactoryBuilder; | ||
|
||
public class CoapsBootstrapServerEndpointFactoryBuilder extends | ||
AbstractEndpointFactoryBuilder<CoapsBootstrapServerEndpointFactoryBuilder, CoapsBootstrapServerEndpointFactory> { | ||
|
||
protected Consumer<DtlsConnectorConfig.Builder> dtlsConnectorConfigInitializer; | ||
|
||
@Override | ||
protected Protocol getSupportedProtocol() { | ||
return CoapsBootstrapServerEndpointFactory.getSupportedProtocol(); | ||
} | ||
|
||
@Override | ||
public void applyDefaultValue(Configuration configuration) { | ||
CoapsBootstrapServerEndpointFactory.applyDefaultValue(configuration); | ||
|
||
} | ||
|
||
@Override | ||
public List<ModuleDefinitionsProvider> getModuleDefinitionsProviders() { | ||
return CoapsBootstrapServerEndpointFactory.getModuleDefinitionsProviders(); | ||
} | ||
|
||
public CoapsBootstrapServerEndpointFactoryBuilder setDtlsConnectorConfig( | ||
Consumer<DtlsConnectorConfig.Builder> dtlsConnectorConfigInitializer) { | ||
this.dtlsConnectorConfigInitializer = dtlsConnectorConfigInitializer; | ||
return this; | ||
} | ||
|
||
@Override | ||
public CoapsBootstrapServerEndpointFactory build() { | ||
return new CoapsBootstrapServerEndpointFactory(uri, loggingTagPrefix, configuration, | ||
dtlsConnectorConfigInitializer, coapEndpointConfigInitializer); | ||
} | ||
} |
Oops, something went wrong.