-
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 #524 from eclipse-sensinact/thomas/wot
Initial version of the southbound Web of Things provider
- Loading branch information
Showing
65 changed files
with
5,071 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Web of Things API | ||
|
||
## Source of test files | ||
|
||
- [basic-td.td.jsonld](https://github.com/eclipse-thingweb/playground/blob/master/examples/td/1-simple-default/basic-td.td.jsonld) | ||
- [smart-coffee-machine.jsonld](https://github.com/eclipse-thingweb/node-wot/blob/master/packages/examples/src/scripts/smart-coffee-machine.ts) |
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,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/********************************************************************* | ||
* Copyright (c) 2024 Kentyou and others | ||
* | ||
* 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 | ||
**********************************************************************/ | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.eclipse.sensinact.gateway.southbound.wot</groupId> | ||
<artifactId>wot</artifactId> | ||
<version>${revision}${changelist}</version> | ||
</parent> | ||
<artifactId>wot-api</artifactId> | ||
|
||
<name>Web of Things API</name> | ||
<description>APIs and classes to describe Things</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.sensinact.gateway.core</groupId> | ||
<artifactId>api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-testing-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-resolver-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
29 changes: 29 additions & 0 deletions
29
.../api/src/main/java/org/eclipse/sensinact/gateway/southbound/wot/api/ActionAffordance.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,29 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2024 Kentyou. | ||
* | ||
* 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: | ||
* Thomas Calmant (Kentyou) - Initial contribution | ||
**********************************************************************/ | ||
|
||
package org.eclipse.sensinact.gateway.southbound.wot.api; | ||
|
||
import org.eclipse.sensinact.gateway.southbound.wot.api.dataschema.DataSchema; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class ActionAffordance extends InteractionAffordance { | ||
|
||
public DataSchema input; | ||
public DataSchema output; | ||
|
||
public Boolean safe = false; | ||
public Boolean idempotent = false; | ||
public Boolean synchronous; | ||
} |
23 changes: 23 additions & 0 deletions
23
...ain/java/org/eclipse/sensinact/gateway/southbound/wot/api/AdditionalExpectedResponse.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,23 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2024 Kentyou. | ||
* | ||
* 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: | ||
* Thomas Calmant (Kentyou) - Initial contribution | ||
**********************************************************************/ | ||
|
||
package org.eclipse.sensinact.gateway.southbound.wot.api; | ||
|
||
public class AdditionalExpectedResponse { | ||
|
||
public boolean success = false; | ||
|
||
public String contentType; | ||
|
||
public String schema; | ||
} |
27 changes: 27 additions & 0 deletions
27
...t/api/src/main/java/org/eclipse/sensinact/gateway/southbound/wot/api/EventAffordance.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,27 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2024 Kentyou. | ||
* | ||
* 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: | ||
* Thomas Calmant (Kentyou) - Initial contribution | ||
**********************************************************************/ | ||
|
||
package org.eclipse.sensinact.gateway.southbound.wot.api; | ||
|
||
import org.eclipse.sensinact.gateway.southbound.wot.api.dataschema.DataSchema; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class EventAffordance extends InteractionAffordance { | ||
|
||
public DataSchema subscription; | ||
public DataSchema data; | ||
public DataSchema dataResponse; | ||
public DataSchema cancellation; | ||
} |
19 changes: 19 additions & 0 deletions
19
.../api/src/main/java/org/eclipse/sensinact/gateway/southbound/wot/api/ExpectedResponse.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,19 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2024 Kentyou. | ||
* | ||
* 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: | ||
* Thomas Calmant (Kentyou) - Initial contribution | ||
**********************************************************************/ | ||
|
||
package org.eclipse.sensinact.gateway.southbound.wot.api; | ||
|
||
public class ExpectedResponse { | ||
|
||
public String contentType; | ||
} |
64 changes: 64 additions & 0 deletions
64
southbound/wot/api/src/main/java/org/eclipse/sensinact/gateway/southbound/wot/api/Form.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,64 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2024 Kentyou. | ||
* | ||
* 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: | ||
* Thomas Calmant (Kentyou) - Initial contribution | ||
**********************************************************************/ | ||
|
||
package org.eclipse.sensinact.gateway.southbound.wot.api; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAnyGetter; | ||
import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class Form { | ||
|
||
public String href; | ||
|
||
public String contentType = "application/json"; | ||
|
||
public String contentCoding; | ||
|
||
@JsonFormat(with = { JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, | ||
JsonFormat.Feature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED }) | ||
public List<String> security; | ||
|
||
@JsonFormat(with = { JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, | ||
JsonFormat.Feature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED }) | ||
public List<String> scopes; | ||
|
||
public ExpectedResponse response; | ||
|
||
public List<AdditionalExpectedResponse> additionalResponses; | ||
|
||
public String subprotocol; | ||
|
||
@JsonFormat(with = { JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, | ||
JsonFormat.Feature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED }) | ||
public List<String> op = new ArrayList<>(); | ||
|
||
private final Map<String, Object> extraProperties = new HashMap<>(); | ||
|
||
@JsonAnySetter | ||
public void addAdditionalProperty(String name, Object value) { | ||
extraProperties.put(name, value); | ||
} | ||
|
||
@JsonAnyGetter | ||
public Map<String, Object> getAdditionalProperties() { | ||
return extraProperties; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...src/main/java/org/eclipse/sensinact/gateway/southbound/wot/api/InteractionAffordance.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) 2024 Kentyou. | ||
* | ||
* 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: | ||
* Thomas Calmant (Kentyou) - Initial contribution | ||
**********************************************************************/ | ||
|
||
package org.eclipse.sensinact.gateway.southbound.wot.api; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class InteractionAffordance { | ||
|
||
@JsonProperty("@type") | ||
@JsonFormat(with = { JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, | ||
JsonFormat.Feature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED }) | ||
public List<String> semanticType; | ||
|
||
public String title; | ||
public String description; | ||
|
||
public List<Form> forms; | ||
} |
39 changes: 39 additions & 0 deletions
39
southbound/wot/api/src/main/java/org/eclipse/sensinact/gateway/southbound/wot/api/Link.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,39 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2024 Kentyou. | ||
* | ||
* 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: | ||
* Thomas Calmant (Kentyou) - Initial contribution | ||
**********************************************************************/ | ||
|
||
package org.eclipse.sensinact.gateway.southbound.wot.api; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class Link { | ||
|
||
public String href; | ||
|
||
public String type; | ||
|
||
public String rel; | ||
|
||
public String anchor; | ||
|
||
public String sizes; | ||
|
||
@JsonProperty("hreflang") | ||
@JsonFormat(with = { JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, | ||
JsonFormat.Feature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED }) | ||
public List<String> hrefLang; | ||
} |
Oops, something went wrong.