Skip to content

Commit

Permalink
BootstrapConfig is no more Serializable.
Browse files Browse the repository at this point in the history
Using Manual serialization like default JSON one is the preferred way.
  • Loading branch information
sbernard31 committed Jun 25, 2021
1 parent 7440d13 commit 0edf18c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*******************************************************************************/
package org.eclipse.leshan.server.bootstrap;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
Expand All @@ -42,9 +41,7 @@
* @see BootstrapConfigStore
* @see DefaultBootstrapHandler
*/
public class BootstrapConfig implements Serializable {

private static final long serialVersionUID = 1L;
public class BootstrapConfig {

/**
* List of LWM2M path to delete.
Expand All @@ -67,8 +64,7 @@ public class BootstrapConfig implements Serializable {
public Map<Integer, ACLConfig> acls = new HashMap<>();

/** Server Configuration (object 1) as defined in LWM2M 1.0.x TS. */
public static class ServerConfig implements Serializable {
private static final long serialVersionUID = 1L;
public static class ServerConfig {

/** Used as link to associate server Object Instance. */
public int shortId;
Expand Down Expand Up @@ -123,8 +119,7 @@ public String toString() {
* One Object Instance SHOULD address a LwM2M Bootstrap-Server. These LwM2M Object Resources MUST only be changed by
* a LwM2M Bootstrap-Server or Bootstrap from Smartcard and MUST NOT be accessible by any other LwM2M Server.
*/
public static class ServerSecurity implements Serializable {
private static final long serialVersionUID = 1L;
public static class ServerSecurity {

/**
* Uniquely identifies the LwM2M Server or LwM2M Bootstrap-Server. The format of the CoAP URI is defined in
Expand Down Expand Up @@ -252,8 +247,7 @@ public String toString() {
* <p>
* Access Control Object is used to check whether the LwM2M Server has access right for performing an operation.
*/
public static class ACLConfig implements Serializable {
private static final long serialVersionUID = 1L;
public static class ACLConfig {

/** The Object ID of the Object Instance for which ACL are applied. */
public int objectId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.util.Map;

import org.eclipse.leshan.server.bootstrap.BootstrapConfig;
import org.eclipse.leshan.server.security.SecurityInfo;
import org.junit.Test;

Expand All @@ -30,11 +29,6 @@ public void ensure_SecurityInfo_is_serializable() {
assertIsSerializable(SecurityInfo.class);
}

@Test
public void ensure_BootstrapConfig_is_serializable() {
assertIsSerializable(BootstrapConfig.class);
}

private static void assertIsSerializable(Class<?> clazz, String... excludes) {
Map<Object, String> results = SerializationUtil.isSerializable(clazz, excludes);

Expand Down

0 comments on commit 0edf18c

Please sign in to comment.