11 | If you are in development phase and run leshan-demo-bsserver
12 | from your ide, you probably missed to launch npm run
13 | serve and/or you are not using the right port
14 | to access to the demo, try http://localhost:8088/
15 | (see leshan-demo-bsserver
17 | README for more details)
18 |
19 |
20 | If you are using a built version of leshan-demo-bsserver
21 | and you see this page, you probably discover a leshan built issue.
22 | Please report it.
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/leshan-demo-bsserver/webapp/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | node
4 | /dist
5 |
6 |
7 | # local env files
8 | .env.local
9 | .env.*.local
10 |
11 | # Log files
12 | npm-debug.log*
13 | yarn-debug.log*
14 | yarn-error.log*
15 | pnpm-debug.log*
16 |
17 | # Editor directories and files
18 | .idea
19 | .vscode
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/leshan-demo-bsserver/webapp/README.md:
--------------------------------------------------------------------------------
1 | # webapp
2 |
3 | The **leshan-demo-bsserver** webapp is based on [Vue.js](https://vuejs.org/).
4 | For more details you should refer to **leshan-demo-server** [README](https://github.com/eclipse/leshan/tree/master/leshan-demo-server/webapp/README.md).
--------------------------------------------------------------------------------
/leshan-demo-bsserver/webapp/eslint.config.js:
--------------------------------------------------------------------------------
1 | import vue from 'eslint-plugin-vue'
2 | import vuetify from 'eslint-plugin-vuetify'
3 |
4 | export default [
5 | ...vue.configs['flat/essential'],
6 | ...vuetify.configs['flat/base'],
7 | ]
--------------------------------------------------------------------------------
/leshan-demo-bsserver/webapp/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 | Leshan Bootstrap Server Demo
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/leshan-demo-bsserver/webapp/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "@/*": ["./src/*"],
5 | "@leshan-demo-servers-shared/*": [
6 | "../../leshan-demo-servers-shared/webapp/src/*"
7 | ]
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/leshan-demo-bsserver/webapp/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-demo-bsserver/webapp/public/favicon.png
--------------------------------------------------------------------------------
/leshan-demo-server/.gitignore:
--------------------------------------------------------------------------------
1 | /ddffiles/
2 |
--------------------------------------------------------------------------------
/leshan-demo-server/src/main/java/org/eclipse/leshan/demo/server/servlet/log/CoapMessageListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.server.servlet.log;
17 |
18 | public interface CoapMessageListener {
19 |
20 | void trace(CoapMessage message);
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/leshan-demo-server/src/main/resources/credentials/server_cert.der:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-demo-server/src/main/resources/credentials/server_cert.der
--------------------------------------------------------------------------------
/leshan-demo-server/src/main/resources/credentials/server_privkey.der:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-demo-server/src/main/resources/credentials/server_privkey.der
--------------------------------------------------------------------------------
/leshan-demo-server/src/main/resources/webapp/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Leshan Server Demo
8 |
9 |
10 |
11 | If you are in development phase and run leshan-demo-server
12 | from your ide, you probably missed to launch npm run
13 | serve and/or you are not using the right port
14 | to access to the demo, try http://localhost:8088/
15 | (see leshan-demo-server
17 | README for more details)
18 |
19 |
20 | If you are using a built version of leshan-demo-server
21 | and you see this page, you probably discover a leshan built issue.
22 | Please report it.
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/leshan-demo-server/webapp/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | node
4 | /dist
5 |
6 |
7 | # local env files
8 | .env.local
9 | .env.*.local
10 |
11 | # Log files
12 | npm-debug.log*
13 | yarn-debug.log*
14 | yarn-error.log*
15 | pnpm-debug.log*
16 |
17 | # Editor directories and files
18 | .idea
19 | .vscode
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/leshan-demo-server/webapp/eslint.config.js:
--------------------------------------------------------------------------------
1 | import vue from 'eslint-plugin-vue'
2 | import vuetify from 'eslint-plugin-vuetify'
3 |
4 | export default [
5 | ...vue.configs['flat/essential'],
6 | ...vuetify.configs['flat/base'],
7 | ]
--------------------------------------------------------------------------------
/leshan-demo-server/webapp/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 | Leshan Server Demo
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/leshan-demo-server/webapp/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "@/*": ["./src/*"],
5 | "@leshan-demo-servers-shared/*": [
6 | "../../leshan-demo-servers-shared/webapp/src/*"
7 | ]
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/leshan-demo-server/webapp/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-demo-server/webapp/public/favicon.png
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/src/main/java/org/eclipse/leshan/demo/servers/cli/converters/ServerCIDConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v2.0
5 | * and Eclipse Distribution License v1.0 which accompany this distribution.
6 | *
7 | * The Eclipse Public License is available at
8 | * http://www.eclipse.org/legal/epl-v20.html
9 | * and the Eclipse Distribution License is available at
10 | * http://www.eclipse.org/org/documents/edl-v10.html.
11 | *
12 | * Contributors:
13 | * Sierra Wireless - initial API and implementation
14 | *******************************************************************************/
15 | package org.eclipse.leshan.demo.servers.cli.converters;
16 |
17 | import org.eclipse.leshan.demo.cli.converters.CIDConverter;
18 |
19 | public class ServerCIDConverter extends CIDConverter {
20 | public ServerCIDConverter() {
21 | super(6);
22 | }
23 | };
24 |
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "*": ["../../leshan-demo-bsserver/webapp/node_modules/*"]
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "leshan-demo-servers-shared",
3 | "version": "0.1.0",
4 | "private": true
5 | }
6 |
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/src/assets/image/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-demo-servers-shared/webapp/src/assets/image/logo.png
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/src/assets/image/multicolor-leshan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-demo-servers-shared/webapp/src/assets/image/multicolor-leshan.png
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/src/components/security/X509Input.vue:
--------------------------------------------------------------------------------
1 |
13 |
14 |
Use X509 certificate.
15 |
16 |
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/src/plugins/dayjs.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *******************************************************************************/
13 | import dayjs from "dayjs";
14 |
15 | export default {
16 | install: (app) => {
17 | app.config.globalProperties.$date = dayjs;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/src/plugins/dialog.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *******************************************************************************/
13 | import { Vuetify3Dialog } from 'vuetify3-dialog'
14 |
15 | export default Vuetify3Dialog;
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/src/plugins/sse.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *******************************************************************************/
13 |
14 | import VueSSE from "vue-sse";
15 |
16 | export default {
17 | install(app, config = {}) {
18 | const leshanDefaultConfig = {
19 | format: 'json',
20 | };
21 |
22 | // Merge both config
23 | const finalConfig = { ...leshanDefaultConfig, ...config };
24 |
25 | // Install plugin with given config
26 | app.use(VueSSE, finalConfig);
27 | }
28 | };
--------------------------------------------------------------------------------
/leshan-demo-servers-shared/webapp/src/plugins/vuetify.js:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *******************************************************************************/
13 |
14 | import "@fontsource/roboto";
15 | import 'vuetify/styles'
16 | import { createVuetify } from 'vuetify'
17 | import { aliases, mdi } from 'vuetify/iconsets/mdi-svg'
18 |
19 | export default createVuetify({
20 | theme: {
21 | defaultTheme: 'light',
22 | },
23 | icons: {
24 | defaultSet: 'mdi',
25 | aliases,
26 | sets: {
27 | mdi,
28 | },
29 | },
30 | });
31 |
--------------------------------------------------------------------------------
/leshan-demo-shared/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/cli/converters/HexadecimalConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.cli.converters;
17 |
18 | import org.eclipse.californium.elements.util.Bytes;
19 | import org.eclipse.leshan.core.util.Hex;
20 |
21 | import picocli.CommandLine.ITypeConverter;
22 |
23 | public class HexadecimalConverter implements ITypeConverter {
24 |
25 | @Override
26 | public Bytes convert(String value) throws Exception {
27 | return new Bytes(Hex.decodeHex(value.toCharArray()));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/cli/converters/LwM2mPathConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v2.0
5 | * and Eclipse Distribution License v1.0 which accompany this distribution.
6 | *
7 | * The Eclipse Public License is available at
8 | * http://www.eclipse.org/legal/epl-v20.html
9 | * and the Eclipse Distribution License is available at
10 | * http://www.eclipse.org/org/documents/edl-v10.html.
11 | *
12 | * Contributors:
13 | * Sierra Wireless - initial API and implementation
14 | *******************************************************************************/
15 | package org.eclipse.leshan.demo.cli.converters;
16 |
17 | import org.eclipse.leshan.core.node.InvalidLwM2mPathException;
18 | import org.eclipse.leshan.core.node.LwM2mPath;
19 |
20 | import picocli.CommandLine.ITypeConverter;
21 |
22 | public class LwM2mPathConverter implements ITypeConverter {
23 |
24 | @Override
25 | public LwM2mPath convert(String value) throws InvalidLwM2mPathException {
26 | return new LwM2mPath(value);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/cli/converters/PrivateKeyConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.cli.converters;
17 |
18 | import java.security.PrivateKey;
19 |
20 | import org.eclipse.leshan.core.security.util.SecurityUtil;
21 |
22 | import picocli.CommandLine.ITypeConverter;
23 |
24 | public class PrivateKeyConverter implements ITypeConverter {
25 |
26 | @Override
27 | public PrivateKey convert(String value) throws Exception {
28 | return SecurityUtil.privateKey.readFromFile(value);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/cli/converters/PublicKeyConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.cli.converters;
17 |
18 | import java.security.PublicKey;
19 |
20 | import org.eclipse.leshan.core.security.util.SecurityUtil;
21 |
22 | import picocli.CommandLine.ITypeConverter;
23 |
24 | public class PublicKeyConverter implements ITypeConverter {
25 |
26 | @Override
27 | public PublicKey convert(String value) throws Exception {
28 | return SecurityUtil.publicKey.readFromFile(value);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/cli/converters/StringLwM2mPathConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.cli.converters;
17 |
18 | import org.eclipse.leshan.core.node.LwM2mPath;
19 |
20 | import picocli.CommandLine.ITypeConverter;
21 |
22 | public class StringLwM2mPathConverter implements ITypeConverter {
23 |
24 | @Override
25 | public String convert(String value) throws Exception {
26 | // create a LwM2mPath to force validation.
27 | new LwM2mPath(value);
28 | return value;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/cli/converters/X509CertificateChainConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.cli.converters;
17 |
18 | import java.security.cert.X509Certificate;
19 |
20 | import org.eclipse.leshan.core.security.util.SecurityUtil;
21 |
22 | import picocli.CommandLine.ITypeConverter;
23 |
24 | public class X509CertificateChainConverter implements ITypeConverter {
25 |
26 | @Override
27 | public X509Certificate[] convert(String value) throws Exception {
28 | return SecurityUtil.certificateChain.readFromFile(value);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/cli/converters/X509CertificateConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.cli.converters;
17 |
18 | import java.security.cert.X509Certificate;
19 |
20 | import org.eclipse.leshan.core.security.util.SecurityUtil;
21 |
22 | import picocli.CommandLine.ITypeConverter;
23 |
24 | public class X509CertificateConverter implements ITypeConverter {
25 |
26 | @Override
27 | public X509Certificate convert(String value) throws Exception {
28 | return SecurityUtil.certificate.readFromFile(value);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/java/org/eclipse/leshan/demo/logback/NoColorConverter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo.logback;
17 |
18 | import ch.qos.logback.core.pattern.CompositeConverter;
19 |
20 | public class NoColorConverter extends CompositeConverter {
21 |
22 | @Override
23 | protected String transform(E event, String in) {
24 | return in;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/leshan-demo-shared/src/main/resources/leshan.properties:
--------------------------------------------------------------------------------
1 | # value are set at build time, see pom.xml
2 | version=${project.version}
3 | commitid=${buildNumber}
4 | timestamp=${timestamp}
--------------------------------------------------------------------------------
/leshan-demo-shared/src/test/java/org/eclipse/leshan/demo/ValidateDemoModelsTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.demo;
17 |
18 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
19 |
20 | import org.eclipse.leshan.core.model.ObjectLoader;
21 | import org.junit.jupiter.api.Test;
22 |
23 | class ValidateDemoModelsTest {
24 |
25 | @Test
26 | void validate_embedded_models() {
27 | assertDoesNotThrow(() -> ObjectLoader.loadDdfResources("/models/", LwM2mDemoConstant.modelPaths, true));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-integration-tests/credentials/clientKeyStore.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-integration-tests/credentials/clientKeyStore.jks
--------------------------------------------------------------------------------
/leshan-integration-tests/credentials/serverKeyStore.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-integration-tests/credentials/serverKeyStore.jks
--------------------------------------------------------------------------------
/leshan-integration-tests/credentials/trustedCaKeyStore.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-integration-tests/credentials/trustedCaKeyStore.jks
--------------------------------------------------------------------------------
/leshan-integration-tests/credentials/unknownCaKeyStore.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-integration-tests/credentials/unknownCaKeyStore.jks
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/RedisRegistrationTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisRegistrationTest extends RegistrationTest {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/observe/RedisDynamicIPObserveTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests.observe;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisDynamicIPObserveTest extends DynamicIPObserveTest {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/observe/RedisObserveTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests.observe;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisObserveTest extends ObserveTest {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/security/RedisPskTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests.security;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisPskTest extends PskTest {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/security/RedisRpkTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests.security;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisRpkTest extends RpkTest {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/security/RedisRpkX509Test.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests.security;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisRpkX509Test extends RpkX509Test {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/security/RedisSecurityStoreTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests.security;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisSecurityStoreTest extends SecurityStoreTest {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/security/RedisX509Test.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.integration.tests.security;
17 |
18 | import org.eclipse.leshan.core.endpoint.Protocol;
19 | import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder;
20 |
21 | public class RedisX509Test extends X509Test {
22 |
23 | @Override
24 | protected LeshanTestServerBuilder givenServerUsing(Protocol givenProtocol) {
25 | return super.givenServerUsing(givenProtocol).withRedisRegistrationStore();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-bsserver/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-lwm2m-bsserver/src/main/java/org/eclipse/leshan/bsserver/BootstrapConfigStore.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.bsserver;
17 |
18 | /**
19 | * A store containing the bootstrap information to be sent to the clients.
20 | *
21 | */
22 | public interface BootstrapConfigStore {
23 |
24 | /**
25 | * Get the bootstrap configuration to apply to the client which opened the given BootstrapSession.
26 | *
27 | * @param session the current {@link BootstrapSession}.
28 | * @return the {@link BootstrapConfig} to apply.
29 | */
30 | BootstrapConfig get(BootstrapSession session);
31 | }
32 |
--------------------------------------------------------------------------------
/leshan-lwm2m-bsserver/src/main/java/org/eclipse/leshan/bsserver/SmsSecurityMode.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.bsserver;
17 |
18 | /**
19 | * The different SMS security modes
20 | */
21 | public enum SmsSecurityMode {
22 | RESERVED(0), SPS_DEVICE(1), SPS_SMARTCARD(2), NO_SEC(3), PROPRIETARY(255);
23 |
24 | public final int code;
25 |
26 | private SmsSecurityMode(int code) {
27 | this.code = code;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-bsserver/src/main/java/org/eclipse/leshan/bsserver/model/StandardBootstrapModelProvider.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.bsserver.model;
17 |
18 | import org.eclipse.leshan.core.model.ObjectLoader;
19 |
20 | /**
21 | * A versioned model provider which uses the default model embedded in Leshan.
22 | *
23 | * @see VersionedBootstrapModelProvider
24 | */
25 | public class StandardBootstrapModelProvider extends VersionedBootstrapModelProvider {
26 |
27 | public StandardBootstrapModelProvider() {
28 | super(ObjectLoader.loadAllDefault());
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-bsserver/src/test/java/org/eclipse/leshan/bsserver/InMemoryBootstrapConfigStoreTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.bsserver;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class InMemoryBootstrapConfigStoreTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(InMemoryBootstrapConfigStore.PskByServer.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/src/main/java/org/eclipse/leshan/client/bootstrap/BootstrapListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.client.bootstrap;
17 |
18 | /**
19 | * Listen for bootstrap session event.
20 | */
21 | public interface BootstrapListener {
22 |
23 | /**
24 | * Invoked when a bootstrap session is closed.
25 | *
26 | * Generally when we receive a bootstrap finished request or when the bootstrap session ends in an unexpected
27 | * way.(e.g. bootstrap server is not responding anymore)
28 | */
29 | void bootstrapFinished();
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/src/main/java/org/eclipse/leshan/client/resource/NotificationSender.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.client.resource;
17 |
18 | import org.eclipse.leshan.core.response.ObserveResponse;
19 |
20 | public interface NotificationSender {
21 | /**
22 | * Send notification, return false if there is no more observe relation.
23 | */
24 | boolean sendNotification(ObserveResponse response);
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/src/main/java/org/eclipse/leshan/client/resource/NotifySender.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.client.resource;
17 |
18 | public interface NotifySender {
19 | void sendNotify(String URI);
20 | }
21 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/src/main/java/org/eclipse/leshan/client/resource/listener/ObjectListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2019 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.client.resource.listener;
17 |
18 | import org.eclipse.leshan.client.resource.LwM2mObjectEnabler;
19 |
20 | public interface ObjectListener extends ResourceListener {
21 |
22 | void objectInstancesAdded(LwM2mObjectEnabler object, int... instanceIds);
23 |
24 | void objectInstancesRemoved(LwM2mObjectEnabler object, int... instanceIds);
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/src/main/java/org/eclipse/leshan/client/resource/listener/ObjectsListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2019 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.client.resource.listener;
17 |
18 | import org.eclipse.leshan.client.resource.LwM2mObjectEnabler;
19 |
20 | public interface ObjectsListener extends ObjectListener {
21 |
22 | void objectAdded(LwM2mObjectEnabler object);
23 |
24 | void objectRemoved(LwM2mObjectEnabler object);
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/src/main/java/org/eclipse/leshan/client/resource/listener/ResourceListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2019 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.client.resource.listener;
17 |
18 | import org.eclipse.leshan.core.node.LwM2mPath;
19 |
20 | public interface ResourceListener {
21 | void resourceChanged(LwM2mPath... paths);
22 | }
23 |
--------------------------------------------------------------------------------
/leshan-lwm2m-client/src/test/java/org/eclipse/leshan/client/servers/LwM2mServerTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.client.servers;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class LwM2mServerTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(LwM2mServer.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/certificates/certificates.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/leshan-lwm2m-core/certificates/certificates.jks
--------------------------------------------------------------------------------
/leshan-lwm2m-core/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/Destroyable.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core;
17 |
18 | public interface Destroyable {
19 |
20 | /** Destroy the instances and frees all system resources. */
21 | void destroy();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/Startable.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core;
17 |
18 | public interface Startable {
19 |
20 | void start();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/Stoppable.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core;
17 |
18 | public interface Stoppable {
19 |
20 | void stop();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/endpoint/EndPointUriParser.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.endpoint;
17 |
18 | public interface EndPointUriParser {
19 |
20 | EndpointUri parse(String Uri) throws InvalidEndpointUriException;
21 |
22 | void validateScheme(String scheme) throws InvalidEndpointUriException;
23 |
24 | void validateHost(String host) throws InvalidEndpointUriException;
25 |
26 | void validatePort(String port) throws InvalidEndpointUriException;
27 |
28 | void validatePort(Integer port) throws InvalidEndpointUriException;
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/endpoint/LwM2mEndpoint.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.endpoint;
17 |
18 | public interface LwM2mEndpoint {
19 |
20 | Protocol getProtocol();
21 |
22 | EndpointUri getURI();
23 |
24 | String getDescription();
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/json/LwM2mJsonDecoder.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.json;
17 |
18 | /**
19 | * A decoder fo rthe old deprecated LwM2m format.
20 | */
21 | public interface LwM2mJsonDecoder {
22 |
23 | JsonRootObject fromJsonLwM2m(String jsonString) throws LwM2mJsonException;
24 | }
25 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/json/LwM2mJsonEncoder.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.json;
17 |
18 | /**
19 | * An encoder for the old deprecated LwM2m format.
20 | */
21 | public interface LwM2mJsonEncoder {
22 |
23 | public String toJsonLwM2m(JsonRootObject jro) throws LwM2mJsonException;
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/link/LinkParser.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Orange.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Michał Wadowski (Orange) - Improved compliance with rfc6690.
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.link;
17 |
18 | /**
19 | * A CoRE Link parser interface.
20 | *
21 | * Parser should implement rules defined in https://datatracker.ietf.org/doc/html/RFC6690#section-2
22 | */
23 | public interface LinkParser {
24 |
25 | /**
26 | * Parse text content in format defined in RFC RFC6690 into array of links {@link Link}.
27 | *
28 | * @param bytes content to parse as array of bytes.
29 | */
30 | Link[] parseCoreLinkFormat(byte[] bytes) throws LinkParseException;
31 | }
32 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/link/LinkSerializer.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Orange.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Michał Wadowski (Orange) - Improved compliance with rfc6690.
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.link;
17 |
18 | /**
19 | * A CoRE Link serializer interface.
20 | *
21 | * Serializer will serialize links {@link Link} in format defined in
22 | * https://datatracker.ietf.org/doc/html/RFC6690#section-2
23 | */
24 | public interface LinkSerializer {
25 |
26 | /**
27 | * Serialize links {@link Link} into String in format defined in RFC RFC6690.
28 | *
29 | * @param linkObjects array of {@link Link}
30 | */
31 | String serializeCoreLinkFormat(Link... linkObjects);
32 | }
33 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/link/lwm2m/LwM2mLinkParser.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.link.lwm2m;
17 |
18 | import org.eclipse.leshan.core.link.LinkParseException;
19 | import org.eclipse.leshan.core.link.LinkParser;
20 |
21 | /**
22 | * A {@link LinkParser} with some LWM2M flavor.
23 | */
24 | public interface LwM2mLinkParser extends LinkParser {
25 |
26 | LwM2mLink[] parseLwM2mLinkFromCoreLinkFormat(byte[] bytes, String rootPath) throws LinkParseException;
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/link/lwm2m/attributes/AttributeClass.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.link.lwm2m.attributes;
17 |
18 | /**
19 | * Attributes are organized according to their purpose;
20 | *
21 | * 2 Class of Attributes are supported:
22 | *
{@link AttributeClass#PROPERTIES} gather Attributes regarding general information
25 | *
26 | */
27 | public enum AttributeClass {
28 | PROPERTIES, NOTIFICATION
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/node/LwM2mNode.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | /**
19 | * A node in the LWM2M resource tree: Root, Objects, Object instances, Resources or Resource instances.
20 | */
21 | public interface LwM2mNode {
22 |
23 | /**
24 | * Accept a visitor for this node.
25 | */
26 | void accept(LwM2mNodeVisitor visitor);
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/node/LwM2mNodeVisitor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | /**
19 | * A visitor to visit an object, an object instance, or a resource.
20 | */
21 | public interface LwM2mNodeVisitor {
22 |
23 | void visit(LwM2mRoot root);
24 |
25 | void visit(LwM2mObject object);
26 |
27 | void visit(LwM2mObjectInstance instance);
28 |
29 | void visit(LwM2mResource resource);
30 |
31 | void visit(LwM2mResourceInstance instance);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/peer/LwM2mIdentity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless, Orange Polska S.A. - initial API and implementation
15 | *******************************************************************************/
16 |
17 | package org.eclipse.leshan.core.peer;
18 |
19 | public interface LwM2mIdentity {
20 | // String getKeyIdentifier(); // TODO I don't know if we really need this.
21 |
22 | boolean isSecure();
23 | }
24 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/peer/LwM2mPeer.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless, Orange Polska S.A. - initial API and implementation
15 | *******************************************************************************/
16 |
17 | package org.eclipse.leshan.core.peer;
18 |
19 | public interface LwM2mPeer {
20 | LwM2mIdentity getIdentity();
21 | }
22 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/AbstractLwM2mRequest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | import org.eclipse.leshan.core.response.LwM2mResponse;
19 |
20 | public abstract class AbstractLwM2mRequest implements LwM2mRequest {
21 |
22 | private final Object coapRequest;
23 |
24 | public AbstractLwM2mRequest(Object coapRequest) {
25 | this.coapRequest = coapRequest;
26 | }
27 |
28 | @Override
29 | public Object getCoapRequest() {
30 | return coapRequest;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/DownlinkRequest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | import org.eclipse.leshan.core.response.LwM2mResponse;
19 |
20 | /**
21 | * A Downlink Lightweight M2M request.
22 | * This is a request sent from server to client to interact with the client resource tree.
23 | */
24 | public interface DownlinkRequest extends LwM2mRequest {
25 |
26 | /**
27 | * Accept a visitor for this request.
28 | */
29 | void accept(DownlinkRequestVisitor visitor);
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/DownlinkRequestVisitor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | * Michał Wadowski (Orange) - Add Observe-Composite feature.
16 | * Michał Wadowski (Orange) - Add Cancel Composite-Observation feature.
17 | *******************************************************************************/
18 | package org.eclipse.leshan.core.request;
19 |
20 | /**
21 | * A visitor to visit a Downlink Lightweight M2M request.
22 | */
23 | public interface DownlinkRequestVisitor
24 | extends DownlinkDeviceManagementRequestVisitor, DownlinkBootstrapRequestVisitor {
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/SimpleDownlinkRequest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | import org.eclipse.leshan.core.node.LwM2mPath;
19 | import org.eclipse.leshan.core.response.LwM2mResponse;
20 |
21 | /**
22 | * A simple {@link DownlinkRequest} which targets only 1 node.
23 | */
24 | public interface SimpleDownlinkRequest extends DownlinkRequest {
25 | /**
26 | * Gets the node path targeted by the request.
27 | *
28 | * @return the request path
29 | */
30 | LwM2mPath getPath();
31 | }
32 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/UplinkBootstrapRequest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | import org.eclipse.leshan.core.response.LwM2mResponse;
19 |
20 | /**
21 | * A Uplink Bootstrap Lightweight M2M request.
22 | * This is a request sent from client to server.
23 | */
24 | public interface UplinkBootstrapRequest extends UplinkRequest {
25 |
26 | /**
27 | * Accept a visitor for this request.
28 | */
29 | void accept(UplinkBootstrapRequestVisitor visitor);
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/UplinkBootstrapRequestVisitor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | /**
19 | * A visitor to visit an Uplink Bootstrap Lightweight M2M request.
20 | */
21 | public interface UplinkBootstrapRequestVisitor {
22 |
23 | void visit(BootstrapRequest request);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/UplinkDeviceManagementRequest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | import org.eclipse.leshan.core.response.LwM2mResponse;
19 |
20 | /**
21 | * A Uplink Device Management Lightweight M2M request.
22 | * This is a request sent from client to server.
23 | */
24 | public interface UplinkDeviceManagementRequest extends UplinkRequest {
25 |
26 | /**
27 | * Accept a visitor for this request.
28 | */
29 | void accept(UplinkDeviceManagementRequestVisitor visitor);
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/UplinkDeviceManagementRequestVisitor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | /**
19 | * A visitor to visit an Uplink Device Mangement Lightweight M2M request.
20 | */
21 | public interface UplinkDeviceManagementRequestVisitor {
22 | void visit(RegisterRequest request);
23 |
24 | void visit(UpdateRequest request);
25 |
26 | void visit(DeregisterRequest request);
27 |
28 | void visit(SendRequest sendRequest);
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/UplinkRequest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | import org.eclipse.leshan.core.response.LwM2mResponse;
19 |
20 | /**
21 | * A Uplink Lightweight M2M request.
22 | * This is a request sent from client to server.
23 | */
24 | public interface UplinkRequest extends LwM2mRequest {
25 |
26 | /**
27 | * Accept a visitor for this request.
28 | */
29 | void accept(UplinkRequestVisitor visitor);
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/UplinkRequestVisitor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request;
17 |
18 | /**
19 | * A visitor to visit an Uplink Lightweight M2M request.
20 | */
21 | public interface UplinkRequestVisitor extends UplinkDeviceManagementRequestVisitor, UplinkBootstrapRequestVisitor {
22 | }
23 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/exception/ClientSleepingException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2017 RISE SICS AB.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * RISE SICS AB - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request.exception;
17 |
18 | /**
19 | * Exception indicating that the message was cancelled on the CoAP layer and any retries will be stopped.
20 | */
21 | public class ClientSleepingException extends RuntimeException {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | public ClientSleepingException(String message, Object... args) {
26 | super(String.format(message, args));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/request/exception/RequestRejectedException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Bosch Software Innovations GmbH and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Bosch Software Innovations GmbH
15 | * - initial API and implementation
16 | *******************************************************************************/
17 | package org.eclipse.leshan.core.request.exception;
18 |
19 | /**
20 | * Exception indicating that the message was rejected by the Request receiver.
21 | */
22 | public class RequestRejectedException extends RuntimeException {
23 |
24 | private static final long serialVersionUID = 1L;
25 |
26 | public RequestRejectedException(String message, Object... args) {
27 | super(String.format(message, args));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/response/ErrorCallback.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.response;
17 |
18 | /**
19 | * On error callback for LWM2M request.
20 | */
21 | public interface ErrorCallback {
22 | // We should keep this as a 1 method interface to be java 8 lambda compatible.
23 |
24 | /**
25 | * Called when the request failed
26 | */
27 | void onError(Exception e);
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/response/ResponseCallback.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.response;
17 |
18 | /**
19 | * On success callback for LWM2M request.
20 | */
21 | public interface ResponseCallback {
22 | // We should keep this as a 1 method interface to be java 8 lambda compatible.
23 |
24 | /**
25 | * Called when the request succeed.
26 | */
27 | void onResponse(T response);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/tlv/TlvException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.tlv;
17 |
18 | public class TlvException extends Exception {
19 |
20 | public TlvException(String message) {
21 | super(message);
22 | }
23 |
24 | public TlvException(String message, Exception cause) {
25 | super(message, cause);
26 | }
27 |
28 | private static final long serialVersionUID = 9017593873541376092L;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/util/base64/Base64Decoder.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * All rights reserved. This program and the accompanying materials
3 | * are made available under the terms of the Eclipse Public License v2.0
4 | * and Eclipse Distribution License v1.0 which accompany this distribution.
5 | *
6 | * The Eclipse Public License is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | * and the Eclipse Distribution License is available at
9 | * http://www.eclipse.org/org/documents/edl-v10.html.
10 | *
11 | * Contributors:
12 | * Adam Serodzinski, Jarosław Legierski
13 | * Orange Polska S.A. - initial API and implementation
14 | *******************************************************************************/
15 |
16 | package org.eclipse.leshan.core.util.base64;
17 |
18 | public interface Base64Decoder {
19 |
20 | byte[] decode(String encoded) throws InvalidBase64Exception;
21 |
22 | byte[] decode(byte[] encoded) throws InvalidBase64Exception;
23 | }
24 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/core/util/base64/Base64Encoder.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * All rights reserved. This program and the accompanying materials
3 | * are made available under the terms of the Eclipse Public License v2.0
4 | * and Eclipse Distribution License v1.0 which accompany this distribution.
5 | *
6 | * The Eclipse Public License is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | * and the Eclipse Distribution License is available at
9 | * http://www.eclipse.org/org/documents/edl-v10.html.
10 | *
11 | * Contributors:
12 | * Adam Serodzinski
13 | * Orange Polska S.A. - initial API and implementation
14 | *******************************************************************************/
15 |
16 | package org.eclipse.leshan.core.util.base64;
17 |
18 | public interface Base64Encoder {
19 | String encode(byte[] dataToEncode);
20 | }
21 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/senml/SenMLDecoder.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.senml;
17 |
18 | /**
19 | * A decoder for SenML format.
20 | *
21 | * @see rfc8428 - Sensor Measurement Lists (SenML)
22 | */
23 | public interface SenMLDecoder {
24 |
25 | SenMLPack fromSenML(byte[] encodedSenML) throws SenMLException;
26 | }
27 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/main/java/org/eclipse/leshan/senml/SenMLEncoder.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.senml;
17 |
18 | /**
19 | * An encoder for SenML format.
20 | *
21 | * @see rfc8428 - Sensor Measurement Lists (SenML)
22 | */
23 | public interface SenMLEncoder {
24 |
25 | public byte[] toSenML(SenMLPack pack) throws SenMLException;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/ResponseCodeTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class ResponseCodeTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(ResponseCode.class).withIgnoredFields("name").verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/endpoint/EndpointUriTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.endpoint;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | public class EndpointUriTest {
23 |
24 | @Test
25 | public void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(EndpointUri.class).verify();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/endpoint/ProtocolTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.endpoint;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class ProtocolTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(Protocol.class).withIgnoredFields("uriScheme").verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/json/JsonArrayEntryTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 |
17 | package org.eclipse.leshan.core.json;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import nl.jqno.equalsverifier.EqualsVerifier;
22 |
23 | class JsonArrayEntryTest {
24 | @Test
25 | public void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(JsonArrayEntry.class).verify();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/json/JsonRootObjectTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 |
17 | package org.eclipse.leshan.core.json;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import nl.jqno.equalsverifier.EqualsVerifier;
22 |
23 | class JsonRootObjectTest {
24 | @Test
25 | public void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(JsonRootObject.class).verify();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/link/LinkTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.link;
17 |
18 | import org.eclipse.leshan.core.link.lwm2m.MixedLwM2mLink;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import nl.jqno.equalsverifier.EqualsVerifier;
22 |
23 | class LinkTest {
24 | @Test
25 | void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(Link.class).withRedefinedSubclass(MixedLwM2mLink.class).verify();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/link/attributes/ValuelessAttributeTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.link.attributes;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class ValuelessAttributeTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(ValuelessAttribute.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/model/LwM2mModelRepositoryTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 |
17 | package org.eclipse.leshan.core.model;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | import nl.jqno.equalsverifier.EqualsVerifier;
22 |
23 | class LwM2mModelRepositoryTest {
24 | @Test
25 | public void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(LwM2mModelRepository.Key.class).verify();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/LwM2mMultipleResourceTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class LwM2mMultipleResourceTest {
23 |
24 | @Test
25 | public void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(LwM2mMultipleResource.class).verify();
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/LwM2mObjectInstanceTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class LwM2mObjectInstanceTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(LwM2mObjectInstance.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/LwM2mObjectTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class LwM2mObjectTest {
23 |
24 | @Test
25 | public void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(LwM2mObject.class).verify();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/LwM2mResourceInstanceTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class LwM2mResourceInstanceTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(LwM2mResourceInstance.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/LwM2mRootTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class LwM2mRootTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(LwM2mRoot.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/LwM2mSingleResourceTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class LwM2mSingleResourceTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(LwM2mSingleResource.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/ObjectLinkTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class ObjectLinkTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(ObjectLink.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/node/TimestampedLwM2mNodeTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.node;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class TimestampedLwM2mNodeTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(TimestampedLwM2mNode.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/observation/ObservationIdentifierTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.observation;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class ObservationIdentifierTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(ObservationIdentifier.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/oscore/AeadAlgorithmTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.oscore;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class AeadAlgorithmTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(AeadAlgorithm.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/oscore/OscoreSettingTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.oscore;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class OscoreSettingTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(OscoreSetting.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/peer/IpPeerTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.peer;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class IpPeerTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(IpPeer.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/peer/OscoreIdentityTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.peer;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class OscoreIdentityTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(OscoreIdentity.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/peer/PskIdentityTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.peer;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class PskIdentityTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(PskIdentity.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/peer/RpkIdentityTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.peer;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class RpkIdentityTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(RpkIdentity.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/peer/SocketIdentityTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.peer;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class SocketIdentityTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(SocketIdentity.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/peer/X509IdentityTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.peer;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class X509IdentityTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(X509Identity.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/request/argument/ArgumentTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.request.argument;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class ArgumentTest {
23 |
24 | @Test
25 | public void assertEqualsHashcode() {
26 | EqualsVerifier.forClass(Argument.class).verify();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/util/TestToolBox.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.util;
17 |
18 | import org.eclipse.leshan.core.endpoint.DefaultEndPointUriHandler;
19 | import org.eclipse.leshan.core.endpoint.EndPointUriHandler;
20 |
21 | public class TestToolBox {
22 |
23 | public static EndPointUriHandler uriHandler = new DefaultEndPointUriHandler();
24 | }
25 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/core/util/datatype/ULongTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.core.util.datatype;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class ULongTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(ULong.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/senml/SenMLPackTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.senml;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class SenMLPackTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(SenMLPack.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-lwm2m-core/src/test/java/org/eclipse/leshan/senml/SenMLRecordTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.senml;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class SenMLRecordTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(SenMLRecord.class).verify();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/src/main/java/org/eclipse/leshan/server/model/StandardModelProvider.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.server.model;
17 |
18 | import org.eclipse.leshan.core.model.ObjectLoader;
19 |
20 | /**
21 | * A versioned model provider which uses the default model embedded in Leshan.
22 | *
23 | * @see VersionedModelProvider
24 | */
25 | public class StandardModelProvider extends VersionedModelProvider {
26 |
27 | public StandardModelProvider() {
28 | super(ObjectLoader.loadAllDefault());
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/src/main/java/org/eclipse/leshan/server/profile/ClientProfileProvider.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.server.profile;
17 |
18 | import org.eclipse.leshan.core.peer.LwM2mIdentity;
19 |
20 | public interface ClientProfileProvider {
21 |
22 | ClientProfile getProfile(LwM2mIdentity identity);
23 | }
24 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/src/main/java/org/eclipse/leshan/server/queue/ClientAwakeTimeProvider.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2018 RISE SICS AB.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * RISE SICS AB - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.server.queue;
17 |
18 | import org.eclipse.leshan.server.registration.Registration;
19 |
20 | public interface ClientAwakeTimeProvider {
21 |
22 | /**
23 | * Returns the client awake time for the corresponding client, identified by the {@link Registration} object.
24 | *
25 | * @param reg the client's registration object
26 | * @return the client awake time in milliseconds
27 | */
28 | int getClientAwakeTime(Registration reg);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/src/main/java/org/eclipse/leshan/server/registration/ExpirationListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.server.registration;
17 |
18 | import java.util.Collection;
19 |
20 | import org.eclipse.leshan.core.observation.Observation;
21 |
22 | /**
23 | * A listener to be aware of registration expiration.
24 | *
25 | * @see RegistrationStore
26 | */
27 | public interface ExpirationListener {
28 |
29 | void registrationExpired(Registration registration, Collection observations);
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/src/main/java/org/eclipse/leshan/server/registration/RandomStringRegistrationIdProvider.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2018 NTELS and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Rokwoon Kim (contracted with NTELS) - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.server.registration;
17 |
18 | import org.eclipse.leshan.core.request.RegisterRequest;
19 | import org.eclipse.leshan.core.util.RandomStringUtils;
20 |
21 | public class RandomStringRegistrationIdProvider implements RegistrationIdProvider {
22 |
23 | @Override
24 | public String getRegistrationId(RegisterRequest registerRequest) {
25 | return RandomStringUtils.random(10, true, true);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/src/main/java/org/eclipse/leshan/server/request/LowerLayerConfig.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.server.request;
17 |
18 | /**
19 | * Allow to apply custom configuration to lower layer.
20 | *
21 | * If you are using LWM2M over CoAP this setter will help you to apply CoAP setting to you request.
22 | *
23 | * @since 1.2
24 | */
25 | public interface LowerLayerConfig {
26 |
27 | /**
28 | * @param lowerRequest the lower layer request. E.g. could be a CoAP request.
29 | */
30 | void apply(Object lowerRequest);
31 | }
32 |
--------------------------------------------------------------------------------
/leshan-lwm2m-server/src/main/java/org/eclipse/leshan/server/send/SendService.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2021 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.server.send;
17 |
18 | import org.eclipse.leshan.core.request.SendRequest;
19 |
20 | /**
21 | * Service used to monitor "Send Operation" used by LWM2M client.
22 | *
23 | * @see SendRequest
24 | */
25 | public interface SendService {
26 |
27 | void addListener(SendListener listener);
28 |
29 | void removeListener(SendListener listener);
30 | }
31 |
--------------------------------------------------------------------------------
/leshan-lwm2m-servers-shared/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-lwm2m-servers-shared/src/main/java/org/eclipse/leshan/servers/security/SecurityStoreListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2020 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.servers.security;
17 |
18 | /**
19 | * A Listener for {@link SecurityStore}
20 | */
21 | public interface SecurityStoreListener {
22 | /**
23 | * Called when {@link SecurityInfo} are removed.
24 | *
25 | * @param infosAreCompromised True if info are compromised and should not be used immediately
26 | * @param infos Array of removed {@link SecurityInfo}
27 | */
28 | void securityInfoRemoved(boolean infosAreCompromised, SecurityInfo... infos);
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-lwm2m-servers-shared/src/test/java/org/eclipse/leshan/servers/security/SecurityInfoTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.servers.security;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class SecurityInfoTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(SecurityInfo.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-tl-cf-bsserver-coap-oscore/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-bsserver-coap/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-client-coap-oscore/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-client-coap-oscore/src/main/java/org/eclipse/leshan/transport/californium/client/endpoint/coap/CoapOscoreProtocolProvider.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium.client.endpoint.coap;
17 |
18 | import org.eclipse.leshan.transport.californium.client.endpoint.CaliforniumClientEndpointFactory;
19 |
20 | public class CoapOscoreProtocolProvider extends CoapClientProtocolProvider {
21 |
22 | @Override
23 | public CaliforniumClientEndpointFactory createDefaultEndpointFactory() {
24 | return new CoapOscoreClientEndpointFactory();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/leshan-tl-cf-client-coap/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-client-coap/src/main/java/org/eclipse/leshan/transport/californium/client/CaliforniumConnectionController.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium.client;
17 |
18 | import org.eclipse.californium.core.network.Endpoint;
19 | import org.eclipse.leshan.client.servers.LwM2mServer;
20 |
21 | public interface CaliforniumConnectionController {
22 | void forceReconnection(Endpoint endpoint, LwM2mServer server, boolean resume);
23 | }
24 |
--------------------------------------------------------------------------------
/leshan-tl-cf-client-coap/src/main/java/org/eclipse/leshan/transport/californium/client/endpoint/ServerIdentityExtractor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium.client.endpoint;
17 |
18 | import org.eclipse.californium.core.network.Exchange;
19 | import org.eclipse.leshan.client.servers.LwM2mServer;
20 | import org.eclipse.leshan.core.peer.IpPeer;
21 |
22 | public interface ServerIdentityExtractor {
23 | LwM2mServer extractIdentity(Exchange exchange, IpPeer foreignPeer);
24 | }
25 |
--------------------------------------------------------------------------------
/leshan-tl-cf-server-coap-oscore/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-server-coap/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-shared-oscore/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-shared-oscore/src/test/java/org/eclipse/leshan/transport/californium/oscore/cf/OscoreParametersTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium.oscore.cf;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class OscoreParametersTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(OscoreParameters.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-tl-cf-shared/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-cf-shared/src/main/java/org/eclipse/leshan/transport/californium/AbstractRequestObserver.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2016 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium;
17 |
18 | import org.eclipse.californium.core.coap.MessageObserverAdapter;
19 | import org.eclipse.californium.core.coap.Request;
20 |
21 | public abstract class AbstractRequestObserver extends MessageObserverAdapter {
22 | Request coapRequest;
23 |
24 | public AbstractRequestObserver(Request coapRequest) {
25 | this.coapRequest = coapRequest;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-tl-cf-shared/src/main/java/org/eclipse/leshan/transport/californium/CoapResponseCallback.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2018 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium;
17 |
18 | import org.eclipse.californium.core.coap.Response;
19 |
20 | /**
21 | * On success callback for request.
22 | */
23 | public interface CoapResponseCallback {
24 | // We should keep this as a 1 method interface to be java 8 lambda compatible.
25 |
26 | /**
27 | * Called when the request succeed.
28 | *
29 | * @param response The CoAP response received.
30 | */
31 | void onResponse(Response response);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/leshan-tl-cf-shared/src/main/java/org/eclipse/leshan/transport/californium/ExceptionTranslator.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium;
17 |
18 | import org.eclipse.californium.core.coap.Request;
19 |
20 | public interface ExceptionTranslator {
21 |
22 | /**
23 | * Translate exception from underlying transport layer to LwM2m Exception.
24 | */
25 | Exception translate(Request coapRequest, Throwable error);
26 | }
27 |
--------------------------------------------------------------------------------
/leshan-tl-cf-shared/src/main/java/org/eclipse/leshan/transport/californium/identity/IdentityHandler.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.californium.identity;
17 |
18 | import org.eclipse.californium.core.coap.Message;
19 | import org.eclipse.californium.elements.EndpointContext;
20 | import org.eclipse.leshan.core.peer.LwM2mPeer;
21 |
22 | public interface IdentityHandler {
23 |
24 | LwM2mPeer getIdentity(Message receivedMessage);
25 |
26 | EndpointContext createEndpointContext(LwM2mPeer client, boolean allowConnectionInitiation);
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-tl-jc-client-coap/src/main/java/org/eclipse/leshan/transport/javacoap/client/observe/LwM2mKeys.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap.client.observe;
17 |
18 | import java.util.List;
19 |
20 | import org.eclipse.leshan.core.node.LwM2mPath;
21 |
22 | import com.mbed.coap.transport.TransportContext.Key;
23 |
24 | public class LwM2mKeys {
25 |
26 | // Keys for Observe Request
27 | public static final Key> LESHAN_OBSERVED_PATHS = new Key<>(null);
28 | public static final Key LESHAN_NOTIFICATION = new Key<>(null);
29 | }
30 |
--------------------------------------------------------------------------------
/leshan-tl-jc-client-coap/src/main/java/org/eclipse/leshan/transport/javacoap/client/observe/ObserversListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap.client.observe;
17 |
18 | import com.mbed.coap.packet.CoapRequest;
19 |
20 | public interface ObserversListener {
21 |
22 | void observersAdded(CoapRequest request);
23 |
24 | void observersRemoved(CoapRequest request);
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-tl-jc-client-coap/src/main/java/org/eclipse/leshan/transport/javacoap/client/observe/ObserversStore.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap.client.observe;
17 |
18 | import com.mbed.coap.packet.CoapRequest;
19 |
20 | public interface ObserversStore extends Iterable {
21 |
22 | void add(CoapRequest observeRequest);
23 |
24 | void remove(CoapRequest observeRequest);
25 |
26 | boolean contains(CoapRequest observeRequest);
27 |
28 | void addListener(ObserversListener listener);
29 |
30 | void removeListener(ObserversListener listener);
31 | }
32 |
--------------------------------------------------------------------------------
/leshan-tl-jc-client-coap/src/main/java/org/eclipse/leshan/transport/javacoap/client/resource/ServerIdentityExtractor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap.client.resource;
17 |
18 | import org.eclipse.leshan.client.servers.LwM2mServer;
19 | import org.eclipse.leshan.core.peer.IpPeer;
20 |
21 | public interface ServerIdentityExtractor {
22 |
23 | LwM2mServer extractIdentity(IpPeer foreignPeer);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/leshan-tl-jc-client-coap/src/test/java/org/eclipse/leshan/transport/javacoap/client/observe/HashMapObserversStoreTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap.client.observe;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class HashMapObserversStoreTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(HashMapObserversStore.ObserverKey.class).verify();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/leshan-tl-jc-client-coap/src/test/java/org/eclipse/leshan/transport/javacoap/client/resource/RouterServiceTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013-2015 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Natalia Krzykała Orange Polska S.A. - initial implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap.client.resource;
17 |
18 | import org.junit.jupiter.api.Test;
19 |
20 | import nl.jqno.equalsverifier.EqualsVerifier;
21 |
22 | class RouterServiceTest {
23 | @Test
24 | public void assertEqualsHashcode() {
25 | EqualsVerifier.forClass(RouterService.RequestMatcher.class).verify();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/leshan-tl-jc-server-coap/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-jc-server-coaptcp/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-jc-shared/logback-leshan-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
27 | %d %p %C{1} [%t] %m%n
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/leshan-tl-jc-shared/src/main/java/org/eclipse/leshan/transport/javacoap/State.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap;
17 |
18 | public enum State {
19 | INITIAL, STARTED, STOPPED, DESTROYED;
20 |
21 | public boolean isStarted() {
22 | return this.equals(STARTED);
23 | }
24 |
25 | public boolean isStopped() {
26 | return this.equals(STOPPED);
27 | }
28 |
29 | public boolean isDestroyed() {
30 | return this.equals(DESTROYED);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/leshan-tl-jc-shared/src/main/java/org/eclipse/leshan/transport/javacoap/identity/IdentityHandler.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2022 Sierra Wireless and others.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v20.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.html.
12 | *
13 | * Contributors:
14 | * Sierra Wireless - initial API and implementation
15 | *******************************************************************************/
16 | package org.eclipse.leshan.transport.javacoap.identity;
17 |
18 | import org.eclipse.leshan.core.peer.LwM2mPeer;
19 |
20 | import com.mbed.coap.transport.TransportContext;
21 |
22 | public interface IdentityHandler {
23 |
24 | LwM2mPeer getIdentity(Object receivedMessage);
25 |
26 | TransportContext createTransportContext(LwM2mPeer client, boolean allowConnectionInitiation);
27 | }
28 |
--------------------------------------------------------------------------------
/notice.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-leshan/leshan/0ac622102a83c793ddcb2be1d7cc16e343c26765/notice.html
--------------------------------------------------------------------------------