-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michał Wadowski
authored and
Michał Wadowski
committed
Mar 8, 2022
1 parent
6836683
commit 2ee77ba
Showing
21 changed files
with
449 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 38 additions & 6 deletions
44
leshan-core/src/main/java/org/eclipse/leshan/core/node/TimestampedLwM2mNodes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,50 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Orange. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* and Eclipse Distribution License v1.0 which accompany this distribution. | ||
* | ||
* The Eclipse Public License is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* and the Eclipse Distribution License is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.html. | ||
* | ||
* Contributors: | ||
* Orange - Send with multiple-timestamped values | ||
*******************************************************************************/ | ||
package org.eclipse.leshan.core.node; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
/** | ||
* A container for path {@link LwM2mPath} - nodes {@link LwM2mNode} map with optional timestamp segregation. | ||
* | ||
* @see TimestampedLwM2mNodesImpl | ||
*/ | ||
public interface TimestampedLwM2mNodes { | ||
Map<Long, Map<LwM2mPath, LwM2mNode>> getTimestampedPathNodesMap(); | ||
|
||
Map<String, LwM2mNode> getStrPathNodesMap(); | ||
/** | ||
* Get timestamp grouped map of {@link LwM2mPath}-{@link LwM2mNode} map. | ||
*/ | ||
Map<Long, Map<LwM2mPath, LwM2mNode>> getTimestampedNodes(); | ||
|
||
Map<LwM2mPath, LwM2mNode> getPathNodesMap(); | ||
/** | ||
* Get all collected nodes represented as {@link LwM2mPath}-{@link LwM2mNode} map. | ||
*/ | ||
Map<LwM2mPath, LwM2mNode> getNodes(); | ||
|
||
LwM2mNode getFirstNode(); | ||
|
||
Set<LwM2mPath> getPaths(); | ||
/** | ||
* Get nodes for specific timestamp. Null timestamp is allowed. | ||
* | ||
* @param timestamp | ||
* @return map of {@link LwM2mPath}-{@link LwM2mNode} or null if there is no value for asked timestamp. | ||
*/ | ||
Map<LwM2mPath, LwM2mNode> getNodesForTimestamp(Long timestamp); | ||
|
||
/** | ||
* Returns the contained timestamps. | ||
*/ | ||
Set<Long> getTimestamps(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 29 additions & 1 deletion
30
...an-core/src/main/java/org/eclipse/leshan/core/node/codec/TimestampedMultiNodeDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Orange. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* and Eclipse Distribution License v1.0 which accompany this distribution. | ||
* | ||
* The Eclipse Public License is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* and the Eclipse Distribution License is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.html. | ||
* | ||
* Contributors: | ||
* Orange - Send with multiple-timestamped values | ||
*******************************************************************************/ | ||
package org.eclipse.leshan.core.node.codec; | ||
|
||
import org.eclipse.leshan.core.model.LwM2mModel; | ||
import org.eclipse.leshan.core.node.TimestampedLwM2mNodes; | ||
|
||
/** | ||
* A decoder for {@link TimestampedLwM2mNodes}. | ||
* | ||
* @see DefaultLwM2mDecoder | ||
*/ | ||
public interface TimestampedMultiNodeDecoder { | ||
|
||
/** | ||
* Deserializes a binary content into a {@link TimestampedLwM2mNodes}. | ||
* <p> | ||
* | ||
* @param content the content | ||
* @param model the collection of supported object models | ||
* @return the decoded timestamped nodes represented by {@link TimestampedLwM2mNodes} | ||
* @throws CodecException if content is malformed. | ||
*/ | ||
TimestampedLwM2mNodes decodeMultiTimestampedNodes(byte[] content, LwM2mModel model) throws CodecException; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.