test_class.declarator: builder
test_class.modifier: private
test_class.original_string: private LeshanServerBuilder builder;
test_class.type: LeshanServerBuilder
test_class.var_name: builder
test_class.declarator: server
test_class.modifier: private
test_class.original_string: private LeshanServer server;
test_class.type: LeshanServer
test_class.var_name: server
test_class.file: leshan-server-cf/src/test/java/org/eclipse/leshan/server/californium/LeshanServerBuilderTest.java
test_class.identifier: LeshanServerBuilderTest
test_case.body: @Test
      public void create_server_without_any_parameter() {
          server = builder.build();
  
          assertNull(server.getSecuredAddress());
          assertNotNull(server.getUnsecuredAddress());
          assertNull(server.getSecurityStore());
      }
test_case.class_method_signature: LeshanServerBuilderTest.create_server_without_any_parameter()
test_case.full_signature: @Test public void create_server_without_any_parameter()
test_case.identifier: create_server_without_any_parameter
test_case.invocations: build assertNull getSecuredAddress assertNotNull getUnsecuredAddress assertNull getSecurityStore
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void create_server_without_any_parameter()
focal_class.declarator: LOG = LoggerFactory.getLogger(LeshanServerBuilder.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(LeshanServerBuilder.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: registrationStore
focal_class.modifier: private
focal_class.original_string: private CaliforniumRegistrationStore registrationStore;
focal_class.type: CaliforniumRegistrationStore
focal_class.var_name: registrationStore
focal_class.declarator: securityStore
focal_class.modifier: private
focal_class.original_string: private SecurityStore securityStore;
focal_class.type: SecurityStore
focal_class.var_name: securityStore
focal_class.declarator: modelProvider
focal_class.modifier: private
focal_class.original_string: private LwM2mModelProvider modelProvider;
focal_class.type: LwM2mModelProvider
focal_class.var_name: modelProvider
focal_class.declarator: authorizer
focal_class.modifier: private
focal_class.original_string: private Authorizer authorizer;
focal_class.type: Authorizer
focal_class.var_name: authorizer
focal_class.declarator: awakeTimeProvider
focal_class.modifier: private
focal_class.original_string: private ClientAwakeTimeProvider awakeTimeProvider;
focal_class.type: ClientAwakeTimeProvider
focal_class.var_name: awakeTimeProvider
focal_class.declarator: registrationIdProvider
focal_class.modifier: private
focal_class.original_string: private RegistrationIdProvider registrationIdProvider;
focal_class.type: RegistrationIdProvider
focal_class.var_name: registrationIdProvider
focal_class.declarator: localAddress
focal_class.modifier: private
focal_class.original_string: private InetSocketAddress localAddress;
focal_class.type: InetSocketAddress
focal_class.var_name: localAddress
focal_class.declarator: localSecureAddress
focal_class.modifier: private
focal_class.original_string: private InetSocketAddress localSecureAddress;
focal_class.type: InetSocketAddress
focal_class.var_name: localSecureAddress
focal_class.declarator: encoder
focal_class.modifier: private
focal_class.original_string: private LwM2mNodeEncoder encoder;
focal_class.type: LwM2mNodeEncoder
focal_class.var_name: encoder
focal_class.declarator: decoder
focal_class.modifier: private
focal_class.original_string: private LwM2mNodeDecoder decoder;
focal_class.type: LwM2mNodeDecoder
focal_class.var_name: decoder
focal_class.declarator: publicKey
focal_class.modifier: private
focal_class.original_string: private PublicKey publicKey;
focal_class.type: PublicKey
focal_class.var_name: publicKey
focal_class.declarator: privateKey
focal_class.modifier: private
focal_class.original_string: private PrivateKey privateKey;
focal_class.type: PrivateKey
focal_class.var_name: privateKey
focal_class.declarator: certificateChain
focal_class.modifier: private
focal_class.original_string: private X509Certificate[] certificateChain;
focal_class.type: X509Certificate[]
focal_class.var_name: certificateChain
focal_class.declarator: trustedCertificates
focal_class.modifier: private
focal_class.original_string: private Certificate[] trustedCertificates;
focal_class.type: Certificate[]
focal_class.var_name: trustedCertificates
focal_class.declarator: coapConfig
focal_class.modifier: private
focal_class.original_string: private NetworkConfig coapConfig;
focal_class.type: NetworkConfig
focal_class.var_name: coapConfig
focal_class.declarator: dtlsConfigBuilder
focal_class.modifier: private
focal_class.original_string: private DtlsConnectorConfig.Builder dtlsConfigBuilder;
focal_class.type: DtlsConnectorConfig.Builder
focal_class.var_name: dtlsConfigBuilder
focal_class.declarator: endpointFactory
focal_class.modifier: private
focal_class.original_string: private EndpointFactory endpointFactory;
focal_class.type: EndpointFactory
focal_class.var_name: endpointFactory
focal_class.declarator: noSecuredEndpoint
focal_class.modifier: private
focal_class.original_string: private boolean noSecuredEndpoint;
focal_class.type: boolean
focal_class.var_name: noSecuredEndpoint
focal_class.declarator: noUnsecuredEndpoint
focal_class.modifier: private
focal_class.original_string: private boolean noUnsecuredEndpoint;
focal_class.type: boolean
focal_class.var_name: noUnsecuredEndpoint
focal_class.declarator: noQueueMode = false
focal_class.modifier: private
focal_class.original_string: private boolean noQueueMode = false;
focal_class.type: boolean
focal_class.var_name: noQueueMode
focal_class.declarator: updateRegistrationOnNotification
focal_class.modifier: protected
focal_class.original_string: protected boolean updateRegistrationOnNotification;
focal_class.type: boolean
focal_class.var_name: updateRegistrationOnNotification
focal_class.file: leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/LeshanServerBuilder.java
focal_class.identifier: LeshanServerBuilder
focal_class.class_method_signature: LeshanServerBuilder.setLocalAddress(String hostname, int port)
focal_class.full_signature: public LeshanServerBuilder setLocalAddress(String hostname, int port)
focal_class.identifier: setLocalAddress
focal_class.modifiers: public
focal_class.parameters: (String hostname, int port)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setLocalAddress(String hostname, int port)
focal_class.class_method_signature: LeshanServerBuilder.setLocalAddress(InetSocketAddress localAddress)
focal_class.full_signature: public LeshanServerBuilder setLocalAddress(InetSocketAddress localAddress)
focal_class.identifier: setLocalAddress
focal_class.modifiers: public
focal_class.parameters: (InetSocketAddress localAddress)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setLocalAddress(InetSocketAddress localAddress)
focal_class.class_method_signature: LeshanServerBuilder.setLocalSecureAddress(String hostname, int port)
focal_class.full_signature: public LeshanServerBuilder setLocalSecureAddress(String hostname, int port)
focal_class.identifier: setLocalSecureAddress
focal_class.modifiers: public
focal_class.parameters: (String hostname, int port)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setLocalSecureAddress(String hostname, int port)
focal_class.class_method_signature: LeshanServerBuilder.setLocalSecureAddress(InetSocketAddress localSecureAddress)
focal_class.full_signature: public LeshanServerBuilder setLocalSecureAddress(InetSocketAddress localSecureAddress)
focal_class.identifier: setLocalSecureAddress
focal_class.modifiers: public
focal_class.parameters: (InetSocketAddress localSecureAddress)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setLocalSecureAddress(InetSocketAddress localSecureAddress)
focal_class.class_method_signature: LeshanServerBuilder.setRegistrationStore(CaliforniumRegistrationStore registrationStore)
focal_class.full_signature: public LeshanServerBuilder setRegistrationStore(CaliforniumRegistrationStore registrationStore)
focal_class.identifier: setRegistrationStore
focal_class.modifiers: public
focal_class.parameters: (CaliforniumRegistrationStore registrationStore)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setRegistrationStore(CaliforniumRegistrationStore registrationStore)
focal_class.class_method_signature: LeshanServerBuilder.setSecurityStore(SecurityStore securityStore)
focal_class.full_signature: public LeshanServerBuilder setSecurityStore(SecurityStore securityStore)
focal_class.identifier: setSecurityStore
focal_class.modifiers: public
focal_class.parameters: (SecurityStore securityStore)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setSecurityStore(SecurityStore securityStore)
focal_class.class_method_signature: LeshanServerBuilder.setAuthorizer(Authorizer authorizer)
focal_class.full_signature: public LeshanServerBuilder setAuthorizer(Authorizer authorizer)
focal_class.identifier: setAuthorizer
focal_class.modifiers: public
focal_class.parameters: (Authorizer authorizer)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setAuthorizer(Authorizer authorizer)
focal_class.class_method_signature: LeshanServerBuilder.setObjectModelProvider(LwM2mModelProvider objectModelProvider)
focal_class.full_signature: public LeshanServerBuilder setObjectModelProvider(LwM2mModelProvider objectModelProvider)
focal_class.identifier: setObjectModelProvider
focal_class.modifiers: public
focal_class.parameters: (LwM2mModelProvider objectModelProvider)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setObjectModelProvider(LwM2mModelProvider objectModelProvider)
focal_class.class_method_signature: LeshanServerBuilder.setPublicKey(PublicKey publicKey)
focal_class.full_signature: public LeshanServerBuilder setPublicKey(PublicKey publicKey)
focal_class.identifier: setPublicKey
focal_class.modifiers: public
focal_class.parameters: (PublicKey publicKey)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setPublicKey(PublicKey publicKey)
focal_class.class_method_signature: LeshanServerBuilder.setPrivateKey(PrivateKey privateKey)
focal_class.full_signature: public LeshanServerBuilder setPrivateKey(PrivateKey privateKey)
focal_class.identifier: setPrivateKey
focal_class.modifiers: public
focal_class.parameters: (PrivateKey privateKey)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setPrivateKey(PrivateKey privateKey)
focal_class.class_method_signature: LeshanServerBuilder.setCertificateChain(T[] certificateChain)
focal_class.full_signature: public LeshanServerBuilder setCertificateChain(T[] certificateChain)
focal_class.identifier: setCertificateChain
focal_class.modifiers: public
focal_class.parameters: (T[] certificateChain)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setCertificateChain(T[] certificateChain)
focal_class.class_method_signature: LeshanServerBuilder.setTrustedCertificates(T[] trustedCertificates)
focal_class.full_signature: public LeshanServerBuilder setTrustedCertificates(T[] trustedCertificates)
focal_class.identifier: setTrustedCertificates
focal_class.modifiers: public
focal_class.parameters: (T[] trustedCertificates)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setTrustedCertificates(T[] trustedCertificates)
focal_class.class_method_signature: LeshanServerBuilder.setEncoder(LwM2mNodeEncoder encoder)
focal_class.full_signature: public LeshanServerBuilder setEncoder(LwM2mNodeEncoder encoder)
focal_class.identifier: setEncoder
focal_class.modifiers: public
focal_class.parameters: (LwM2mNodeEncoder encoder)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setEncoder(LwM2mNodeEncoder encoder)
focal_class.class_method_signature: LeshanServerBuilder.setDecoder(LwM2mNodeDecoder decoder)
focal_class.full_signature: public LeshanServerBuilder setDecoder(LwM2mNodeDecoder decoder)
focal_class.identifier: setDecoder
focal_class.modifiers: public
focal_class.parameters: (LwM2mNodeDecoder decoder)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setDecoder(LwM2mNodeDecoder decoder)
focal_class.class_method_signature: LeshanServerBuilder.setCoapConfig(NetworkConfig config)
focal_class.full_signature: public LeshanServerBuilder setCoapConfig(NetworkConfig config)
focal_class.identifier: setCoapConfig
focal_class.modifiers: public
focal_class.parameters: (NetworkConfig config)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setCoapConfig(NetworkConfig config)
focal_class.class_method_signature: LeshanServerBuilder.setDtlsConfig(DtlsConnectorConfig.Builder config)
focal_class.full_signature: public LeshanServerBuilder setDtlsConfig(DtlsConnectorConfig.Builder config)
focal_class.identifier: setDtlsConfig
focal_class.modifiers: public
focal_class.parameters: (DtlsConnectorConfig.Builder config)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setDtlsConfig(DtlsConnectorConfig.Builder config)
focal_class.class_method_signature: LeshanServerBuilder.setEndpointFactory(EndpointFactory endpointFactory)
focal_class.full_signature: public LeshanServerBuilder setEndpointFactory(EndpointFactory endpointFactory)
focal_class.identifier: setEndpointFactory
focal_class.modifiers: public
focal_class.parameters: (EndpointFactory endpointFactory)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setEndpointFactory(EndpointFactory endpointFactory)
focal_class.class_method_signature: LeshanServerBuilder.disableUnsecuredEndpoint()
focal_class.full_signature: public LeshanServerBuilder disableUnsecuredEndpoint()
focal_class.identifier: disableUnsecuredEndpoint
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder disableUnsecuredEndpoint()
focal_class.class_method_signature: LeshanServerBuilder.disableSecuredEndpoint()
focal_class.full_signature: public LeshanServerBuilder disableSecuredEndpoint()
focal_class.identifier: disableSecuredEndpoint
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder disableSecuredEndpoint()
focal_class.class_method_signature: LeshanServerBuilder.disableQueueModeSupport()
focal_class.full_signature: public LeshanServerBuilder disableQueueModeSupport()
focal_class.identifier: disableQueueModeSupport
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder disableQueueModeSupport()
focal_class.class_method_signature: LeshanServerBuilder.setClientAwakeTimeProvider(ClientAwakeTimeProvider awakeTimeProvider)
focal_class.full_signature: public LeshanServerBuilder setClientAwakeTimeProvider(ClientAwakeTimeProvider awakeTimeProvider)
focal_class.identifier: setClientAwakeTimeProvider
focal_class.modifiers: public
focal_class.parameters: (ClientAwakeTimeProvider awakeTimeProvider)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setClientAwakeTimeProvider(ClientAwakeTimeProvider awakeTimeProvider)
focal_class.class_method_signature: LeshanServerBuilder.setRegistrationIdProvider(RegistrationIdProvider registrationIdProvider)
focal_class.full_signature: public void setRegistrationIdProvider(RegistrationIdProvider registrationIdProvider)
focal_class.identifier: setRegistrationIdProvider
focal_class.modifiers: public
focal_class.parameters: (RegistrationIdProvider registrationIdProvider)
focal_class.return: void
focal_class.signature: void setRegistrationIdProvider(RegistrationIdProvider registrationIdProvider)
focal_class.class_method_signature: LeshanServerBuilder.setUpdateRegistrationOnNotification(boolean updateRegistrationOnNotification)
focal_class.full_signature: public LeshanServerBuilder setUpdateRegistrationOnNotification(boolean updateRegistrationOnNotification)
focal_class.identifier: setUpdateRegistrationOnNotification
focal_class.modifiers: public
focal_class.parameters: (boolean updateRegistrationOnNotification)
focal_class.return: LeshanServerBuilder
focal_class.signature: LeshanServerBuilder setUpdateRegistrationOnNotification(boolean updateRegistrationOnNotification)
focal_class.class_method_signature: LeshanServerBuilder.createDefaultNetworkConfig()
focal_class.full_signature: public static NetworkConfig createDefaultNetworkConfig()
focal_class.identifier: createDefaultNetworkConfig
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: NetworkConfig
focal_class.signature: NetworkConfig createDefaultNetworkConfig()
focal_class.class_method_signature: LeshanServerBuilder.build()
focal_class.full_signature: public LeshanServer build()
focal_class.identifier: build
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: LeshanServer
focal_class.signature: LeshanServer build()
focal_class.class_method_signature: LeshanServerBuilder.shouldTryToCreateSecureEndpoint()
focal_class.full_signature: protected boolean shouldTryToCreateSecureEndpoint()
focal_class.identifier: shouldTryToCreateSecureEndpoint
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean shouldTryToCreateSecureEndpoint()
focal_class.class_method_signature: LeshanServerBuilder.createServer(CoapEndpoint unsecuredEndpoint, CoapEndpoint securedEndpoint,
              CaliforniumRegistrationStore registrationStore, SecurityStore securityStore, Authorizer authorizer,
              LwM2mModelProvider modelProvider, LwM2mNodeEncoder encoder, LwM2mNodeDecoder decoder,
              NetworkConfig coapConfig, boolean noQueueMode, ClientAwakeTimeProvider awakeTimeProvider,
              RegistrationIdProvider registrationIdProvider)
focal_class.full_signature: protected LeshanServer createServer(CoapEndpoint unsecuredEndpoint, CoapEndpoint securedEndpoint,
              CaliforniumRegistrationStore registrationStore, SecurityStore securityStore, Authorizer authorizer,
              LwM2mModelProvider modelProvider, LwM2mNodeEncoder encoder, LwM2mNodeDecoder decoder,
              NetworkConfig coapConfig, boolean noQueueMode, ClientAwakeTimeProvider awakeTimeProvider,
              RegistrationIdProvider registrationIdProvider)
focal_class.identifier: createServer
focal_class.modifiers: protected
focal_class.parameters: (CoapEndpoint unsecuredEndpoint, CoapEndpoint securedEndpoint,
              CaliforniumRegistrationStore registrationStore, SecurityStore securityStore, Authorizer authorizer,
              LwM2mModelProvider modelProvider, LwM2mNodeEncoder encoder, LwM2mNodeDecoder decoder,
              NetworkConfig coapConfig, boolean noQueueMode, ClientAwakeTimeProvider awakeTimeProvider,
              RegistrationIdProvider registrationIdProvider)
focal_class.return: LeshanServer
focal_class.signature: LeshanServer createServer(CoapEndpoint unsecuredEndpoint, CoapEndpoint securedEndpoint,
              CaliforniumRegistrationStore registrationStore, SecurityStore securityStore, Authorizer authorizer,
              LwM2mModelProvider modelProvider, LwM2mNodeEncoder encoder, LwM2mNodeDecoder decoder,
              NetworkConfig coapConfig, boolean noQueueMode, ClientAwakeTimeProvider awakeTimeProvider,
              RegistrationIdProvider registrationIdProvider)
focal_method.body: public LeshanServer build() {
          if (localAddress == null)
              localAddress = new InetSocketAddress(LwM2m.DEFAULT_COAP_PORT);
          if (registrationStore == null)
              registrationStore = new InMemoryRegistrationStore();
          if (authorizer == null)
              authorizer = new DefaultAuthorizer(securityStore);
          if (modelProvider == null)
              modelProvider = new StandardModelProvider();
          if (encoder == null)
              encoder = new DefaultLwM2mNodeEncoder();
          if (decoder == null)
              decoder = new DefaultLwM2mNodeDecoder();
          if (coapConfig == null)
              coapConfig = createDefaultNetworkConfig();
          if (awakeTimeProvider == null) {
              int maxTransmitWait = coapConfig.getInt(Keys.MAX_TRANSMIT_WAIT);
              if (maxTransmitWait == 0) {
                  LOG.warn(
                          "No value available for MAX_TRANSMIT_WAIT in CoAP NetworkConfig. Fallback with a default 93s value.");
                  awakeTimeProvider = new StaticClientAwakeTimeProvider();
              } else {
                  awakeTimeProvider = new StaticClientAwakeTimeProvider(maxTransmitWait);
              }
          }
          if (registrationIdProvider == null)
              registrationIdProvider = new RandomStringRegistrationIdProvider();
          if (endpointFactory == null) {
              endpointFactory = new DefaultEndpointFactory("LWM2M Server");
          }
  
          // handle dtlsConfig
          DtlsConnectorConfig dtlsConfig = null;
          if (!noSecuredEndpoint && shouldTryToCreateSecureEndpoint()) {
              if (dtlsConfigBuilder == null) {
                  dtlsConfigBuilder = new DtlsConnectorConfig.Builder();
              }
              // Set default DTLS setting for Leshan unless user change it.
              DtlsConnectorConfig incompleteConfig = dtlsConfigBuilder.getIncompleteConfig();
  
              // Handle PSK Store
              if (incompleteConfig.getAdvancedPskStore() != null) {
                  LOG.warn(
                          "PskStore should be automatically set by Leshan. Using a custom implementation is not advised.");
              } else if (securityStore != null) {
                  dtlsConfigBuilder.setPskStore(new LwM2mPskStore(this.securityStore, registrationStore));
              }
  
              // Handle secure address
              if (incompleteConfig.getAddress() == null) {
                  if (localSecureAddress == null) {
                      localSecureAddress = new InetSocketAddress(LwM2m.DEFAULT_COAP_SECURE_PORT);
                  }
                  dtlsConfigBuilder.setAddress(localSecureAddress);
              } else if (localSecureAddress != null && !localSecureAddress.equals(incompleteConfig.getAddress())) {
                  throw new IllegalStateException(String.format(
                          "Configuration conflict between LeshanBuilder and DtlsConnectorConfig.Builder for secure address: %s != %s",
                          localSecureAddress, incompleteConfig.getAddress()));
              }
  
              // Handle active peers
              if (incompleteConfig.getMaxConnections() == null)
                  dtlsConfigBuilder.setMaxConnections(coapConfig.getInt(Keys.MAX_ACTIVE_PEERS));
              if (incompleteConfig.getStaleConnectionThreshold() == null)
                  dtlsConfigBuilder.setStaleConnectionThreshold(coapConfig.getLong(Keys.MAX_PEER_INACTIVITY_PERIOD));
  
              // handle trusted certificates
              if (trustedCertificates != null) {
                  if (incompleteConfig.getCertificateVerifier() == null) {
                      if (incompleteConfig.getTrustStore() == null) {
                          dtlsConfigBuilder.setTrustStore(trustedCertificates);
                      } else if (!Arrays.equals(trustedCertificates, incompleteConfig.getTrustStore())) {
                          throw new IllegalStateException(String.format(
                                  "Configuration conflict between LeshanBuilder and DtlsConnectorConfig.Builder for trusted Certificates (trustStore) : \n%s != \n%s",
                                  Arrays.toString(trustedCertificates),
                                  Arrays.toString(incompleteConfig.getTrustStore())));
                      }
                  }
              }
  
              // check conflict for private key
              if (privateKey != null) {
                  if (incompleteConfig.getPrivateKey() != null && !incompleteConfig.getPrivateKey().equals(privateKey)) {
                      throw new IllegalStateException(String.format(
                              "Configuration conflict between LeshanBuilder and DtlsConnectorConfig.Builder for private key: %s != %s",
                              privateKey, incompleteConfig.getPrivateKey()));
                  }
  
                  // if in raw key mode and not in X.509 set the raw keys
                  if (certificateChain == null && publicKey != null) {
                      if (incompleteConfig.getPublicKey() != null && !incompleteConfig.getPublicKey().equals(publicKey)) {
                          throw new IllegalStateException(String.format(
                                  "Configuration conflict between LeshanBuilder and DtlsConnectorConfig.Builder for public key: %s != %s",
                                  publicKey, incompleteConfig.getPublicKey()));
                      }
  
                      // by default trust all RPK
                      if (incompleteConfig.getRpkTrustStore() == null) {
                          dtlsConfigBuilder.setRpkTrustAll();
                      }
                      dtlsConfigBuilder.setIdentity(privateKey, publicKey);
                  }
                  // if in X.509 mode set the private key, certificate chain, public key is extracted from the certificate
                  if (certificateChain != null && certificateChain.length > 0) {
                      if (incompleteConfig.getCertificateChain() != null
                              && !Arrays.asList(certificateChain).equals(incompleteConfig.getCertificateChain())) {
                          throw new IllegalStateException(String.format(
                                  "Configuration conflict between LeshanBuilder and DtlsConnectorConfig.Builder for certificate chain: %s != %s",
                                  Arrays.toString(certificateChain), incompleteConfig.getCertificateChain()));
                      }
  
                      // by default trust all RPK
                      if (incompleteConfig.getRpkTrustStore() == null) {
                          dtlsConfigBuilder.setRpkTrustAll();
                      }
                      dtlsConfigBuilder.setIdentity(privateKey, certificateChain, CertificateType.X_509,
                              CertificateType.RAW_PUBLIC_KEY);
                  }
              }
  
              // Deactivate SNI by default
              // TODO should we support SNI ?
              if (incompleteConfig.isSniEnabled() == null) {
                  dtlsConfigBuilder.setSniEnabled(false);
              }
  
              // Do no allow Server to initiated Handshake by default, for U device request will be allowed to initiate
              // handshake (see Registration.shouldInitiateConnection())
              Boolean serverOnly = incompleteConfig.isServerOnly();
              if (serverOnly == null || !serverOnly) {
                  if (incompleteConfig.getDefaultHandshakeMode() == null) {
                      dtlsConfigBuilder.setDefaultHandshakeMode(DtlsEndpointContext.HANDSHAKE_MODE_NONE);
                  }
              }
  
              // we try to build the dtlsConfig, if it fail we will just not create the secured endpoint
              try {
                  dtlsConfig = dtlsConfigBuilder.build();
              } catch (IllegalStateException e) {
                  LOG.warn("Unable to create DTLS config and so secured endpoint.", e);
              }
          }
  
          // create endpoints
          CoapEndpoint unsecuredEndpoint = null;
          if (!noUnsecuredEndpoint) {
              unsecuredEndpoint = endpointFactory.createUnsecuredEndpoint(localAddress, coapConfig, registrationStore);
          }
  
          CoapEndpoint securedEndpoint = null;
          if (!noSecuredEndpoint && dtlsConfig != null) {
              securedEndpoint = endpointFactory.createSecuredEndpoint(dtlsConfig, coapConfig, registrationStore);
          }
  
          if (securedEndpoint == null && unsecuredEndpoint == null) {
              throw new IllegalStateException(
                      "All CoAP enpoints are deactivated, at least one endpoint should be activated");
          }
  
          return createServer(unsecuredEndpoint, securedEndpoint, registrationStore, securityStore, authorizer,
                  modelProvider, encoder, decoder, coapConfig, noQueueMode, awakeTimeProvider, registrationIdProvider);
      }
focal_method.class_method_signature: LeshanServerBuilder.build()
focal_method.full_signature: public LeshanServer build()
focal_method.identifier: build
focal_method.invocations: createDefaultNetworkConfig getInt warn shouldTryToCreateSecureEndpoint getIncompleteConfig getAdvancedPskStore warn setPskStore getAddress setAddress equals getAddress format getAddress getMaxConnections setMaxConnections getInt getStaleConnectionThreshold setStaleConnectionThreshold getLong getCertificateVerifier getTrustStore setTrustStore equals getTrustStore format toString toString getTrustStore getPrivateKey equals getPrivateKey format getPrivateKey getPublicKey equals getPublicKey format getPublicKey getRpkTrustStore setRpkTrustAll setIdentity getCertificateChain equals asList getCertificateChain format toString getCertificateChain getRpkTrustStore setRpkTrustAll setIdentity isSniEnabled setSniEnabled isServerOnly getDefaultHandshakeMode setDefaultHandshakeMode build warn createUnsecuredEndpoint createSecuredEndpoint createServer
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: LeshanServer
focal_method.signature: LeshanServer build()