-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #523 from gathanase/snapshot
Snapshot
- Loading branch information
Showing
21 changed files
with
454 additions
and
2 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
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
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
36 changes: 36 additions & 0 deletions
36
...dler/src/main/java/org/eclipse/sensinact/northbound/query/dto/query/QuerySnapshotDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Kentyou - initial implementation | ||
**********************************************************************/ | ||
package org.eclipse.sensinact.northbound.query.dto.query; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.sensinact.filters.resource.selector.api.ResourceSelector; | ||
import org.eclipse.sensinact.northbound.query.api.AbstractQueryDTO; | ||
import org.eclipse.sensinact.northbound.query.api.EQueryType; | ||
|
||
/** | ||
* | ||
*/ | ||
public class QuerySnapshotDTO extends AbstractQueryDTO { | ||
|
||
/** | ||
* If set, include metadata in the result | ||
*/ | ||
public boolean includeMetadata = false; | ||
|
||
public List<ResourceSelector> filter; | ||
|
||
public QuerySnapshotDTO() { | ||
super(EQueryType.GET_SNAPSHOT); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
.../src/main/java/org/eclipse/sensinact/northbound/query/dto/result/ResponseSnapshotDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Kentyou - initial implementation | ||
**********************************************************************/ | ||
package org.eclipse.sensinact.northbound.query.dto.result; | ||
|
||
import java.util.Map; | ||
|
||
import org.eclipse.sensinact.northbound.query.api.AbstractResultDTO; | ||
import org.eclipse.sensinact.northbound.query.api.EResultType; | ||
|
||
|
||
public class ResponseSnapshotDTO extends AbstractResultDTO { | ||
|
||
public Map<String, SnapshotProviderDTO> providers; | ||
|
||
public ResponseSnapshotDTO() { | ||
super(EResultType.SNAPSHOT_RESPONSE); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
.../src/main/java/org/eclipse/sensinact/northbound/query/dto/result/SnapshotProviderDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Kentyou - initial implementation | ||
**********************************************************************/ | ||
package org.eclipse.sensinact.northbound.query.dto.result; | ||
|
||
import java.util.Map; | ||
|
||
public class SnapshotProviderDTO { | ||
|
||
/** | ||
* Provider ID | ||
*/ | ||
public String name; | ||
|
||
/** | ||
* Model Name | ||
*/ | ||
public String modelName; | ||
|
||
/** | ||
* List of services | ||
*/ | ||
public Map<String, SnapshotServiceDTO> services; | ||
} |
47 changes: 47 additions & 0 deletions
47
.../src/main/java/org/eclipse/sensinact/northbound/query/dto/result/SnapshotResourceDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Kentyou - initial implementation | ||
**********************************************************************/ | ||
package org.eclipse.sensinact.northbound.query.dto.result; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
|
||
public class SnapshotResourceDTO { | ||
|
||
/** | ||
* Resource ID | ||
*/ | ||
public String name; | ||
|
||
/** | ||
* Value milliseconds timestamp | ||
*/ | ||
public long timestamp; | ||
|
||
/** | ||
* Value type | ||
*/ | ||
public String type; | ||
|
||
/** | ||
* Value value | ||
*/ | ||
public Object value; | ||
|
||
/** | ||
* Metadata, if requested | ||
*/ | ||
@JsonInclude(Include.NON_NULL) | ||
public List<MetadataDTO> attributes; | ||
} |
28 changes: 28 additions & 0 deletions
28
...r/src/main/java/org/eclipse/sensinact/northbound/query/dto/result/SnapshotServiceDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Kentyou - initial implementation | ||
**********************************************************************/ | ||
package org.eclipse.sensinact.northbound.query.dto.result; | ||
|
||
import java.util.Map; | ||
|
||
public class SnapshotServiceDTO { | ||
|
||
/** | ||
* Provider ID | ||
*/ | ||
public String name; | ||
|
||
/** | ||
* List of resources | ||
*/ | ||
public Map<String, SnapshotResourceDTO> resources; | ||
} |
Oops, something went wrong.