├── doc
├── binding
│ ├── file.md
│ ├── value.md
│ ├── jsonpath+http.md
│ ├── jadex.md
│ ├── coap.md
│ ├── mqtt.md
│ └── akka.md
├── README.md
├── development
│ └── README.md
└── security
│ └── README.md
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── wot-servient
└── src
│ ├── main
│ ├── resources
│ │ ├── reference.conf
│ │ ├── jarcache.json
│ │ └── project.properties
│ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ ├── wot
│ │ ├── content
│ │ │ ├── package-info.java
│ │ │ ├── HtmlCodec.java
│ │ │ ├── ContentCodecException.java
│ │ │ └── CborCodec.java
│ │ ├── package-info.java
│ │ ├── binding
│ │ │ ├── package-info.java
│ │ │ ├── ProtocolClientException.java
│ │ │ ├── ProtocolServerException.java
│ │ │ ├── ProtocolClientNotImplementedException.java
│ │ │ └── ProtocolServerNotImplementedException.java
│ │ ├── thing
│ │ │ ├── filter
│ │ │ │ ├── package-info.java
│ │ │ │ ├── ThingQueryException.java
│ │ │ │ └── DiscoveryMethod.java
│ │ │ ├── event
│ │ │ │ ├── package-info.java
│ │ │ │ └── EventState.java
│ │ │ ├── action
│ │ │ │ └── package-info.java
│ │ │ ├── property
│ │ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── form
│ │ │ │ └── package-info.java
│ │ │ ├── security
│ │ │ │ ├── package-info.java
│ │ │ │ ├── NoSecurityScheme.java
│ │ │ │ ├── PSKSecurityScheme.java
│ │ │ │ └── PublicSecurityScheme.java
│ │ │ ├── schema
│ │ │ │ ├── package-info.java
│ │ │ │ ├── AbstractDataSchema.java
│ │ │ │ ├── NullSchema.java
│ │ │ │ ├── NumberSchema.java
│ │ │ │ ├── StringSchema.java
│ │ │ │ ├── BooleanSchema.java
│ │ │ │ ├── IntegerSchema.java
│ │ │ │ ├── ArraySchema.java
│ │ │ │ └── DataSchema.java
│ │ │ ├── NoClientFactoryForSchemesConsumedThingException.java
│ │ │ ├── ConsumedThingException.java
│ │ │ └── NoFormForInteractionConsumedThingException.java
│ │ ├── ServientConfigException.java
│ │ ├── scripting
│ │ │ ├── ScriptingException.java
│ │ │ ├── ScriptingEngineException.java
│ │ │ └── ScriptingManagerException.java
│ │ ├── WotException.java
│ │ ├── ServientException.java
│ │ ├── ServientDiscoveryIgnore.java
│ │ └── util
│ │ │ └── LoggingUtil.java
│ │ ├── ObjectBuilder.java
│ │ ├── RefCountResourceException.java
│ │ └── Futures.java
│ └── test
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── thing
│ ├── schema
│ ├── NullSchemaTest.java
│ ├── NumberSchemaTest.java
│ ├── ObjectSchemaTest.java
│ ├── StringSchemaTest.java
│ ├── BooleanSchemaTest.java
│ ├── IntegerSchemaTest.java
│ ├── ArraySchemaTest.java
│ └── VariableDataSchemaTest.java
│ ├── security
│ └── NoSecuritySchemeTest.java
│ └── filter
│ └── ThingFilterTest.java
├── wot-servient-binding-coap
└── src
│ ├── main
│ ├── resources
│ │ └── reference.conf
│ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── coap
│ │ ├── package-info.java
│ │ └── resource
│ │ ├── EventResource.java
│ │ └── ObservePropertyResource.java
│ └── test
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── binding
│ └── coap
│ └── CoapProtocolClientFactoryTest.java
├── wot-servient-binding-akka
├── Makefile
├── README.md
└── src
│ └── main
│ ├── resources
│ └── reference.conf
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── binding
│ └── akka
│ └── AkkaProtocolPattern.java
├── wot-servient-binding-mqtt
└── src
│ ├── main
│ ├── resources
│ │ └── reference.conf
│ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── mqtt
│ │ ├── package-info.java
│ │ └── MqttProtocolException.java
│ └── test
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── binding
│ └── mqtt
│ └── MqttProtocolClientFactoryTest.java
├── wot-servient-examples
├── examples
│ └── groovy-scripts
│ │ ├── README.md
│ │ ├── example-event-client.groovy
│ │ └── example-dynamic.groovy
└── src
│ └── main
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── examples
│ └── package-info.java
├── wot-servient-scripting-groovy
└── src
│ └── main
│ ├── resources
│ └── META-INF
│ │ └── services
│ │ └── org.codehaus.groovy.runtime.ExtensionModule
│ └── groovy
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── WotExtensions.groovy
├── wot-servient-binding-http
└── src
│ ├── main
│ ├── resources
│ │ └── reference.conf
│ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── http
│ │ ├── package-info.java
│ │ ├── route
│ │ └── package-info.java
│ │ ├── HttpsProtocolClientFactory.java
│ │ ├── HttpProtocolClientFactory.java
│ │ └── ContentResponseTransformer.java
│ └── test
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── binding
│ └── http
│ ├── HttpsProtocolClientFactoryTest.java
│ ├── HttpProtocolClientFactoryTest.java
│ └── ContentResponseTransformerTest.java
├── wot-servient-binding-jadex
├── README.md
└── src
│ ├── main
│ ├── resources
│ │ └── reference.conf
│ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── jadex
│ │ ├── ThingsService.java
│ │ └── ThingService.java
│ └── test
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── binding
│ └── jadex
│ └── JadexProtocolClientFactoryTest.java
├── Dockerfile
├── wot-servient-binding-websocket
└── src
│ ├── main
│ ├── resources
│ │ └── reference.conf
│ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── websocket
│ │ ├── package-info.java
│ │ ├── message
│ │ ├── FinalResponse.java
│ │ ├── SubscribeCompleteResponse.java
│ │ ├── SubscribeErrorResponse.java
│ │ ├── ClientErrorResponse.java
│ │ ├── ServerErrorResponse.java
│ │ ├── SubscribeNextResponse.java
│ │ ├── ThingInteraction.java
│ │ ├── InvokeActionResponse.java
│ │ └── ThingInteractionWithContent.java
│ │ └── handler
│ │ └── codec
│ │ └── TextWebSocketFrameEncoder.java
│ └── test
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── binding
│ └── websocket
│ └── WebsocketProtocolClientFactoryTest.java
├── wot-servient-integration-tests
└── src
│ └── test
│ └── resources
│ └── application.conf
├── .gitlab-ci.yml
├── wot-servient-cli
├── README.md
└── src
│ └── main
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── cli
│ ├── CliShutdownException.java
│ └── CliException.java
├── .gitlab-ci
├── Docker.gitlab-ci.yml
└── Maven.gitlab-ci.yml
├── .github
└── workflows
│ └── maven.yml
├── LICENSE
├── wot-servient-binding-file
├── src
│ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── github
│ │ │ └── sanecity
│ │ │ └── wot
│ │ │ └── binding
│ │ │ └── file
│ │ │ ├── package-info.java
│ │ │ └── FileProtocolClientFactory.java
│ └── test
│ │ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── file
│ │ └── FileProtocolClientFactoryTest.java
└── pom.xml
├── wot-servient-binding-value
├── src
│ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── github
│ │ │ └── sanecity
│ │ │ └── wot
│ │ │ └── binding
│ │ │ └── value
│ │ │ ├── package-info.java
│ │ │ ├── ValueProtocolClientFactory.java
│ │ │ └── ValueProtocolClient.java
│ └── test
│ │ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── value
│ │ └── ValueProtocolClientFactoryTest.java
└── pom.xml
├── wot-servient-binding-jsonpathhttp
└── src
│ ├── main
│ └── java
│ │ └── io
│ │ └── github
│ │ └── sanecity
│ │ └── wot
│ │ └── binding
│ │ └── jsonpathhttp
│ │ ├── package-info.java
│ │ └── JsonpathHttpProtocolClientFactory.java
│ └── test
│ └── java
│ └── io
│ └── github
│ └── sanecity
│ └── wot
│ └── binding
│ └── jsonpathhttp
│ └── JsonpathHttpProtocolClientFactoryTest.java
├── coverage-jacoco.sh
├── .gitignore
└── .run
└── Whole project.run.xml
/doc/binding/file.md:
--------------------------------------------------------------------------------
1 | # File Binding
2 |
3 | Reads Thing Descriptions and property values from files.
--------------------------------------------------------------------------------
/doc/binding/value.md:
--------------------------------------------------------------------------------
1 | # Value Binding
2 |
3 | This binding reads values directly from the Thing Description.
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sane-city/wot-servient/HEAD/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/wot-servient/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | servers = null
4 | client-factories = null
5 | credentials {}
6 | }
7 | }
--------------------------------------------------------------------------------
/wot-servient-binding-coap/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | coap {
4 | bind-port = 5683
5 | addresses = [] # example value: ["coap://127.0.0.1:5683"]
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/wot-servient-binding-akka/Makefile:
--------------------------------------------------------------------------------
1 | package:
2 | cd ../ && mvn -DskipTests clean install
3 | mvn -DskipTests clean package
4 |
5 | docker:
6 | docker build -t git.informatik.uni-hamburg.de:4567/bornholdt/sane-node-akka:wot-akka .
7 |
--------------------------------------------------------------------------------
/wot-servient-binding-mqtt/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | mqtt {
4 | broker = "tcp://iot.eclipse.org"
5 | # username = "myusername"
6 | # password = "mysecretpassword"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/doc/binding/jsonpath+http.md:
--------------------------------------------------------------------------------
1 | # JSONPath+HTTP Binding
2 |
3 | This binding is based on the [HTTP binding](http.md).
4 | It allows you to apply JSON queries on the results given by the HTTP binding.
5 | This allows you to create Things based on complex JSON objects.
--------------------------------------------------------------------------------
/wot-servient-examples/examples/groovy-scripts/README.md:
--------------------------------------------------------------------------------
1 | The examples contained in this directory can be used with the CLI of WoT Servient.
2 |
3 | **Example:**
4 | ```bash
5 | wot-servient counter.groovy
6 | wot-servient --clientonly counter-client.groovy
7 | ```
--------------------------------------------------------------------------------
/wot-servient-scripting-groovy/src/main/resources/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule:
--------------------------------------------------------------------------------
1 | moduleName=Groovy Extensions
2 | moduleVersion=1.0.0
3 | extensionClasses=io.github.sanecity.wot.WotExtensions io.github.sanecity.wot.thing.ExposedThingExtensions
--------------------------------------------------------------------------------
/wot-servient-binding-http/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | http {
4 | bind-host = "0.0.0.0"
5 | bind-port = 8080
6 | addresses = [] # example value: ["http://127.0.0.1:8080"]
7 | security {
8 | scheme = null
9 | }
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/resources/jarcache.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "Content-Location": "http://www.w3.org/2019/wot/td/v1",
4 | "X-Classpath": "w3c-wot-td-context.jsonld",
5 | "Content-Type": "application/ld+json"
6 | },
7 | {
8 | "Content-Location": "https://www.w3.org/2019/wot/td/v1",
9 | "X-Classpath": "w3c-wot-td-context.jsonld",
10 | "Content-Type": "application/ld+json"
11 | }
12 | ]
--------------------------------------------------------------------------------
/wot-servient-binding-jadex/README.md:
--------------------------------------------------------------------------------
1 | This module uses [Jadex](https://www.activecomponents.org/#/project/news) to connect distributed nodes running the WoT
2 | implementation.
3 |
4 | Jadex built-in discovery function is used. In addition, Jadex allows interaction of nodes that do not have a direct
5 | connection (e.g. nodes behind NAT).
6 |
7 | ## Examples
8 |
9 | Examples can be found in the `io.github.sanecity.wot.examples` package.
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM kubeless/unzip AS build
2 |
3 | ADD ./wot-servient-*.zip .
4 |
5 | RUN unzip -qq ./wot-servient-*.zip && \
6 | rm ./wot-servient-*.zip
7 |
8 | FROM openjdk:11-jre-slim
9 |
10 | RUN mkdir /usr/local/share/wot-servient && \
11 | ln -s ../share/wot-servient/bin/wot-servient /usr/local/bin/wot-servient
12 |
13 | COPY --from=build ./wot-servient-* /usr/local/share/wot-servient/
14 |
15 | # http coap
16 | EXPOSE 8080 5683
17 |
18 | ENTRYPOINT ["wot-servient"]
19 |
--------------------------------------------------------------------------------
/wot-servient-binding-websocket/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | servers = [
4 | "io.github.sanecity.wot.binding.websocket.WebsocketProtocolServer",
5 | ]
6 |
7 | client-factories = [
8 | "io.github.sanecity.wot.binding.websocket.WebsocketProtocolClientFactory",
9 | ]
10 |
11 | websocket {
12 | bind-host = "0.0.0.0"
13 | bind-port = 8081
14 | addresses = [] # example value: ["ws://127.0.0.1:8081"]
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/wot-servient-binding-jadex/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | jadex {
4 | jcc = false // GUI
5 | jccweb = false
6 | chat = false
7 | cli = false
8 | debugfutures = true
9 | // relayaddresses = "https://sane1.informatik.uni-hamburg.de"
10 | // catalogawareness.platformurls = "ws://ssp1@sane1.informatik.uni-hamburg.de:80"
11 | // networknames = "SANE"
12 | // networksecrets = "SANESANESANE"
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/wot-servient-integration-tests/src/test/resources/application.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | coap {
4 | # let OS select a free port. See: https://git.informatik.uni-hamburg.de/sane-public/wot-servient/issues/15
5 | bind-port = 0
6 | }
7 |
8 | http {
9 | # let OS select a free port.
10 | bind-port = 0
11 | }
12 |
13 | mqtt {
14 | broker = "tcp://localhost:1883" # change to "localhost" to run tests locally
15 | # username = "myusername"
16 | # password = "mysecretpassword"
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/doc/binding/jadex.md:
--------------------------------------------------------------------------------
1 | # Jadex Binding
2 |
3 | Uses [Jadex](https://www.activecomponents.org/) for the interaction with Things.
4 | Jadex enables the development of distributed service-based applications.
5 | The protocol client and server share an Jadex Platform.
6 |
7 | ## Configuration
8 |
9 | To add Websocket support to the Servient, `"io.github.sanecity.wot.binding.jadex.JadexProtocolServer"` must be added to Config parameter `wot.servient.servers`
10 | and
11 | `"io.github.sanecity.wot.binding.jadex.JadexProtocolClientFactory"` must be added to parameter
12 | `wot.servient.client-factories`.
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | include:
2 | - local: /.gitlab-ci/Maven.gitlab-ci.yml # we have to use our own template, since GitLab's template uses JDK8, but we need JDK11
3 | # - template: Dependency-Scanning.gitlab-ci.yml
4 | # - template: Code-Quality.gitlab-ci.yml
5 | - local: /.gitlab-ci/Docker.gitlab-ci.yml
6 | # - template: License-Management.gitlab-ci.yml
7 | # - template: SAST.gitlab-ci.yml
8 |
9 | #license_management:
10 | # variables:
11 | # MAVEN_CLI_OPTS: -DskipTests
12 | # LM_JAVA_VERSION: 11
13 | #
14 | #sast:
15 | # variables:
16 | # MAVEN_CLI_OPTS: -DskipTests
17 | # SAST_JAVA_VERSION: 11
18 |
--------------------------------------------------------------------------------
/doc/README.md:
--------------------------------------------------------------------------------
1 | # SANE Web of Things Servient Documentation
2 |
3 | Welcome to [SANE Web of Things Servient](https://github.com/sane-city/wot-servient) Documentation.
4 |
5 | ## Overview
6 |
7 | [**Protocol Bindings**](binding/README.md) Information about the different supported protocols for communication with Things (HTTP, CoAP, MQTT, etc.).
8 |
9 | [**Security Schemes**](security/README.md) Information about the different supported security schemes for communication with Things (Basic, Bearer, OAuth, PSK, etc.).
10 |
11 | [**Development**](development/README.md) Information for developers about conventions and workflows (release new version, etc.).
--------------------------------------------------------------------------------
/wot-servient-cli/README.md:
--------------------------------------------------------------------------------
1 | ## Usage
2 |
3 | ### Builds
4 |
5 | The current version of the CLI can be downloaded from the following address: https://git.informatik.uni-hamburg.de/sane-public/wot-servient/-/jobs/artifacts/master/download?job=build-dist
6 |
7 | Show help:
8 | ```bash
9 | bin/wot-servient -h
10 | ```
11 |
12 | Execute all WoT scripts from the current directory
13 | ```bash
14 | bin/wot-servient
15 | ```
16 |
17 | ## Docker
18 |
19 | Show help:
20 | ```bash
21 | docker run --rm -ti sanecity/wot-servient -h
22 | ```
23 |
24 | Execute all WoT scripts from the directory `./wot-scripts`
25 | ```bash
26 | docker run --rm -ti -v ./wot-scripts:/wot-servient/ sanecity/wot-servient
27 | ```
--------------------------------------------------------------------------------
/wot-servient-binding-akka/README.md:
--------------------------------------------------------------------------------
1 | This module uses [Akka](https://akka.io/) to connect different distributed nodes running the WoT implementation.
2 |
3 | For the discovery the cluster function of Akka is used.
4 | This extension also enables interaction with Things via HTTP.
5 |
6 | ## Examples
7 |
8 | Examples can be found in the `io.github.sanecity.wot.examples` package.
9 |
10 | ## Other stuff
11 |
12 | cd /sane-node-akka mvn clean install cd ./wot-akka mvn -DskipTests clean install mvn -DskipTests clean package
13 |
14 | java -cp ./target/wot-akka-1.0-SNAPSHOT.jar -Dconfig.file=/opt/application.conf io.github.sanecity.examples.Klimabotschafter
15 |
16 | docker build -t git.informatik.uni-hamburg.de:4567/bornholdt/sane-node-akka:wot-akka .
17 |
18 | docker run -ti --rm -P git.informatik.uni-hamburg.de:4567/bornholdt/sane-node-akka:wot-akka io.github.sanecity.wot.examples.Klimabotschafter
--------------------------------------------------------------------------------
/.gitlab-ci/Docker.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | .docker: &docker
2 | stage: .post
3 | # Official docker image.
4 | image: docker:latest
5 | services:
6 | - docker:dind
7 | before_script:
8 | - docker login --username "$CI_REGISTRY_USER" --password "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
9 | tags:
10 | - docker
11 |
12 | docker-build-master:
13 | <<: *docker
14 | script:
15 | - docker build --pull --tag "$CI_REGISTRY_IMAGE" .
16 | # minimal test
17 | - docker run --rm "$CI_REGISTRY_IMAGE" --help
18 | - docker push "$CI_REGISTRY_IMAGE"
19 | only:
20 | - master
21 |
22 | docker-build:
23 | <<: *docker
24 | script:
25 | - docker build --pull --tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
26 | # minimal test
27 | - docker run --rm "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --help
28 | - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
29 | except:
30 | - master
--------------------------------------------------------------------------------
/.github/workflows/maven.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a Java project with Maven
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3 |
4 | name: Java CI with Maven
5 |
6 | on:
7 | push:
8 | branches: [ master ]
9 | pull_request:
10 | branches: [ master ]
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: ubuntu-latest
16 |
17 | services:
18 | mosquitto:
19 | image: eclipse-mosquitto:1.6
20 | ports:
21 | - 1883:1883
22 |
23 | steps:
24 | - uses: actions/checkout@v2
25 | - name: Set up JDK 11
26 | uses: actions/setup-java@v2
27 | with:
28 | java-version: '11'
29 | distribution: 'adopt'
30 | - name: Cache Maven packages
31 | uses: actions/cache@v2.1.6
32 | with:
33 | path: ~/.m2
34 | key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
35 | restore-keys: ${{ runner.os }}-m2
36 | - name: Build with Maven
37 | run: ./mvnw -B verify --file pom.xml
38 |
--------------------------------------------------------------------------------
/doc/binding/coap.md:
--------------------------------------------------------------------------------
1 | # CoAP Binding
2 |
3 | Uses the Constrained Application Protocol for interaction with Things.
4 |
5 | ## Configuration
6 |
7 | To add CoAP support to the Servient, `"io.github.sanecity.wot.binding.coap.CoapProtocolServer"` must be added to Config parameter `wot.servient.servers` and
8 | `"io.github.sanecity.wot.binding.coap.CoapProtocolClientFactory"` must be added to parameter
9 | `wot.servient.client-factories`.
10 |
11 | All configurations associated with COAP Binding are located in the `wot.servient.coap` namespace:
12 |
13 | | Parameter | Explanation | Default Value |
14 | |-------------------|---------------|---------------|
15 | | `bind-port` | Port that CoAP server should listen on. A port number of `0` means that the port number is automatically allocated. | `5683` |
16 | | `addresses` | List of URLs, which are used in the Thing Description as accessible addresses. If no addresses are specified, the service automatically determines its local addresses. However, it may be necessary to set the address manually, for example when using Docker. | `[]` |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2019-2022 Heiko Bornholdt
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19 | OR OTHER DEALINGS IN THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/wot-servient/src/main/resources/project.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019-2022 Heiko Bornholdt
3 | #
4 | # Permission is hereby granted, free of charge, to any person obtaining a copy
5 | # of this software and associated documentation files (the "Software"), to deal
6 | # in the Software without restriction, including without limitation the rights
7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | # copies of the Software, and to permit persons to whom the Software is
9 | # furnished to do so, subject to the following conditions:
10 | #
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | #
14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | # OR OTHER DEALINGS IN THE SOFTWARE.
21 | #
22 | version=${project.version} (${git.commit.id.abbrev})
--------------------------------------------------------------------------------
/wot-servient-binding-websocket/src/main/java/io/github/sanecity/wot/binding/websocket/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.binding.websocket;
--------------------------------------------------------------------------------
/wot-servient-examples/src/main/java/io/github/sanecity/wot/examples/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Examples for using the WoT Servient.
24 | */
25 | package io.github.sanecity.wot.examples;
--------------------------------------------------------------------------------
/wot-servient-binding-coap/src/main/java/io/github/sanecity/wot/binding/coap/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Thing Interaction support for CoAP.
24 | */
25 | package io.github.sanecity.wot.binding.coap;
--------------------------------------------------------------------------------
/wot-servient-binding-http/src/main/java/io/github/sanecity/wot/binding/http/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Thing Interaction support for HTTP.
24 | */
25 | package io.github.sanecity.wot.binding.http;
--------------------------------------------------------------------------------
/wot-servient-binding-mqtt/src/main/java/io/github/sanecity/wot/binding/mqtt/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Thing Interaction support for MQTT.
24 | */
25 | package io.github.sanecity.wot.binding.mqtt;
--------------------------------------------------------------------------------
/wot-servient-binding-file/src/main/java/io/github/sanecity/wot/binding/file/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Thing Interaction support for local files.
24 | */
25 | package io.github.sanecity.wot.binding.file;
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/content/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Provides an extensible interface for processing data in various formats.
24 | */
25 | package io.github.sanecity.wot.content;
--------------------------------------------------------------------------------
/wot-servient-binding-websocket/src/main/java/io/github/sanecity/wot/binding/websocket/message/FinalResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.binding.websocket.message;
23 |
24 | public interface FinalResponse {
25 | }
26 |
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * W3C Web of Things (WoT) implementation in Java. See also: https://www.w3.org/TR/wot-architecture/
24 | */
25 | package io.github.sanecity.wot;
--------------------------------------------------------------------------------
/wot-servient-binding-http/src/main/java/io/github/sanecity/wot/binding/http/route/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Defines the different endpoints for the HTTP server.
24 | */
25 | package io.github.sanecity.wot.binding.http.route;
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/binding/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Provides an extensible interface for exposing and consuming things using various protocols.
24 | */
25 | package io.github.sanecity.wot.binding;
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/filter/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Includes several implementations for filtering things in the discovery process.
24 | */
25 | package io.github.sanecity.wot.thing.filter;
--------------------------------------------------------------------------------
/wot-servient-binding-value/src/main/java/io/github/sanecity/wot/binding/value/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Thing Interaction support for values stored in Thing Descriptions.
24 | */
25 | package io.github.sanecity.wot.binding.value;
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019-2022 Heiko Bornholdt
3 | #
4 | # Permission is hereby granted, free of charge, to any person obtaining a copy
5 | # of this software and associated documentation files (the "Software"), to deal
6 | # in the Software without restriction, including without limitation the rights
7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | # copies of the Software, and to permit persons to whom the Software is
9 | # furnished to do so, subject to the following conditions:
10 | #
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | #
14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | # OR OTHER DEALINGS IN THE SOFTWARE.
21 | #
22 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip
23 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
24 |
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/event/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Everything that belongs to Web of Thing Events. See also: https://www.w3.org/TR/wot-architecture/#events
24 | */
25 | package io.github.sanecity.wot.thing.event;
--------------------------------------------------------------------------------
/doc/development/README.md:
--------------------------------------------------------------------------------
1 | # Development
2 |
3 | ## Release new version
4 |
5 | ```bash
6 | rm -f release.properties
7 | mvn clean -DskipTests -Darguments=-DskipTests release:prepare
8 | ```
9 |
10 | **An additional call of `mvn release:perform` is not necessary!**
11 |
12 | Wait for GitLab CI to finish build tasks and select "Keep" on job artifact.
13 |
14 | Add Release Notes to git Tag on [GitLab](https://git.informatik.uni-hamburg.de/sane-public/wot-servient/-/tags).
15 |
16 | Add Asset to Release
17 |
18 | ```bash
19 | curl --request POST \
20 | --header "PRIVATE-TOKEN: s3cr3tPassw0rd" \
21 | --data name="wot-servient-1.2.zip" \
22 | --data url="https://git.informatik.uni-hamburg.de/sane-public/wot-servient/-/jobs/artifacts/1.2/raw/wot-servient-1.2.zip?job=maven-deploy" \
23 | "https://git.informatik.uni-hamburg.de/api/v4/projects/2707/releases/1.2/assets/links"
24 | ```
25 |
26 | ## Build dist
27 |
28 | ```bash
29 | mvn -DskipTests -pl wot-servient-cli -am package
30 | # wot-servient-cli/target/wot-servient-*.zip generated
31 | ```
32 |
33 | ## Build and Push Docker Image
34 |
35 | ```bash
36 | docker build -t git.informatik.uni-hamburg.de:4567/sane-public/wot-servient:latest .
37 | docker push git.informatik.uni-hamburg.de:4567/sane-public/wot-servient:latest
38 | ```
39 |
40 | ## Code Style
41 |
42 | We use a custom Java code style for which is described in the following file (IntelliJ IDEA only) [SANE.xml](../SANE.xml).
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/action/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Everything that belongs to Web of Thing Actions. See also: https://www.w3.org/TR/wot-architecture/#actions
24 | */
25 | package io.github.sanecity.wot.thing.action;
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/property/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Everything that belongs to Web of Thing Events. See also: https://www.w3.org/TR/wot-architecture/#events
24 | */
25 | package io.github.sanecity.wot.thing.property;
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Includes classes for defining and interacting with Things. See also:
24 | * https://www.w3.org/TR/wot-architecture/#sec-web-thing
25 | */
26 | package io.github.sanecity.wot.thing;
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/form/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Everything that belongs to Web of Thing Forms. See also: https://www.w3.org/TR/wot-architecture/#sec-hypermedia-forms
24 | */
25 | package io.github.sanecity.wot.thing.form;
26 |
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/security/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Security relevant stuff to Things. See also: https://www.w3.org/TR/wot-thing-description/#sec-security-vocabulary-definition
24 | */
25 | package io.github.sanecity.wot.thing.security;
--------------------------------------------------------------------------------
/wot-servient-binding-jsonpathhttp/src/main/java/io/github/sanecity/wot/binding/jsonpathhttp/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Thing Interaction support for HTTP with support for manipulation of return values using JSON
24 | * queries.
25 | */
26 | package io.github.sanecity.wot.binding.jsonpathhttp;
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/schema/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | /**
23 | * Describes the schema of data used in Thing Interaction. See also:
24 | * https://www.w3.org/TR/wot-thing-description/#sec-data-schema-vocabulary-definition
25 | */
26 | package io.github.sanecity.wot.thing.schema;
--------------------------------------------------------------------------------
/wot-servient-binding-akka/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | wot {
2 | servient {
3 | akka {
4 | system-name = "wot"
5 | ask-timeout = 60s
6 | discover-timeout = 5s
7 |
8 | // log-config-on-start = "on"
9 |
10 | # use SLF4J as logger
11 | # https://doc.akka.io/docs/akka/current/logging.html#slf4j
12 | loggers = ["akka.event.slf4j.Slf4jLogger"]
13 | # Options: OFF, ERROR, WARNING, INFO, DEBUG
14 | loglevel = "WARNING"
15 | logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
16 |
17 | actor {
18 | provider = "cluster"
19 |
20 | serialization-bindings {
21 | "io.github.sanecity.wot.binding.akka.Message" = jackson-json
22 | }
23 | }
24 |
25 | remote {
26 | artery {
27 | transport = tcp
28 | canonical.hostname = "127.0.0.1"
29 | canonical.port = 25520
30 | }
31 | }
32 |
33 | cluster {
34 | seed-nodes = [
35 | "akka://wot@127.0.0.1:25520",
36 | ]
37 |
38 | # auto downing is NOT safe for production deployments.
39 | # you may want to use it during development, read more about it in the docs.
40 | auto-down-unreachable-after = 10s
41 |
42 | # silence the logging of cluster events at info level
43 | log-info = off
44 |
45 | jmx.multi-mbeans-in-same-jvm = on
46 | }
47 |
48 | extensions = ["akka.cluster.pubsub.DistributedPubSub"]
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/ObjectBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity;
23 |
24 | /**
25 | * This interface helps to implement the Builder
26 | * Pattern.
27 | *
28 | * @param
29 | */
30 | public interface ObjectBuilder {
31 | T build();
32 | }
33 |
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/content/HtmlCodec.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.content;
23 |
24 | /**
25 | * (De)serializes data in HTML format.
26 | */
27 | public class HtmlCodec extends TextCodec {
28 | @Override
29 | public String getMediaType() {
30 | return "text/html";
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/wot-servient-cli/src/main/java/io/github/sanecity/wot/cli/CliShutdownException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.cli;
23 |
24 | /**
25 | * This exception is thrown when the command line interface should terminate.
26 | */
27 | public class CliShutdownException extends RuntimeException {
28 | public CliShutdownException() {
29 | super();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/doc/binding/mqtt.md:
--------------------------------------------------------------------------------
1 | # MQTT Binding
2 |
3 | This binding uses a Message Queuing Telemetry Transport broker to interact with Things.
4 |
5 | The Thing Descriptions of all exposed Things are published as retainable messages on the Broker. The topic corresponds to the Thing Description.
6 |
7 | ## Configuration
8 |
9 | To add MQTT support to the Servient, `"io.github.sanecity.wot.binding.mqtt.MqttProtocolServer"` must be added to Config parameter `wot.servient.servers` and
10 | `"io.github.sanecity.wot.binding.mqtt.MqttProtocolClientFactory"` must be added to parameter
11 | `wot.servient.client-factories`.
12 |
13 | All configurations associated with MQTT Binding are located in the `wot.servient.mqtt` namespace:
14 |
15 | | Parameter | Explanation | Default Value |
16 | |---------------|---------------|---------------|
17 | | `broker` | Address of broker to connect to, specified as a URI | `"tcp://iot.eclipse.org"`
18 | | `username` | The username for the connection | |
19 | | `password` | The password for the connection | |
20 | | `client-id` | A client identifier that is unique on the broker being connected to | randomly generated value |
21 |
22 | ### Example
23 | ```hocon
24 | wot {
25 | servient {
26 | servers = [
27 | "io.github.sanecity.wot.binding.mqtt.MqttProtocolServer",
28 | ]
29 |
30 | client-factories = [
31 | "io.github.sanecity.wot.binding.mqtt.MqttProtocolClientFactory",
32 | ]
33 |
34 | mqtt {
35 | broker = "tcp://iot.eclipse.org"
36 | username = ""
37 | password = ""
38 | }
39 | }
40 | }
41 | ```
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/ServientConfigException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot;
23 |
24 | /**
25 | * A ServientConfigException is thrown by the {@link ServientConfig} when errors occur.
26 | */
27 | public class ServientConfigException extends ServientException {
28 | public ServientConfigException(Exception cause) {
29 | super(cause);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/scripting/ScriptingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.scripting;
23 |
24 | import io.github.sanecity.wot.ServientException;
25 |
26 | public abstract class ScriptingException extends ServientException {
27 | public ScriptingException(String message) {
28 | super(message);
29 | }
30 |
31 | public ScriptingException(Throwable cause) {
32 | super(cause);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/doc/security/README.md:
--------------------------------------------------------------------------------
1 | # Security Schemes Bindings
2 |
3 | Here you will find information about the security schemes supported by the WoT Servient.
4 | Security schemes are intended to restrict interaction with Things to authorized clients.
5 | Various mechanisms are available for authorization.
6 |
7 | Further information can be found in [W3C Web of Things Security Ontology](https://www.w3.org/2019/wot/security).
8 |
9 | The [Protocol Bindings](../binding/README.md) section describes which protocol supports which authentication mechanism.
10 | In addition, the page for each protocol describes how the server can be configured for the desired authentication mechanism.
11 |
12 | This page describes which credentials have to be defined for the different mechanisms in the service.
13 |
14 | ## Define Credentials
15 |
16 | All credentials are located in the parameter `wot.credentials`. This parameter contains a map with the Thing IDs as keys and
17 | the respective credentials for each Thing.
18 |
19 | ### Example
20 | ```hocon
21 | wot {
22 | servient {
23 | ...
24 | credentials {
25 | counter {
26 | username = "foo"
27 | password = "bar"
28 | }
29 | temperatur {
30 | token = "pu7eevaeH4Ie"
31 | }
32 | }
33 | }
34 | }
35 | ```
36 |
37 | ## basic
38 |
39 | | Parameter | Explanation |
40 | |-----------|-------------|
41 | | `username` | The username used for basic authentification.
42 | | `password` | The password used for basic authentification.
43 |
44 |
45 | ## bearer
46 |
47 | | Parameter | Explanation |
48 | |-----------|-------------|
49 | | `token` | The token used for bearer authentification.
--------------------------------------------------------------------------------
/wot-servient-binding-http/src/test/java/io/github/sanecity/wot/binding/http/HttpsProtocolClientFactoryTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.binding.http;
23 |
24 | import org.junit.jupiter.api.Test;
25 |
26 | import static org.junit.jupiter.api.Assertions.assertEquals;
27 |
28 | public class HttpsProtocolClientFactoryTest {
29 | @Test
30 | public void getScheme() {
31 | assertEquals("https", new HttpsProtocolClientFactory().getScheme());
32 | }
33 | }
--------------------------------------------------------------------------------
/wot-servient-binding-mqtt/src/test/java/io/github/sanecity/wot/binding/mqtt/MqttProtocolClientFactoryTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.binding.mqtt;
23 |
24 | import org.junit.jupiter.api.Test;
25 |
26 | import static org.junit.jupiter.api.Assertions.assertEquals;
27 |
28 | public class MqttProtocolClientFactoryTest {
29 | @Test
30 | public void getScheme() {
31 | assertEquals("mqtt", new MqttProtocolClientFactory(null).getScheme());
32 | }
33 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/scripting/ScriptingEngineException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.scripting;
23 |
24 | /**
25 | * A ScriptingEngineException is thrown by Implementations of {@link ScriptingEngine} when errors
26 | * occur.
27 | */
28 | @SuppressWarnings({ "java:S110" })
29 | class ScriptingEngineException extends ScriptingException {
30 | public ScriptingEngineException(Throwable cause) {
31 | super(cause);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/wot-servient-binding-jadex/src/main/java/io/github/sanecity/wot/binding/jadex/ThingsService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.binding.jadex;
23 |
24 | import jadex.bridge.IExternalAccess;
25 | import jadex.commons.future.IFuture;
26 |
27 | /**
28 | * Defines the Jadex Service interface for the exposing and no longer exposing of Things.
29 | */
30 | public interface ThingsService {
31 | IFuture expose(String id);
32 |
33 | IFuture destroy(String id);
34 | }
35 |
--------------------------------------------------------------------------------
/wot-servient-cli/src/main/java/io/github/sanecity/wot/cli/CliException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.cli;
23 |
24 | import io.github.sanecity.wot.ServientException;
25 |
26 | /**
27 | * A CliException is thrown by the {@link Cli} when errors occur.
28 | */
29 | class CliException extends ServientException {
30 | public CliException(String message) {
31 | super(message);
32 | }
33 |
34 | public CliException(Throwable cause) {
35 | super(cause);
36 | }
37 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/RefCountResourceException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity;
23 |
24 | /**
25 | * A RefCountResourceException is thrown by the {@link RefCountResource} when errors occur.
26 | */
27 | public class RefCountResourceException extends Exception {
28 | public RefCountResourceException(String message) {
29 | super(message);
30 | }
31 |
32 | public RefCountResourceException(Throwable cause) {
33 | super(cause);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/wot-servient-binding-mqtt/src/main/java/io/github/sanecity/wot/binding/mqtt/MqttProtocolException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.binding.mqtt;
23 |
24 | /**
25 | * A MqttProtocolException is thrown by mqtt binding when errors occur.
26 | */
27 | class MqttProtocolException extends Exception {
28 | public MqttProtocolException(String message) {
29 | super(message);
30 | }
31 |
32 | public MqttProtocolException(Throwable cause) {
33 | super(cause);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/WotException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot;
23 |
24 | /**
25 | * A WotException is thrown by {@link Wot} implementations when errors occur.
26 | */
27 | public class WotException extends Exception {
28 | public WotException(String message) {
29 | super(message);
30 | }
31 |
32 | public WotException(Throwable cause) {
33 | super(cause);
34 | }
35 |
36 | public WotException() {
37 | super();
38 | }
39 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/NoClientFactoryForSchemesConsumedThingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.thing;
23 |
24 | import java.util.Set;
25 |
26 | @SuppressWarnings({ "java:S110" })
27 | class NoClientFactoryForSchemesConsumedThingException extends ConsumedThingException {
28 | public NoClientFactoryForSchemesConsumedThingException(String title, Set schemes) {
29 | super("'" + title + "': Missing ClientFactory for schemes '" + schemes + "'");
30 | }
31 | }
--------------------------------------------------------------------------------
/coverage-jacoco.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | #
5 | # Copyright (c) 2019-2022 Heiko Bornholdt
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy
8 | # of this software and associated documentation files (the "Software"), to deal
9 | # in the Software without restriction, including without limitation the rights
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | # copies of the Software, and to permit persons to whom the Software is
12 | # furnished to do so, subject to the following conditions:
13 | #
14 | # The above copyright notice and this permission notice shall be included in all
15 | # copies or substantial portions of the Software.
16 | #
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23 | # OR OTHER DEALINGS IN THE SOFTWARE.
24 | #
25 | inputs=""
26 | for D in *; do
27 | if [ -d "${D}" ]; then
28 | jac="$D/target/site/jacoco/jacoco.csv"
29 | if [ -f "$jac" ]; then
30 | inputs="$inputs $jac"
31 | fi
32 | fi
33 | done
34 |
35 | # sum csv values and output as:
36 | # 10 / 20 instructions covered
37 | # 50,00 % covered
38 | awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% covered" }' $inputs
39 |
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/ServientException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot;
23 |
24 | /**
25 | * A ServientException is thrown by the {@link Servient} when errors occur.
26 | */
27 | public class ServientException extends WotException {
28 | public ServientException(String message) {
29 | super(message);
30 | }
31 |
32 | public ServientException(Throwable cause) {
33 | super(cause);
34 | }
35 |
36 | public ServientException() {
37 | super();
38 | }
39 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/content/ContentCodecException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.content;
23 |
24 | import io.github.sanecity.wot.ServientException;
25 |
26 | /**
27 | * If errors occur during (de)serialization, this exception is thrown.
28 | */
29 | public class ContentCodecException extends ServientException {
30 | public ContentCodecException(String message) {
31 | super(message);
32 | }
33 |
34 | public ContentCodecException(Throwable cause) {
35 | super(cause);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/wot-servient/src/test/java/io/github/sanecity/wot/thing/schema/NullSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.thing.schema;
23 |
24 | import org.junit.jupiter.api.Test;
25 |
26 | import static org.junit.jupiter.api.Assertions.assertEquals;
27 |
28 | public class NullSchemaTest {
29 | @Test
30 | public void getType() {
31 | assertEquals("null", new NullSchema().getType());
32 | }
33 |
34 | @Test
35 | public void getClassType() {
36 | assertEquals(Object.class, new NullSchema().getClassType());
37 | }
38 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/ConsumedThingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.thing;
23 |
24 | import io.github.sanecity.wot.ServientException;
25 |
26 | /**
27 | * A ConsumedThingException is thrown by {@link ConsumedThing} when errors occur.
28 | */
29 | public class ConsumedThingException extends ServientException {
30 | public ConsumedThingException(String message) {
31 | super(message);
32 | }
33 |
34 | public ConsumedThingException(Throwable cause) {
35 | super(cause);
36 | }
37 | }
--------------------------------------------------------------------------------
/wot-servient/src/main/java/io/github/sanecity/wot/thing/filter/ThingQueryException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.thing.filter;
23 |
24 | import io.github.sanecity.wot.ServientException;
25 |
26 | /**
27 | * This exception is thrown when an invalid query is attempted to be used.
28 | */
29 | public class ThingQueryException extends ServientException {
30 | public ThingQueryException(Throwable cause) {
31 | super(cause);
32 | }
33 |
34 | public ThingQueryException(String message) {
35 | super(message);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/wot-servient-binding-coap/src/main/java/io/github/sanecity/wot/binding/coap/resource/EventResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 Heiko Bornholdt
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all
12 | * copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20 | * OR OTHER DEALINGS IN THE SOFTWARE.
21 | */
22 | package io.github.sanecity.wot.binding.coap.resource;
23 |
24 | import io.github.sanecity.wot.thing.event.ExposedThingEvent;
25 |
26 | /**
27 | * Endpoint for interaction with a {@link io.github.sanecity.wot.thing.event.ThingEvent}.
28 | */
29 | public class EventResource extends AbstractSubscriptionResource {
30 | public EventResource(String name, ExposedThingEvent