├── .github
├── auto_assign.yml
└── workflows
│ ├── pr.yml
│ └── release.yml
├── .gitignore
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── LICENSE.txt
├── README.md
├── README_CN.md
├── bin
└── add-zsh-completion-osx.sh
├── checkstyle
└── checkstyle.xml
├── etc
└── license
│ └── license-header-template.txt
├── mvnw
├── mvnw.cmd
├── png
├── toolkit-logo.png
├── toolkit-show_en.gif
└── toolkit-show_zh.gif
├── pom.xml
├── toolkit-app
├── pom.xml
└── src
│ └── main
│ ├── assembly
│ ├── README
│ ├── assembly-java.xml
│ ├── assembly-native-osx.xml
│ └── assembly-native.xml
│ ├── java
│ └── iot
│ │ └── technology
│ │ └── client
│ │ └── toolkit
│ │ └── app
│ │ ├── ToolKitCommand.java
│ │ └── settings
│ │ ├── ConfigCommand.java
│ │ ├── info
│ │ └── MainInfo.java
│ │ └── lang
│ │ └── LangService.java
│ └── resources
│ ├── META-INF
│ └── native-image
│ │ ├── native-image.properties
│ │ └── reflection-config.json
│ └── i18n
│ ├── messages.properties
│ ├── messages_de.properties
│ ├── messages_fr.properties
│ └── messages_zh.properties
├── toolkit-coap
├── pom.xml
└── src
│ └── main
│ └── java
│ └── iot
│ └── technology
│ └── client
│ └── toolkit
│ └── coap
│ ├── command
│ ├── CoapCommand.java
│ └── sub
│ │ ├── AbstractCoapContext.java
│ │ ├── CoapDeleteCommand.java
│ │ ├── CoapDescribeCommand.java
│ │ ├── CoapDiscoverCommand.java
│ │ ├── CoapGetCommand.java
│ │ ├── CoapIdentitySection.java
│ │ ├── CoapMediaTypesCommand.java
│ │ ├── CoapPostCommand.java
│ │ └── CoapPutCommand.java
│ ├── domain
│ ├── AvailableResource.java
│ └── CoapSupportType.java
│ ├── service
│ ├── CoapClientService.java
│ └── DtlsClient.java
│ └── validator
│ └── CoapCommandParamValidator.java
├── toolkit-common
├── pom.xml
└── src
│ └── main
│ └── java
│ └── iot
│ └── technology
│ └── client
│ └── toolkit
│ └── common
│ ├── commandline
│ ├── CommandErrorMessageHandler.java
│ ├── CommandLineConfig.java
│ ├── CommonErrorMessageHandler.java
│ └── ExceptionMessageHandler.java
│ ├── config
│ └── LogLevelConfig.java
│ ├── constants
│ ├── CertTypeEnum.java
│ ├── CertUsageEnum.java
│ ├── CoapCodeEnum.java
│ ├── ConfirmCodeEnum.java
│ ├── EmojiEnum.java
│ ├── ExitCodeEnum.java
│ ├── GlobalConstants.java
│ ├── HelpVersionGroup.java
│ ├── HttpConfig.java
│ ├── HttpStatus.java
│ ├── LangEnum.java
│ ├── MimeType.java
│ ├── MobileSettings.java
│ ├── MqttActionEnum.java
│ ├── MqttBizEnum.java
│ ├── MqttSettingsCodeEnum.java
│ ├── MqttVersionEnum.java
│ ├── NBTypeEnum.java
│ ├── NbActionEnum.java
│ ├── NbIoTHttpConfigEnum.java
│ ├── NbSettingsCodeEnum.java
│ ├── NodeTypeEnum.java
│ ├── OSEnum.java
│ ├── OneNetSettings.java
│ ├── PubData.java
│ ├── SecurityAlgorithm.java
│ ├── StorageConstants.java
│ ├── SubData.java
│ ├── SystemConfigConst.java
│ ├── TelAutoObserverEnum.java
│ ├── TelDeviceStatusEnum.java
│ ├── TelNetStatusEnum.java
│ ├── TelecomSettings.java
│ ├── TopicAndQos.java
│ └── VersionInfo.java
│ ├── http
│ ├── HttpRequestEntity.java
│ ├── HttpRequestExecutor.java
│ └── HttpResponseEntity.java
│ ├── rule
│ ├── NodeContext.java
│ ├── ProcessContext.java
│ ├── TkAbstractProcessor.java
│ ├── TkNode.java
│ └── TkProcessor.java
│ ├── utils
│ ├── Assert.java
│ ├── CollectionUtils.java
│ ├── ColorUtils.java
│ ├── DateUtils.java
│ ├── FileUtils.java
│ ├── JsonUtils.java
│ ├── MimeTypeUtils.java
│ ├── OSUtil.java
│ ├── ObjectUtils.java
│ ├── SignUtils.java
│ ├── StringUtils.java
│ ├── SysLog.java
│ └── security
│ │ ├── CredentialsReader.java
│ │ ├── CredentialsUtil.java
│ │ └── SecurityUtil.java
│ └── validator
│ └── BaseValidator.java
├── toolkit-mqtt
├── pom.xml
└── src
│ └── main
│ └── java
│ └── iot
│ └── technology
│ └── client
│ └── toolkit
│ └── mqtt
│ ├── command
│ ├── MqttCommand.java
│ └── sub
│ │ ├── MqttDescribeCommand.java
│ │ ├── MqttSettingsCommand.java
│ │ └── MqttShellCommand.java
│ ├── config
│ ├── MqttSettings.java
│ ├── MqttSettingsInfo.java
│ └── MqttShellModeDomain.java
│ └── service
│ ├── MqttBizService.java
│ ├── MqttClientCallback.java
│ ├── MqttClientConfig.java
│ ├── MqttSettingService.java
│ ├── MqttSettingsRuleChainProcessor.java
│ ├── MqttShellModeService.java
│ ├── PendingOperation.java
│ ├── core
│ └── MqttClientService.java
│ ├── domain
│ ├── ChannelClosedException.java
│ ├── DisReason.java
│ ├── MqttCallDomain.java
│ ├── MqttConfigSettingsDomain.java
│ ├── MqttConnectResult.java
│ ├── MqttIncomingQos2Publish.java
│ ├── MqttLastWill.java
│ ├── MqttPendingPublish.java
│ ├── MqttPendingSubscription.java
│ ├── MqttPendingUnsubscription.java
│ ├── MqttSettingsListDomain.java
│ └── MqttSubscription.java
│ ├── handler
│ ├── MqttBase64MessageHandler.java
│ ├── MqttChannelHandler.java
│ ├── MqttHandler.java
│ ├── MqttHexMessageHandler.java
│ ├── MqttJsonFormatMessageHandler.java
│ ├── MqttPingHandler.java
│ ├── MqttPubMessageHandler.java
│ ├── MqttSubMessageHandler.java
│ └── RetransmissionHandler.java
│ ├── node
│ ├── AdvancedNode.java
│ ├── AutoReconnectNode.java
│ ├── CaNode.java
│ ├── CertTypeNode.java
│ ├── CleanSessionNode.java
│ ├── ClientCertNode.java
│ ├── ClientIdNode.java
│ ├── ClientKeyNode.java
│ ├── ConnectTimeoutNode.java
│ ├── HostNode.java
│ ├── KeepAliveNode.java
│ ├── LastWillPayloadNode.java
│ ├── LastWillQoSNode.java
│ ├── LastWillRetainNode.java
│ ├── MqttAppConfigNode.java
│ ├── MqttVersionNode.java
│ ├── PasswordNode.java
│ ├── PortNode.java
│ ├── SettingsNameNode.java
│ ├── SslNode.java
│ ├── UsernameNode.java
│ ├── lastWillAndTestamentNode.java
│ └── lastWillTopicNode.java
│ └── processor
│ ├── AddProcessor.java
│ ├── DelProcessor.java
│ ├── HelpProcessor.java
│ ├── ListProcessor.java
│ ├── ShowProcessor.java
│ └── shellmode
│ ├── DisconnectProcessor.java
│ ├── HelpProcessor.java
│ ├── ListProcessor.java
│ ├── MqttProcessContext.java
│ ├── PublishProcessor.java
│ ├── SubscribeProcessor.java
│ └── UnSubscribeProcessor.java
└── toolkit-nbiot
├── pom.xml
└── src
└── main
└── java
└── iot
└── technology
└── client
└── toolkit
└── nb
├── command
├── NbCommand.java
└── sub
│ ├── NbDescribeCommand.java
│ ├── NbSettingsCommand.java
│ └── NbShellModeCommand.java
└── service
├── NbBizService.java
├── NbConfigSettingsDomain.java
├── NbRuleChainProcessor.java
├── lwm2m
├── Lwm2mDeviceService.java
└── domain
│ ├── DtlsSessionLogger.java
│ ├── Lwm2mConfigSetting.java
│ ├── Lwm2mConfigSettingsDomain.java
│ ├── MyDevice.java
│ └── RandomTemperatureSensor.java
├── mobile
├── AbstractMobileService.java
├── MobileDeviceDataService.java
├── OneNetService.java
└── domain
│ ├── BaseOneNetResponse.java
│ ├── MobileConfigDomain.java
│ ├── action
│ ├── data
│ │ ├── OneNetCachedCommandBody.java
│ │ ├── OneNetCachedCommandItem.java
│ │ ├── OneNetCachedCommandResponse.java
│ │ ├── OneNetDeviceHisDataBody.java
│ │ ├── OneNetDeviceHisDataPointsBody.java
│ │ ├── OneNetDeviceHisDataResponse.java
│ │ ├── OneNetDeviceHisDataStreamsBody.java
│ │ ├── OneNetDeviceLatestDataBody.java
│ │ ├── OneNetDeviceLatestDataDevicesBody.java
│ │ ├── OneNetDeviceLatestDataResponse.java
│ │ └── OneNetDeviceLatestDataStreamsBody.java
│ └── device
│ │ ├── OneNetCreateDeviceBody.java
│ │ ├── OneNetCreateDeviceRequest.java
│ │ ├── OneNetCreateDeviceResponse.java
│ │ ├── OneNetDelDeviceBody.java
│ │ ├── OneNetDelDeviceRequest.java
│ │ ├── OneNetDelDeviceResponse.java
│ │ ├── OneNetDeviceDetailBody.java
│ │ ├── OneNetDeviceDetailRequest.java
│ │ ├── OneNetDeviceDetailResponse.java
│ │ ├── OneNetDeviceListRequest.java
│ │ ├── OneNetDeviceListResponse.java
│ │ ├── OneNetDevicePageResponse.java
│ │ ├── OneNetProductBody.java
│ │ ├── OneNetProductResponse.java
│ │ ├── OneNetUpdateDeviceBody.java
│ │ ├── OneNetUpdateDeviceRequest.java
│ │ └── OneNetUpdateDeviceResponse.java
│ └── settings
│ ├── MobProjectSettings.java
│ ├── OneNetDeviceStatusEnum.java
│ └── OneNetRespCodeEnum.java
├── node
├── LwM2MBootstrapServerNode.java
├── LwM2MCertUsageNode.java
├── LwM2MChooseAlgorithmNode.java
├── LwM2MClientCertNode.java
├── LwM2MClientPrivateKeyNode.java
├── LwM2MClientPublicKeyNode.java
├── LwM2MComPeriodNode.java
├── LwM2MDtlsNode.java
├── LwM2MEndpointNode.java
├── LwM2MLifeTimeNode.java
├── LwM2MLocalAddressNode.java
├── LwM2MModelsFolderNode.java
├── LwM2MPortNode.java
├── LwM2MPskIdentityNode.java
├── LwM2MServerCertNode.java
├── LwM2MServerPublicKeyNode.java
├── LwM2MServerUrlNode.java
├── LwM2MShareKeyNode.java
├── MobAccessKeyNode.java
├── MobAppConfigNode.java
├── MobProductIdNode.java
├── MobProductNameNode.java
├── NbLwM2MConfigNode.java
├── NbSettingsNode.java
├── NbTelecomAppConfigNode.java
├── NbTypeNode.java
├── TelApiKeyNode.java
├── TelAppKeyNode.java
├── TelAppSecretNode.java
└── TelProductIdNode.java
├── processor
├── Lwm2mBizService.java
├── Lwm2mProcessContext.java
├── MobProcessContext.java
├── MobileBizService.java
├── NbSettingsContext.java
├── TelProcessContext.java
├── TelecomBizService.java
├── lwm2m
│ ├── LwM2MCreateProcessor.java
│ ├── LwM2MDeleteProcessor.java
│ ├── LwM2MHelpProcessor.java
│ ├── LwM2MListProcessor.java
│ ├── LwM2MSendProcessor.java
│ └── LwM2MUpdateProcessor.java
├── mobile
│ ├── OneNetAddDeviceProcessor.java
│ ├── OneNetCommandDataDeviceProcessor.java
│ ├── OneNetCurrentLogDeviceDataProcessor.java
│ ├── OneNetDelDeviceProcessor.java
│ ├── OneNetHelpProcessor.java
│ ├── OneNetHistoryLogDeviceDataProcessor.java
│ ├── OneNetListProcessor.java
│ ├── OneNetShowDeviceProcessor.java
│ └── OneNetUpdateDeviceProcessor.java
├── settings
│ ├── NbSettingsAddProcessor.java
│ ├── NbSettingsDelProcessor.java
│ ├── NbSettingsHelpProcessor.java
│ ├── NbSettingsListProcessor.java
│ └── NbSettingsShowProcessor.java
└── telecom
│ ├── TelAddDeviceProcessor.java
│ ├── TelCommandDataDeviceProcessor.java
│ ├── TelDelDeviceByImeiProcessor.java
│ ├── TelHelpProcessor.java
│ ├── TelListDeviceProcessor.java
│ ├── TelLogDeviceDataProcessor.java
│ ├── TelShowDeviceByImeiProcessor.java
│ └── TelUpdateDeviceProcessor.java
└── telecom
├── AbstractTelecomService.java
├── TelecomDeviceDataService.java
├── TelecomDeviceService.java
├── TelecomProductService.java
└── domain
├── BaseTelResponse.java
├── TelecomConfigDomain.java
├── action
├── data
│ ├── TelQueryDeviceCommandBody.java
│ ├── TelQueryDeviceCommandListBody.java
│ ├── TelQueryDeviceCommandListResponse.java
│ ├── TelQueryDeviceDataListResponse.java
│ └── TelQueryDeviceDataTotalResponse.java
├── device
│ ├── TelAddDeviceRequest.java
│ ├── TelBatchAddDeviceBody.java
│ ├── TelBatchAddDeviceRequest.java
│ ├── TelBatchAddDeviceResponse.java
│ ├── TelDelDeviceByImeiRequest.java
│ ├── TelDelDeviceByImeiResponse.java
│ ├── TelDeviceBody.java
│ ├── TelQueryDeviceByImeiBody.java
│ ├── TelQueryDeviceByImeiResponse.java
│ ├── TelQueryDeviceListBody.java
│ ├── TelQueryDeviceListResponse.java
│ ├── TelUpdateDeviceOtherRequest.java
│ ├── TelUpdateDeviceRequest.java
│ └── TelUpdateDeviceResponse.java
└── product
│ ├── TelDeleteProductResponse.java
│ ├── TelQueryProductResponse.java
│ └── TelQueryProductResponseBody.java
└── settings
└── TelProjectSettings.java
/.github/auto_assign.yml:
--------------------------------------------------------------------------------
1 | ---
2 | addReviewers: true
3 | addAssignees: author
4 |
5 | reviewers:
6 | - sanshengshui
7 |
8 | numberOfReviewers: 0
--------------------------------------------------------------------------------
/.github/workflows/pr.yml:
--------------------------------------------------------------------------------
1 | name: Pull Requests
2 | on: pull_request_target
3 |
4 | jobs:
5 | # Build native executable per runner
6 | build:
7 | name: 'Build with Graal on ${{ matrix.os }}'
8 | strategy:
9 | fail-fast: false
10 | matrix:
11 | os: [ ubuntu-latest, macos-latest, windows-latest ]
12 | runs-on: ${{ matrix.os }}
13 | timeout-minutes: 90
14 |
15 | steps:
16 | - name: 'Check out repository'
17 | uses: actions/checkout@v3
18 |
19 | - name: Install upx in Linux
20 | run: sudo apt-get install upx
21 | if: ${{ runner.os == 'Linux' }}
22 |
23 | - name: Install upx in macOS
24 | run: brew install upx
25 | if: ${{ runner.os == 'macOS' }}
26 |
27 | - name: Install upx in Windows
28 | run: choco install upx
29 | if: ${{ runner.os == 'Windows' }}
30 |
31 | - name: 'Set up Graal'
32 | uses: graalvm/setup-graalvm@v1
33 | with:
34 | distribution: 'graalvm-community'
35 | java-version: '21'
36 | github-token: ${{ secrets.GITHUB_TOKEN }}
37 |
38 | - name: 'Cache Maven packages'
39 | uses: actions/cache@v3
40 | with:
41 | path: ~/.m2
42 | key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
43 | restore-keys: ${{ runner.os }}-m2
44 |
45 | - name: 'Create distribution'
46 | run: mvn -B --file pom.xml -Pnative -pl iot.technology:toolkit-app package -am
47 |
48 | - name: 'Smoke test'
49 | run: >
50 | ./toolkit-app/target/toolkit -V
51 |
52 | create_pr:
53 | runs-on: ubuntu-latest
54 | steps:
55 | - name: 'Auto assign'
56 | uses: kentaro-m/auto-assign-action@v1.1.2
57 | with:
58 | configuration-path: ".github/auto_assign.yml"
59 |
60 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
39 | /.idea/
40 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IoT-Technology/IoT-Toolkit/71ce6a23d7532232a5b6438704e59c2f594b820d/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
19 |
--------------------------------------------------------------------------------
/bin/add-zsh-completion-osx.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Copyright © 2019-2025 The Toolkit Authors
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 |
19 | set -euo pipefail
20 |
21 | cp $1/$2 $1/_toolkit
22 |
23 | ZSH_SHIM="
24 | compopt() {
25 | complete \$@
26 | }
27 |
28 | _complete_toolkit
29 | "
30 |
31 | echo "$ZSH_SHIM" >> $1/_toolkit
32 |
--------------------------------------------------------------------------------
/etc/license/license-header-template.txt:
--------------------------------------------------------------------------------
1 | Copyright © ${project.inceptionYear}-2025 ${owner}
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/png/toolkit-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IoT-Technology/IoT-Toolkit/71ce6a23d7532232a5b6438704e59c2f594b820d/png/toolkit-logo.png
--------------------------------------------------------------------------------
/png/toolkit-show_en.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IoT-Technology/IoT-Toolkit/71ce6a23d7532232a5b6438704e59c2f594b820d/png/toolkit-show_en.gif
--------------------------------------------------------------------------------
/png/toolkit-show_zh.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IoT-Technology/IoT-Toolkit/71ce6a23d7532232a5b6438704e59c2f594b820d/png/toolkit-show_zh.gif
--------------------------------------------------------------------------------
/toolkit-app/src/main/assembly/README:
--------------------------------------------------------------------------------
1 | This is the CLI version of [toolkit][1].
2 |
3 | Use
4 |
5 | ./bin/toolkit -h
6 |
7 | on a Unix like machine for usage instructions and
8 |
9 | ./bin/toolkit.bat -h
10 |
11 | on Windows.
12 |
13 | [1]: https://github.com/IoT-Technology/IoT-Toolkit
14 |
--------------------------------------------------------------------------------
/toolkit-app/src/main/assembly/assembly-java.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | dist
24 |
25 | zip
26 |
27 |
28 |
29 | ${project.parent.basedir}/LICENSE.txt
30 | LICENSE
31 |
32 |
33 |
34 | src/main/assembly/README
35 |
36 |
37 |
38 | ${project.build.directory}/toolkit_completion
39 | completion
40 |
41 |
42 |
43 |
44 | ${project.build.directory}/assembly
45 |
46 |
47 |
48 | ${project.build.directory}/assembly/bin
49 | bin
50 | 744
51 |
52 |
53 |
--------------------------------------------------------------------------------
/toolkit-app/src/main/assembly/assembly-native-osx.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | dist
24 |
25 | zip
26 |
27 |
28 |
29 | ${project.parent.basedir}/LICENSE.txt
30 | LICENSE
31 |
32 |
33 |
34 | src/main/assembly/README
35 |
36 |
37 |
38 | ${project.build.directory}/toolkit_completion
39 | completion
40 |
41 |
42 | ${project.build.directory}/_toolkit
43 | _toolkit
44 | completion/zsh
45 |
46 |
47 | ${project.build.directory}/toolkit${executable-suffix}
48 | ./bin
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/toolkit-app/src/main/assembly/assembly-native.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | dist
24 |
25 | zip
26 |
27 |
28 |
29 | ${project.parent.basedir}/LICENSE.txt
30 | LICENSE
31 |
32 |
33 |
34 | src/main/assembly/README
35 |
36 |
37 |
38 | ${project.build.directory}/toolkit_completion
39 | completion
40 |
41 |
42 | ${project.build.directory}/toolkit${executable-suffix}
43 | ./bin
44 |
45 |
46 |
--------------------------------------------------------------------------------
/toolkit-app/src/main/resources/META-INF/native-image/native-image.properties:
--------------------------------------------------------------------------------
1 | Args = -H:ReflectionConfigurationResources=${.}/reflection-config.json \
2 | -H:IncludeResources=.*/*.xml$ \
3 | -H:IncludeLocales=zh,en,de,fr \
4 | --initialize-at-run-time=io.netty.buffer.AbstractReferenceCountedByteBuf \
5 | --initialize-at-run-time=io.netty.buffer.ByteBufAllocator \
6 | --initialize-at-run-time=io.netty.buffer.ByteBufUtil \
7 | --initialize-at-run-time=io.netty.buffer.ByteBufUtil$HexUtil \
8 | --initialize-at-run-time=io.netty.buffer.PooledByteBufAllocator \
9 | --initialize-at-run-time=io.netty.buffer.UnpooledHeapByteBuf \
10 | --initialize-at-run-time=io.netty.buffer.UnreleasableByteBuf \
11 | --initialize-at-run-time=io.netty.util.AbstractReferenceCounted \
12 | --initialize-at-run-time=io.netty.util.internal.ThreadLocalRandom \
13 | --initialize-at-run-time=io.netty.util.concurrent.GlobalEventExecutor \
14 | --initialize-at-run-time=io.netty.util.concurrent.ImmediateEventExecutor \
15 | --initialize-at-run-time=io.netty.util.concurrent.ScheduledFutureTask \
16 | --initialize-at-run-time=org.eclipse.leshan.client.resource.ObjectsInitializer \
17 | -Dio.netty.noUnsafe=true \
18 | -Dio.netty.leakDetection.level=DISABLED
--------------------------------------------------------------------------------
/toolkit-app/src/main/resources/i18n/messages_de.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IoT-Technology/IoT-Toolkit/71ce6a23d7532232a5b6438704e59c2f594b820d/toolkit-app/src/main/resources/i18n/messages_de.properties
--------------------------------------------------------------------------------
/toolkit-app/src/main/resources/i18n/messages_fr.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IoT-Technology/IoT-Toolkit/71ce6a23d7532232a5b6438704e59c2f594b820d/toolkit-app/src/main/resources/i18n/messages_fr.properties
--------------------------------------------------------------------------------
/toolkit-coap/pom.xml:
--------------------------------------------------------------------------------
1 |
18 |
21 | 4.0.0
22 |
23 | iot-toolkit
24 | iot.technology
25 | 0.7.6
26 |
27 |
28 |
29 | IoT Technology ToolKit CoAP
30 | toolkit-coap
31 | jar
32 |
33 |
34 | 21
35 | 21
36 |
37 |
38 |
39 |
40 | iot.technology
41 | toolkit-common
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/toolkit-coap/src/main/java/iot/technology/client/toolkit/coap/command/sub/AbstractCoapContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.coap.command.sub;
17 |
18 | import iot.technology.client.toolkit.common.utils.Assert;
19 |
20 | import java.net.URI;
21 | import java.util.Objects;
22 |
23 | /**
24 | * @author mushuwei
25 | */
26 | public abstract class AbstractCoapContext {
27 |
28 | public static final String COAPS = "coaps";
29 | public static final String COAP = "coap";
30 |
31 |
32 | public static String validateUri(URI uri) {
33 | Assert.isTrue(uri != null, "Null URI");
34 | Assert.hasText(Objects.requireNonNull(uri).getScheme(), "Missing CoAP URI schema! Either `coap:` or `coaps:` is required.");
35 | Assert.isTrue(uri.getScheme().equalsIgnoreCase(COAP)
36 | || uri.getScheme().equalsIgnoreCase(COAPS), String.format("Invalid CoAP URI schema [%s]. " +
37 | "Use either `coap:` or `coaps:`", uri.getScheme()));
38 | return uri.getScheme();
39 | }
40 |
41 | public static String validatePayloadAndFile(String payload) {
42 | Assert.hasText(payload, "Missing payload");
43 | return payload;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/toolkit-coap/src/main/java/iot/technology/client/toolkit/coap/command/sub/CoapDescribeCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.coap.command.sub;
17 |
18 | import iot.technology.client.toolkit.coap.service.CoapClientService;
19 | import iot.technology.client.toolkit.common.constants.ExitCodeEnum;
20 | import picocli.CommandLine;
21 |
22 | import java.util.concurrent.Callable;
23 |
24 | /**
25 | * @author mushuwei
26 | */
27 | @CommandLine.Command(
28 | name = "describe",
29 | aliases = "desc",
30 | requiredOptionMarker = '*',
31 | description = "@|fg(red),bold ${bundle:coap.desc.description}|@",
32 | synopsisHeading = "%n@|bold ${bundle:general.usage}|@%n",
33 | commandListHeading = "%n@|bold ${bundle:general.commands}|@%n",
34 | optionListHeading = "%n@|bold ${bundle:general.option}|@%n",
35 | descriptionHeading = "%n",
36 | footerHeading = "%nCopyright (c) 2019-2025, ${bundle:general.copyright}",
37 | footer = "%nDeveloped by mushuwei"
38 | )
39 | public class CoapDescribeCommand implements Callable {
40 |
41 | private final CoapClientService coapClientService = new CoapClientService();
42 |
43 |
44 | @CommandLine.Option(names = {"-h", "--help"}, usageHelp = true, description = "${bundle:general.help.description}")
45 | boolean usageHelpRequested;
46 |
47 |
48 | @Override
49 | public Integer call() {
50 | coapClientService.getCoapDescription();
51 | return ExitCodeEnum.SUCCESS.getValue();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/toolkit-coap/src/main/java/iot/technology/client/toolkit/coap/domain/AvailableResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.coap.domain;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public class AvailableResource {
22 |
23 | private String rowNum;
24 |
25 | private String path;
26 |
27 | private String resourceType;
28 |
29 | private String contentType;
30 |
31 | public String getPath() {
32 | return path;
33 | }
34 |
35 | public void setPath(String path) {
36 | this.path = path;
37 | }
38 |
39 | public String getResourceType() {
40 | return resourceType;
41 | }
42 |
43 | public void setResourceType(String resourceType) {
44 | this.resourceType = resourceType;
45 | }
46 |
47 | public String getContentType() {
48 | return contentType;
49 | }
50 |
51 | public void setContentType(String contentType) {
52 | this.contentType = contentType;
53 | }
54 |
55 | public String getRowNum() {
56 | return rowNum;
57 | }
58 |
59 | public void setRowNum(String rowNum) {
60 | this.rowNum = rowNum;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/toolkit-coap/src/main/java/iot/technology/client/toolkit/coap/domain/CoapSupportType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.coap.domain;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public class CoapSupportType {
22 |
23 | private String rowName;
24 |
25 | private String typeId;
26 |
27 | private String typeName;
28 |
29 | public String getTypeId() {
30 | return typeId;
31 | }
32 |
33 | public void setTypeId(String typeId) {
34 | this.typeId = typeId;
35 | }
36 |
37 | public String getTypeName() {
38 | return typeName;
39 | }
40 |
41 | public void setTypeName(String typeName) {
42 | this.typeName = typeName;
43 | }
44 |
45 | public String getRowName() {
46 | return rowName;
47 | }
48 |
49 | public void setRowName(String rowName) {
50 | this.rowName = rowName;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/toolkit-coap/src/main/java/iot/technology/client/toolkit/coap/validator/CoapCommandParamValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.coap.validator;
17 |
18 | import iot.technology.client.toolkit.common.utils.Assert;
19 | import iot.technology.client.toolkit.common.validator.BaseValidator;
20 |
21 | import java.net.URI;
22 | import java.util.Objects;
23 |
24 | /**
25 | * @author mushuwei
26 | */
27 | public class CoapCommandParamValidator extends BaseValidator {
28 |
29 | public static final String COAPS = "coaps";
30 | public static final String COAP = "coap";
31 |
32 | public static void validateUri(URI uri) {
33 | Assert.isTrue(uri != null, "Null URI");
34 | Assert.hasText(Objects.requireNonNull(uri).getScheme(), "Missing CoAP URI schema! Either `coap:` or `coaps:` is required.");
35 | Assert.isTrue(uri.getScheme().equalsIgnoreCase(COAP)
36 | || uri.getScheme().equalsIgnoreCase(COAPS), String.format("Invalid CoAP URI schema [%s]. " +
37 | "Use either `coap:` or `coaps:`", uri.getScheme()));
38 | }
39 |
40 | public static String validatePayloadAndFile(String payload) {
41 | Assert.hasText(payload, "Missing payload");
42 | return payload;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/commandline/CommandErrorMessageHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.commandline;
17 |
18 | import picocli.CommandLine;
19 |
20 | import java.io.PrintWriter;
21 |
22 | /**
23 | * @author mushuwei
24 | */
25 | public class CommandErrorMessageHandler extends CommonErrorMessageHandler
26 | implements CommandLine.IParameterExceptionHandler {
27 |
28 | @Override
29 | public int handleParseException(CommandLine.ParameterException ex, String[] args) throws Exception {
30 | final int exitCode = super.handleParseException(ex, args);
31 | final CommandLine cmd = ex.getCommandLine();
32 | final PrintWriter writer = cmd.getErr();
33 | final CommandLine.Model.CommandSpec spec = cmd.getCommandSpec();
34 | writer.printf("Try '%s --help' for more information.%n", spec.qualifiedName());
35 | return exitCode;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/commandline/CommandLineConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.commandline;
17 |
18 | import picocli.CommandLine;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class CommandLineConfig {
24 |
25 | private final static CommandLine.Help.ColorScheme COLOR_SCHEME =
26 | new CommandLine.Help.ColorScheme.Builder(CommandLine.Help.Ansi.AUTO)
27 | .commands(CommandLine.Help.Ansi.Style.bold, CommandLine.Help.Ansi.Style.fg_yellow)
28 | .options(CommandLine.Help.Ansi.Style.italic, CommandLine.Help.Ansi.Style.fg_yellow)
29 | .parameters(CommandLine.Help.Ansi.Style.fg_yellow)
30 | .optionParams(CommandLine.Help.Ansi.Style.italic)
31 | .errors(CommandLine.Help.Ansi.Style.bold, CommandLine.Help.Ansi.Style.fg_red)
32 | .build();
33 | private static final int CLI_WIDTH = 160;
34 |
35 | public CommandLineConfig() {
36 | }
37 |
38 | public static CommandLine.Help.ColorScheme getColorScheme() {
39 | return COLOR_SCHEME;
40 | }
41 |
42 | public static int getCliWidth() {
43 | return CLI_WIDTH;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/commandline/ExceptionMessageHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.commandline;
17 |
18 | import picocli.CommandLine;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class ExceptionMessageHandler implements CommandLine.IExecutionExceptionHandler {
24 |
25 | @Override
26 | public int handleExecutionException(Exception ex, CommandLine cmd, CommandLine.ParseResult parseResult) {
27 | cmd.getErr().println(cmd.getColorScheme().errorText(ex.getMessage()));
28 |
29 | return cmd.getExitCodeExceptionMapper() != null
30 | ? cmd.getExitCodeExceptionMapper().getExitCode(ex)
31 | : cmd.getCommandSpec().exitCodeOnExecutionException();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/config/LogLevelConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.config;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public class LogLevelConfig {
22 |
23 | // log level
24 | public static void setLogLevel() {
25 | System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "ERROR");
26 | System.setProperty("org.slf4j.simpleLogger.log.org.eclipse.californium", "ERROR");
27 | System.setProperty("org.slf4j.simpleLogger.log.org.eclipse.californium.scandium", "ERROR");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/CertTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum CertTypeEnum {
22 |
23 | CA_SIGNED_SERVER("1", "CA signed server"),
24 |
25 | SELF_SIGNED("2", "Self signed");
26 |
27 | private String value;
28 |
29 | private String desc;
30 |
31 | public String getValue() {
32 | return value;
33 | }
34 |
35 | public String getDesc() {
36 | return desc;
37 | }
38 |
39 | CertTypeEnum(String value, String desc) {
40 | this.value = value;
41 | this.desc = desc;
42 | }
43 |
44 | public static CertTypeEnum getCertTypeEnum(String value) {
45 | for (CertTypeEnum elem : CertTypeEnum.values()) {
46 | if (elem.getValue().equals(value)) {
47 | return elem;
48 | }
49 | }
50 | return null;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/CertUsageEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum CertUsageEnum {
22 |
23 | CA("0", "CA constraint"),
24 |
25 | SERVICE_CERT("1", "service certificate constraint"),
26 |
27 | TRUST_ANCHOR_ASSERTION("2", "trust anchor assertion"),
28 |
29 | DOMAIN_ISSUED_CERT("3", "domain issued certificate (Default value)");
30 |
31 |
32 | private String code;
33 |
34 | private String value;
35 |
36 | CertUsageEnum(String code, String value) {
37 | this.code = code;
38 | this.value = value;
39 | }
40 |
41 | public String getCode() {
42 | return code;
43 | }
44 |
45 | public String getValue() {
46 | return value;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/CoapCodeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum CoapCodeEnum {
22 | HELP("help", "iot.technology.client.toolkit.coap.service.node.HelpProcessor");
23 |
24 | private String code;
25 |
26 | private String clazzName;
27 |
28 | public String getCode() {
29 | return code;
30 | }
31 |
32 | public String getClazzName() {
33 | return clazzName;
34 | }
35 |
36 | CoapCodeEnum(String code, String clazzName) {
37 | this.code = code;
38 | this.clazzName = clazzName;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/ConfirmCodeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum ConfirmCodeEnum {
22 |
23 | YES("Y", "YES"),
24 |
25 | NO("N", "NO");
26 |
27 | private String value;
28 |
29 | private String desc;
30 |
31 | public String getValue() {
32 | return value;
33 | }
34 |
35 | public String getDesc() {
36 | return desc;
37 | }
38 |
39 | ConfirmCodeEnum(String value, String desc) {
40 | this.value = value;
41 | this.desc = desc;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/EmojiEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public interface EmojiEnum {
22 |
23 | String successEmoji = "\u2705";
24 |
25 | String errorEmoji = "\u2716";
26 |
27 | String smileEmoji = "\uD83D\uDE04";
28 |
29 | String pensiveEmoji = "\uD83D\uDE14";
30 |
31 | String subscribeEmoji = "\uD83D\uDCDD";
32 |
33 | String disconnectEmoji = "\uD83D\uDEAB";
34 |
35 | String usedEmoji = "\uD83D\uDD34";
36 |
37 | String unusedEmoji = "\uD83D\uDFE2";
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/ExitCodeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum ExitCodeEnum {
22 |
23 | SUCCESS(200, "SUCCESS"),
24 |
25 | NOTEND(201, "don't kill jvm"),
26 |
27 | ERROR(400, "ERROR");
28 |
29 | private int value;
30 |
31 | private String desc;
32 |
33 | ExitCodeEnum(int value, String desc) {
34 | this.value = value;
35 | this.desc = desc;
36 | }
37 |
38 | public int getValue() {
39 | return value;
40 | }
41 |
42 | public String getDesc() {
43 | return desc;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/GlobalConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public interface GlobalConstants {
22 |
23 | String promptSeparator = " > ";
24 |
25 | String promptSuffix = ".prompt";
26 |
27 | String prePrompt = ".prePrompt";
28 | }
29 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/HelpVersionGroup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | import picocli.CommandLine;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class HelpVersionGroup {
24 |
25 | @CommandLine.Option(names = {"-V", "--version"}, versionHelp = true, description = "${bundle:general.version.description}")
26 | boolean versionInfoRequested;
27 |
28 | @CommandLine.Option(names = {"-h", "--help"}, usageHelp = true, description = "${bundle:general.help.description}")
29 | boolean usageHelpRequested;
30 | }
31 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/LangEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum LangEnum {
22 |
23 | EN("en", "english"),
24 |
25 | ZH("zh", "chinese"),
26 |
27 | FR("fr", "french"),
28 |
29 | DE("de", "german");
30 |
31 | private String value;
32 |
33 | private String desc;
34 |
35 |
36 | LangEnum(String value, String desc) {
37 | this.value = value;
38 | this.desc = desc;
39 | }
40 |
41 | public String getValue() {
42 | return value;
43 | }
44 |
45 | public String getDesc() {
46 | return desc;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/MobileSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public interface MobileSettings {
22 |
23 | String MOBILE_AUTH_VERSION = "2018-10-31";
24 | String MOBILE_AUTH_RES_PREFIX = "products/";
25 | String MOBILE_AUTH_METHOD = "sha256";
26 | String MOBILE_AUTH_HEADER = "Authorization";
27 | String MOBILE_IMEI = "imei";
28 |
29 |
30 | String MOBILE_ROOT_URL = "https://api.heclouds.com";
31 | String MOBILE_DEVICE_URL = MOBILE_ROOT_URL + "/devices";
32 | String MOBILE_CACHED_COMMAND_LIST = MOBILE_ROOT_URL + "/nbiot/offline/history";
33 |
34 | String MOBILE_DELETE_DEVICE_BY_IMEI = MOBILE_DEVICE_URL + "/getbyimei";
35 | String MOBILE_DATA_POINTS = MOBILE_DEVICE_URL + "/datapoints";
36 | }
37 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/MqttActionEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum MqttActionEnum {
22 |
23 | PUB("pub"),
24 |
25 | SUB("sub"),
26 |
27 | UNSUB("unsub"),
28 |
29 | LIST("list"),
30 |
31 | DIS("dis"),
32 | ;
33 |
34 | MqttActionEnum(String value) {
35 | this.value = value;
36 | }
37 |
38 | private String value;
39 |
40 | public String getValue() {
41 | return value;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/MqttBizEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum MqttBizEnum {
22 |
23 | PUB("pub", "publish"),
24 |
25 | SUB("sub", "subscribe");
26 |
27 | private String value;
28 |
29 | private String desc;
30 |
31 | public String getValue() {
32 | return value;
33 | }
34 |
35 | public String getDesc() {
36 | return desc;
37 | }
38 |
39 | MqttBizEnum(String value, String desc) {
40 | this.value = value;
41 | this.desc = desc;
42 | }
43 |
44 | public static MqttBizEnum getBizEnum(String value) {
45 | for (MqttBizEnum elem : MqttBizEnum.values()) {
46 | if (elem.getValue().equals(value)) {
47 | return elem;
48 | }
49 | }
50 | return null;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/MqttVersionEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum MqttVersionEnum {
22 | MQTT_3_1("1", "3.1"),
23 |
24 | MQTT_3_1_1("2", "3.1.1"),
25 |
26 | MQTT_5_0("3", "5.0");
27 |
28 | private String code;
29 |
30 | private String value;
31 |
32 | MqttVersionEnum(String code, String value) {
33 | this.code = code;
34 | this.value = value;
35 | }
36 |
37 | public String getCode() {
38 | return code;
39 | }
40 |
41 | public String getValue() {
42 | return value;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/NBTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | public enum NBTypeEnum {
19 |
20 | TELECOM("1", "telecom"),
21 |
22 | MOBILE("2", "mobile"),
23 |
24 | LWM2M("3", "lwm2m");
25 |
26 | NBTypeEnum(String code, String value) {
27 | this.code = code;
28 | this.value = value;
29 | }
30 |
31 | private String code;
32 |
33 | private String value;
34 |
35 | public String getCode() {
36 | return code;
37 | }
38 |
39 | public String getValue() {
40 | return value;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/NbActionEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum NbActionEnum {
22 | LIST("list"),
23 |
24 | ADD("add"),
25 |
26 | COMMAND("command"),
27 |
28 | DELETE("del"),
29 |
30 | SHOW("show"),
31 |
32 | LOG("log"),
33 |
34 | UPDATE("update")
35 | ;
36 |
37 | NbActionEnum(String value) {
38 | this.value = value;
39 | }
40 |
41 | private String value;
42 |
43 | public String getValue() {
44 | return value;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/NodeTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum NodeTypeEnum {
22 |
23 | MQTT_DEFAULT("mqtt_default"),
24 |
25 | MQTT_SETTINGS("mqtt_settings");
26 |
27 | private final String type;
28 |
29 | NodeTypeEnum(String type) {
30 | this.type = type;
31 | }
32 |
33 | public String getType() {
34 | return type;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/OSEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum OSEnum {
22 |
23 | WINDOWS, LINUX, MAC
24 | }
25 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/OneNetSettings.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.common.constants;
2 |
3 |
4 | public interface OneNetSettings {
5 |
6 | String AUTH_VERSION = "2022-05-01";
7 | String AUTH_RES_PREFIX = "products/";
8 | String AUTH_METHOD = "sha256";
9 | String AUTH_HEADER = "Authorization";
10 |
11 | String ROOT_URL = "https://iot-api.heclouds.com";
12 | String DEVICE_URL = ROOT_URL + "/device";
13 | String PRODUCT_URL = ROOT_URL + "/product";
14 | String COMMAND_URL = ROOT_URL + "/nb-iot";
15 | String DATAPOINT_URL = ROOT_URL + "/datapoint";
16 |
17 | String ADD_DEVICE_URL = DEVICE_URL + "/create";
18 | String DETAIL_DEVICE_URL = DEVICE_URL + "/detail";
19 | String DELETE_DEVICE_URL = DEVICE_URL + "/delete";
20 | String UPDATE_DEVICE_URL = DEVICE_URL + "/update";
21 | String LIST_DEVICE_URL = DEVICE_URL + "/list";
22 |
23 | String PRODUCT_DETAIL_URL = PRODUCT_URL + "/detail";
24 |
25 | String OFFLINE_COMMAND_URL = COMMAND_URL + "/offline";
26 | String HISTORY_OFFLINE_COMMAND_URL = OFFLINE_COMMAND_URL + "/history";
27 |
28 | String CURRENT_DATA_POINTS_URL = DATAPOINT_URL + "/current-datapoints";
29 | String HISTORY_DATA_POINTS_URL = DATAPOINT_URL + "/history-datapoints";
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/SecurityAlgorithm.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public enum SecurityAlgorithm {
22 |
23 | PSK("psk", "Pre-Shared Key"),
24 |
25 | RPK("rpk", "Raw Public Key"),
26 |
27 | X509("x509", "X.509 Certificate");
28 |
29 | private String code;
30 |
31 | private String value;
32 |
33 | SecurityAlgorithm(String code, String value) {
34 | this.code = code;
35 | this.value = value;
36 | }
37 |
38 | public String getCode() {
39 | return code;
40 | }
41 |
42 | public String getValue() {
43 | return value;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/StorageConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public interface StorageConstants {
22 |
23 |
24 | String LANG_MESSAGES = "i18n.messages";
25 | String TOOLKIT_VERSION = "v0.7.6";
26 | }
27 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/TelAutoObserverEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | import java.util.HashMap;
19 | import java.util.Map;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public enum TelAutoObserverEnum {
25 | SUBSCRIBE(0, "订阅"),
26 | UNSUBSCRIBE(1, "不订阅");
27 |
28 | private final Integer type;
29 |
30 | private final String desc;
31 |
32 | public static final Map cache = new HashMap();
33 |
34 | static {
35 | for (TelAutoObserverEnum type : TelAutoObserverEnum.values()) {
36 | cache.put(type.type, type);
37 | }
38 | }
39 |
40 | public static String type(Integer key) {
41 | TelAutoObserverEnum autoObserverEnum = cache.get(key);
42 | if (autoObserverEnum != null) {
43 | return autoObserverEnum.desc;
44 | }
45 | return null;
46 | }
47 |
48 | TelAutoObserverEnum(Integer type, String desc) {
49 | this.type = type;
50 | this.desc = desc;
51 | }
52 |
53 | public Integer getType() {
54 | return type;
55 | }
56 |
57 | public String getDesc() {
58 | return desc;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/TelDeviceStatusEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | import java.util.HashMap;
19 | import java.util.Map;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public enum TelDeviceStatusEnum {
25 |
26 | REGISTER(0, "已注册"),
27 | ACTIVE(1, "已激活"),
28 | CANCEL(2, "已注销");
29 |
30 | private final Integer type;
31 |
32 | private final String desc;
33 |
34 | public static final Map cache = new HashMap();
35 |
36 | static {
37 | for (TelDeviceStatusEnum type : TelDeviceStatusEnum.values()) {
38 | cache.put(type.type, type);
39 | }
40 | }
41 |
42 | public static String type(Integer key) {
43 | TelDeviceStatusEnum deviceStatusEnum = cache.get(key);
44 | if (deviceStatusEnum != null) {
45 | return deviceStatusEnum.desc;
46 | }
47 | return null;
48 | }
49 |
50 | TelDeviceStatusEnum(Integer type, String desc) {
51 | this.type = type;
52 | this.desc = desc;
53 | }
54 |
55 | public Integer getType() {
56 | return type;
57 | }
58 |
59 | public String getDesc() {
60 | return desc;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/TelNetStatusEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | import java.util.HashMap;
19 | import java.util.Map;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public enum TelNetStatusEnum {
25 |
26 | ONLINE(1, "在线"),
27 | OFFLINE(2, "离线");
28 |
29 | private final Integer type;
30 |
31 | private final String desc;
32 |
33 | public static final Map cache = new HashMap();
34 |
35 | static {
36 | for (TelNetStatusEnum type : TelNetStatusEnum.values()) {
37 | cache.put(type.type, type);
38 | }
39 | }
40 |
41 | public static String type(Integer key) {
42 | TelNetStatusEnum netStatusEnum = cache.get(key);
43 | if (netStatusEnum != null) {
44 | return netStatusEnum.getDesc();
45 | }
46 | return "";
47 | }
48 |
49 | TelNetStatusEnum(Integer type, String desc) {
50 | this.type = type;
51 | this.desc = desc;
52 | }
53 |
54 | public Integer getType() {
55 | return type;
56 | }
57 |
58 | public String getDesc() {
59 | return desc;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/TopicAndQos.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class TopicAndQos implements Serializable {
24 |
25 | private String operation;
26 |
27 | private String topic;
28 |
29 | private int qos = 0;
30 |
31 | private String payload;
32 |
33 | public String getTopic() {
34 | return topic;
35 | }
36 |
37 | public void setTopic(String topic) {
38 | this.topic = topic;
39 | }
40 |
41 | public int getQos() {
42 | return qos;
43 | }
44 |
45 | public void setQos(int qos) {
46 | this.qos = qos;
47 | }
48 |
49 | public String getPayload() {
50 | return payload;
51 | }
52 |
53 | public void setPayload(String payload) {
54 | this.payload = payload;
55 | }
56 |
57 | public String getOperation() {
58 | return operation;
59 | }
60 |
61 | public void setOperation(String operation) {
62 | this.operation = operation;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/constants/VersionInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.constants;
17 |
18 | import picocli.CommandLine;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class VersionInfo implements CommandLine.IVersionProvider {
24 |
25 | @Override
26 | public String [] getVersion() {
27 | String version = StorageConstants.TOOLKIT_VERSION;
28 | return new String[]{
29 | version,
30 | "Picocli " + CommandLine.VERSION,
31 | "JVM: ${java.version} (${java.vendor} ${java.vm.name} ${java.vm.version})",
32 | "OS: ${os.name} ${os.version} ${os.arch}"};
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/http/HttpRequestEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.http;
17 |
18 | import java.io.Serializable;
19 | import java.util.Map;
20 |
21 | public class HttpRequestEntity implements Serializable {
22 |
23 | private String url;
24 | private String type;
25 |
26 | private String json;
27 | private Map headers;
28 | private Map params;
29 |
30 |
31 | public String getUrl() {
32 | return url;
33 | }
34 |
35 | public void setUrl(String url) {
36 | this.url = url;
37 | }
38 |
39 | public String getJson() {
40 | return json;
41 | }
42 |
43 | public void setJson(String json) {
44 | this.json = json;
45 | }
46 |
47 | public Map getHeaders() {
48 | return headers;
49 | }
50 |
51 | public void setHeaders(Map headers) {
52 | this.headers = headers;
53 | }
54 |
55 | public String getType() {
56 | return type;
57 | }
58 |
59 | public void setType(String type) {
60 | this.type = type;
61 | }
62 |
63 | public Map getParams() {
64 | return params;
65 | }
66 |
67 | public void setParams(Map params) {
68 | this.params = params;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/http/HttpResponseEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.http;
17 |
18 | import java.io.Serializable;
19 | import java.util.List;
20 | import java.util.Map;
21 |
22 | public class HttpResponseEntity implements Serializable {
23 |
24 | private String body;
25 |
26 | private Map> multiMap;
27 |
28 | public String getBody() {
29 | return body;
30 | }
31 |
32 | public void setBody(String body) {
33 | this.body = body;
34 | }
35 |
36 | public Map> getMultiMap() {
37 | return multiMap;
38 | }
39 |
40 | public void setMultiMap(Map> multiMap) {
41 | this.multiMap = multiMap;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/rule/NodeContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.rule;
17 |
18 | import java.io.Serializable;
19 | import java.util.List;
20 | import java.util.Map;
21 |
22 | /**
23 | * @author mushuwei
24 | */
25 | public class NodeContext implements Serializable {
26 |
27 | private String data;
28 |
29 | private String type;
30 |
31 | private boolean isCheck;
32 |
33 | private List promptData;
34 |
35 | public String getData() {
36 | return data;
37 | }
38 |
39 | public void setData(String data) {
40 | this.data = data;
41 | }
42 |
43 | public String getType() {
44 | return type;
45 | }
46 |
47 | public void setType(String type) {
48 | this.type = type;
49 | }
50 |
51 | public List getPromptData() {
52 | return promptData;
53 | }
54 |
55 | public void setPromptData(List promptData) {
56 | this.promptData = promptData;
57 | }
58 |
59 | public boolean isCheck() {
60 | return isCheck;
61 | }
62 |
63 | public void setCheck(boolean check) {
64 | isCheck = check;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/rule/ProcessContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.rule;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class ProcessContext implements Serializable {
24 |
25 | private String data;
26 |
27 | public String getData() {
28 | return data;
29 | }
30 |
31 | public void setData(String data) {
32 | this.data = data;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/rule/TkNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.rule;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public interface TkNode {
22 |
23 | void prePrompt(NodeContext context);
24 |
25 | boolean check(NodeContext context);
26 |
27 | String nodePrompt();
28 |
29 | String nextNode(NodeContext context);
30 |
31 | String getValue(NodeContext context);
32 | }
33 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/rule/TkProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.rule;
17 |
18 |
19 | /**
20 | * @author mushuwei
21 | */
22 | public interface TkProcessor {
23 |
24 | boolean supports(ProcessContext context);
25 |
26 | void handle(ProcessContext context);
27 | }
28 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/utils/Assert.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.utils;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public abstract class Assert {
22 |
23 | public static void hasText(String text, String message) {
24 | if (!StringUtils.hasText(text)) {
25 | SysLog.error(message);
26 | }
27 | }
28 |
29 | public static void isTrue(Boolean ql, String message) {
30 | if (!ql) {
31 | SysLog.error(message);
32 | }
33 | }
34 |
35 | public static void notNull(Object object, String message) {
36 | if (object == null) {
37 | SysLog.error(message);
38 | }
39 | }
40 |
41 | public static void hasLength(String text, String message) {
42 | if (!StringUtils.hasLength(text)) {
43 | SysLog.error(message);
44 | }
45 | }
46 |
47 | public static boolean isOnlyOneTrue(boolean... conditions) {
48 | int trueCount = 0;
49 | for (boolean condition : conditions) {
50 | if (condition) {
51 | trueCount++;
52 | if (trueCount > 1) {
53 | return false;
54 | }
55 | }
56 | }
57 | return trueCount == 1;
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/utils/CollectionUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.utils;
17 |
18 | import java.util.List;
19 | import java.util.Map;
20 | import java.util.stream.Collectors;
21 |
22 | /**
23 | * @author mushuwei
24 | */
25 | public class CollectionUtils {
26 |
27 | public static boolean isEmpty(Map, ?> map) {
28 | return (map == null || map.isEmpty());
29 | }
30 |
31 | public static boolean isEmpty(List> list) {
32 | return (list == null || list.isEmpty());
33 | }
34 |
35 | public static String listToString(List list) {
36 | return list.stream().collect(Collectors.joining(", "));
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/utils/OSUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.utils;
17 |
18 | import iot.technology.client.toolkit.common.constants.OSEnum;
19 |
20 | /**
21 | * @author mushuwei
22 | * @description: get the operating system of the host
23 | */
24 | public class OSUtil {
25 |
26 | private static OSEnum osEnum = null;
27 | private static final String operateSys = System.getProperty("os.name").toLowerCase();
28 |
29 | public static OSEnum getOS() {
30 | if (operateSys.contains("win")) {
31 | osEnum = OSEnum.WINDOWS;
32 | } else if (operateSys.contains("nix")
33 | || operateSys.contains("nux")
34 | || operateSys.contains("aix")) {
35 | osEnum = OSEnum.LINUX;
36 | } else if (operateSys.contains("mac")) {
37 | osEnum = OSEnum.MAC;
38 | }
39 | return osEnum;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/utils/SysLog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.utils;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public abstract class SysLog {
22 |
23 | public static void error(String message) {
24 | throw new IllegalArgumentException(message);
25 | }
26 |
27 | public static void info(String message) {
28 | System.out.println(message);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/toolkit-common/src/main/java/iot/technology/client/toolkit/common/validator/BaseValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.common.validator;
17 |
18 | import iot.technology.client.toolkit.common.utils.Assert;
19 | import iot.technology.client.toolkit.common.utils.StringUtils;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public abstract class BaseValidator {
25 |
26 | public static void validateBlankParam(String param, String value) {
27 | Assert.isTrue(StringUtils.isNotBlank(param), value);
28 | }
29 |
30 | public static void validateNullParam(String param, Object value) {
31 | Assert.isTrue(value != null, param);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/toolkit-mqtt/pom.xml:
--------------------------------------------------------------------------------
1 |
18 |
21 | 4.0.0
22 |
23 | iot-toolkit
24 | iot.technology
25 | 0.7.6
26 |
27 |
28 | toolkit-mqtt
29 | jar
30 | IoT Technology ToolKit MQTT
31 |
32 |
33 | 21
34 | 21
35 |
36 |
37 |
38 |
39 | iot.technology
40 | toolkit-common
41 |
42 |
43 | io.netty
44 | netty-codec-mqtt
45 |
46 |
47 | io.netty
48 | netty-handler
49 |
50 |
51 | com.google.guava
52 | guava
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/command/sub/MqttDescribeCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.command.sub;
17 |
18 | import iot.technology.client.toolkit.common.constants.ExitCodeEnum;
19 | import iot.technology.client.toolkit.mqtt.service.MqttBizService;
20 | import picocli.CommandLine;
21 |
22 | import java.util.concurrent.Callable;
23 |
24 | /**
25 | * @author mushuwei
26 | */
27 | @CommandLine.Command(
28 | name = "describe",
29 | aliases = "desc",
30 | requiredOptionMarker = '*',
31 | description = "${bundle:mqtt.desc.description}",
32 | optionListHeading = "%n${bundle:general.option}:%n",
33 | footerHeading = "%nCopyright (c) 2019-2025, ${bundle:general.copyright}",
34 | footer = "%nDeveloped by mushuwei"
35 | )
36 | public class MqttDescribeCommand implements Callable {
37 |
38 |
39 | @CommandLine.Option(names = {"-h", "--help"}, usageHelp = true, description = "${bundle:general.help.description}")
40 | boolean usageHelpRequested;
41 |
42 | private final MqttBizService bizService = new MqttBizService();
43 |
44 | @Override
45 | public Integer call() {
46 | bizService.getMqttDescription();
47 | return ExitCodeEnum.SUCCESS.getValue();
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/config/MqttSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.config;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class MqttSettings implements Serializable {
24 |
25 | private String name;
26 |
27 | private MqttSettingsInfo info;
28 |
29 | /**
30 | * 1
31 | */
32 | private Integer usage = 1;
33 |
34 | private Long settingTime;
35 |
36 | public String getName() {
37 | return name;
38 | }
39 |
40 | public void setName(String name) {
41 | this.name = name;
42 | }
43 |
44 | public MqttSettingsInfo getInfo() {
45 | return info;
46 | }
47 |
48 | public void setInfo(MqttSettingsInfo info) {
49 | this.info = info;
50 | }
51 |
52 | public Integer getUsage() {
53 | return usage;
54 | }
55 |
56 | public void setUsage(Integer usage) {
57 | this.usage = usage;
58 | }
59 |
60 | public Long getSettingTime() {
61 | return settingTime;
62 | }
63 |
64 | public void setSettingTime(Long settingTime) {
65 | this.settingTime = settingTime;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/config/MqttShellModeDomain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.config;
17 |
18 | import iot.technology.client.toolkit.mqtt.service.core.MqttClientService;
19 |
20 | import java.io.Serializable;
21 |
22 | /**
23 | * @author mushuwei
24 | */
25 | public class MqttShellModeDomain implements Serializable {
26 |
27 | private MqttSettings settings;
28 |
29 | private MqttClientService client;
30 |
31 | public MqttSettings getSettings() {
32 | return settings;
33 | }
34 |
35 | public void setSettings(MqttSettings settings) {
36 | this.settings = settings;
37 | }
38 |
39 | public MqttClientService getClient() {
40 | return client;
41 | }
42 |
43 | public void setClient(MqttClientService client) {
44 | this.client = client;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/MqttClientCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service;
17 |
18 | import iot.technology.client.toolkit.mqtt.service.domain.DisReason;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public interface MqttClientCallback {
24 |
25 | /**
26 | * This method is called when the connection to the server is lost.
27 | *
28 | * @param cause the reason behind the loss of connection.
29 | */
30 | void connectionLost(DisReason reason);
31 |
32 | /**
33 | * This method is called when the connection to the server is recovered.
34 | */
35 | void onSuccessfulReconnect();
36 | }
37 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/PendingOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public interface PendingOperation {
22 |
23 | boolean isCanceled();
24 | }
25 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/domain/ChannelClosedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service.domain;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public class ChannelClosedException extends RuntimeException {
22 |
23 | private static final long serialVersionUID = 6266638352424706909L;
24 |
25 | public ChannelClosedException() {
26 | }
27 |
28 | public ChannelClosedException(String message) {
29 | super(message);
30 | }
31 |
32 | public ChannelClosedException(String message, Throwable cause) {
33 | super(message, cause);
34 | }
35 |
36 | public ChannelClosedException(Throwable cause) {
37 | super(cause);
38 | }
39 |
40 | public ChannelClosedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
41 | super(message, cause, enableSuppression, writableStackTrace);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/domain/DisReason.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service.domain;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class DisReason implements Serializable {
24 |
25 | private Integer actionType;
26 |
27 | private Throwable cause;
28 |
29 | public Integer getActionType() {
30 | return actionType;
31 | }
32 |
33 | public void setActionType(Integer actionType) {
34 | this.actionType = actionType;
35 | }
36 |
37 | public Throwable getCause() {
38 | return cause;
39 | }
40 |
41 | public void setCause(Throwable cause) {
42 | this.cause = cause;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/domain/MqttConnectResult.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service.domain;
17 |
18 | import io.netty.channel.ChannelFuture;
19 | import io.netty.handler.codec.mqtt.MqttConnectReturnCode;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public final class MqttConnectResult {
25 |
26 | private final boolean success;
27 | private final MqttConnectReturnCode returnCode;
28 | private final ChannelFuture closeFuture;
29 |
30 | public MqttConnectResult(boolean success, MqttConnectReturnCode returnCode, ChannelFuture closeFuture) {
31 | this.success = success;
32 | this.returnCode = returnCode;
33 | this.closeFuture = closeFuture;
34 | }
35 |
36 | public boolean isSuccess() {
37 | return success;
38 | }
39 |
40 | public MqttConnectReturnCode getReturnCode() {
41 | return returnCode;
42 | }
43 |
44 | public ChannelFuture getCloseFuture() {
45 | return closeFuture;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/domain/MqttIncomingQos2Publish.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service.domain;
17 |
18 | import io.netty.handler.codec.mqtt.MqttPublishMessage;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public final class MqttIncomingQos2Publish {
24 |
25 | private final MqttPublishMessage incomingPublish;
26 |
27 | public MqttIncomingQos2Publish(MqttPublishMessage incomingPublish) {
28 | this.incomingPublish = incomingPublish;
29 | }
30 |
31 | public MqttPublishMessage getIncomingPublish() {
32 | return incomingPublish;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/domain/MqttSettingsListDomain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service.domain;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class MqttSettingsListDomain implements Serializable {
24 |
25 | private String serial;
26 |
27 | private String clientId;
28 |
29 | private String host;
30 |
31 | private String port;
32 |
33 | private String username;
34 |
35 | private String password;
36 |
37 | public String getSerial() {
38 | return serial;
39 | }
40 |
41 | public void setSerial(String serial) {
42 | this.serial = serial;
43 | }
44 |
45 | public String getClientId() {
46 | return clientId;
47 | }
48 |
49 | public void setClientId(String clientId) {
50 | this.clientId = clientId;
51 | }
52 |
53 | public String getHost() {
54 | return host;
55 | }
56 |
57 | public void setHost(String host) {
58 | this.host = host;
59 | }
60 |
61 | public String getPort() {
62 | return port;
63 | }
64 |
65 | public void setPort(String port) {
66 | this.port = port;
67 | }
68 |
69 | public String getUsername() {
70 | return username;
71 | }
72 |
73 | public void setUsername(String username) {
74 | this.username = username;
75 | }
76 |
77 | public String getPassword() {
78 | return password;
79 | }
80 |
81 | public void setPassword(String password) {
82 | this.password = password;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/handler/MqttHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service.handler;
17 |
18 | import io.netty.buffer.ByteBuf;
19 | import io.netty.handler.codec.mqtt.MqttQoS;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public interface MqttHandler {
25 |
26 | void onMessage(String topic, MqttQoS qos, ByteBuf payload);
27 | }
28 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/CaNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.FileUtils;
10 | import iot.technology.client.toolkit.common.utils.StringUtils;
11 |
12 | import java.util.ResourceBundle;
13 |
14 | /**
15 | * @author mushuwei
16 | */
17 | public class CaNode implements TkNode {
18 |
19 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
20 |
21 | @Override
22 | public boolean check(NodeContext context) {
23 | if (StringUtils.isBlank(context.getData())) {
24 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
25 | context.setCheck(false);
26 | return false;
27 | }
28 | if (!FileUtils.isExist(context.getData())) {
29 | System.out.format(ColorUtils.redError(bundle.getString("file.error")));
30 | context.setCheck(false);
31 | return false;
32 | }
33 | context.setCheck(true);
34 | return true;
35 | }
36 |
37 | @Override
38 | public String nodePrompt() {
39 | return bundle.getString(MqttSettingsCodeEnum.CA.getCode() + GlobalConstants.promptSuffix) +
40 | GlobalConstants.promptSeparator;
41 | }
42 |
43 | @Override
44 | public String nextNode(NodeContext context) {
45 | if (!context.isCheck()) {
46 | return MqttSettingsCodeEnum.CA.getCode();
47 | }
48 | return MqttSettingsCodeEnum.CLIENT_CERT.getCode();
49 | }
50 |
51 | @Override
52 | public String getValue(NodeContext context) {
53 | return context.getData();
54 | }
55 |
56 | @Override
57 | public void prePrompt(NodeContext context) {
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/ClientCertNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.FileUtils;
10 | import iot.technology.client.toolkit.common.utils.StringUtils;
11 |
12 | import java.util.ResourceBundle;
13 |
14 | /**
15 | * @author mushuwei
16 | */
17 | public class ClientCertNode implements TkNode {
18 |
19 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
20 |
21 | @Override
22 | public boolean check(NodeContext context) {
23 | if (StringUtils.isBlank(context.getData())) {
24 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
25 | context.setCheck(false);
26 | return false;
27 | }
28 | if (!FileUtils.isExist(context.getData())) {
29 | System.out.format(ColorUtils.redError(bundle.getString("file.error")));
30 | context.setCheck(false);
31 | return false;
32 | }
33 | context.setCheck(true);
34 | return true;
35 | }
36 |
37 | @Override
38 | public String nodePrompt() {
39 | return bundle.getString(MqttSettingsCodeEnum.CLIENT_CERT.getCode() + GlobalConstants.promptSuffix) +
40 | GlobalConstants.promptSeparator;
41 | }
42 |
43 | @Override
44 | public String nextNode(NodeContext context) {
45 | if (!context.isCheck()) {
46 | return MqttSettingsCodeEnum.CLIENT_CERT.getCode();
47 | }
48 | return MqttSettingsCodeEnum.CLIENT_KEY.getCode();
49 | }
50 |
51 |
52 | @Override
53 | public String getValue(NodeContext context) {
54 | return context.getData();
55 | }
56 |
57 | @Override
58 | public void prePrompt(NodeContext context) {
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/ClientIdNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.StringUtils;
9 |
10 | import java.util.Random;
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class ClientIdNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public boolean check(NodeContext context) {
22 | context.setCheck(true);
23 | return true;
24 | }
25 |
26 | @Override
27 | public String nodePrompt() {
28 | return bundle.getString(MqttSettingsCodeEnum.CLIENT_ID.getCode() + GlobalConstants.promptSuffix) +
29 | GlobalConstants.promptSeparator;
30 | }
31 |
32 | @Override
33 | public String nextNode(NodeContext context) {
34 | if (!context.isCheck()) {
35 | return MqttSettingsCodeEnum.CLIENT_ID.getCode();
36 | }
37 | return MqttSettingsCodeEnum.HOST.getCode();
38 | }
39 |
40 |
41 | @Override
42 | public String getValue(NodeContext context) {
43 | String id = "toolkit_mqtt_";
44 | String[] options = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("");
45 | for (int i = 0; i < 8; i++) {
46 | id += options[new Random().nextInt(options.length)];
47 | }
48 | return StringUtils.isBlank(context.getData()) ? id : context.getData();
49 | }
50 |
51 | @Override
52 | public void prePrompt(NodeContext context) {
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/ClientKeyNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.FileUtils;
10 | import iot.technology.client.toolkit.common.utils.StringUtils;
11 |
12 | import java.util.ResourceBundle;
13 |
14 | /**
15 | * @author mushuwei
16 | */
17 | public class ClientKeyNode implements TkNode {
18 |
19 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
20 |
21 | @Override
22 | public boolean check(NodeContext context) {
23 | if (StringUtils.isBlank(context.getData())) {
24 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
25 | context.setCheck(false);
26 | return false;
27 | }
28 | if (!FileUtils.isExist(context.getData())) {
29 | System.out.format(ColorUtils.redError(bundle.getString("file.error")));
30 | context.setCheck(false);
31 | return false;
32 | }
33 | context.setCheck(true);
34 | return true;
35 | }
36 |
37 | @Override
38 | public String nodePrompt() {
39 | return bundle.getString(MqttSettingsCodeEnum.CLIENT_KEY.getCode() + GlobalConstants.promptSuffix) +
40 | GlobalConstants.promptSeparator;
41 | }
42 |
43 |
44 | @Override
45 | public String nextNode(NodeContext context) {
46 | if (!context.isCheck()) {
47 | return MqttSettingsCodeEnum.CLIENT_KEY.getCode();
48 | }
49 | return MqttSettingsCodeEnum.ADVANCED.getCode();
50 | }
51 |
52 |
53 | @Override
54 | public String getValue(NodeContext context) {
55 | return context.getData();
56 | }
57 |
58 | @Override
59 | public void prePrompt(NodeContext context) {
60 |
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/ConnectTimeoutNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class ConnectTimeoutNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public boolean check(NodeContext context) {
22 | if (!StringUtils.isBlank(context.getData()) && !StringUtils.isNumeric(context.getData())) {
23 | System.out.format(ColorUtils.redError(bundle.getString("number.error")));
24 | context.setCheck(false);
25 | return false;
26 | }
27 | context.setCheck(true);
28 | return true;
29 | }
30 |
31 | @Override
32 | public String nodePrompt() {
33 | return bundle.getString(MqttSettingsCodeEnum.CONNECT_TIMEOUT.getCode() + GlobalConstants.promptSuffix) +
34 | GlobalConstants.promptSeparator;
35 | }
36 |
37 | @Override
38 | public String nextNode(NodeContext context) {
39 | if (!context.isCheck()) {
40 | return MqttSettingsCodeEnum.CONNECT_TIMEOUT.getCode();
41 | }
42 | return MqttSettingsCodeEnum.KEEP_ALIVE.getCode();
43 | }
44 |
45 | @Override
46 | public String getValue(NodeContext context) {
47 | return StringUtils.isBlank(context.getData()) ? "10" : context.getData();
48 | }
49 |
50 | @Override
51 | public void prePrompt(NodeContext context) {
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/KeepAliveNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class KeepAliveNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public boolean check(NodeContext context) {
22 | if (!StringUtils.isBlank(context.getData()) && !StringUtils.isNumeric(context.getData())) {
23 | System.out.format(ColorUtils.redError(bundle.getString("number.error")));
24 | context.setCheck(false);
25 | return false;
26 | }
27 | context.setCheck(true);
28 | return true;
29 | }
30 |
31 | @Override
32 | public String nodePrompt() {
33 | return bundle.getString(MqttSettingsCodeEnum.KEEP_ALIVE.getCode() + GlobalConstants.promptSuffix) +
34 | GlobalConstants.promptSeparator;
35 | }
36 |
37 | @Override
38 | public String nextNode(NodeContext context) {
39 | if (!context.isCheck()) {
40 | return MqttSettingsCodeEnum.KEEP_ALIVE.getCode();
41 | }
42 | return MqttSettingsCodeEnum.CLEAN_SESSION.getCode();
43 | }
44 |
45 | @Override
46 | public String getValue(NodeContext context) {
47 | return StringUtils.isBlank(context.getData()) ? "10" : context.getData();
48 | }
49 |
50 | @Override
51 | public void prePrompt(NodeContext context) {
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/PasswordNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.StringUtils;
9 |
10 | import java.util.ResourceBundle;
11 |
12 | /**
13 | * @author mushuwei
14 | */
15 | public class PasswordNode implements TkNode {
16 |
17 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
18 |
19 | @Override
20 | public boolean check(NodeContext context) {
21 | context.setCheck(true);
22 | return true;
23 | }
24 |
25 | @Override
26 | public String nodePrompt() {
27 | return bundle.getString(MqttSettingsCodeEnum.PASSWORD.getCode() + GlobalConstants.promptSuffix) +
28 | GlobalConstants.promptSeparator;
29 | }
30 |
31 | @Override
32 | public String nextNode(NodeContext context) {
33 | if (!context.isCheck()) {
34 | return MqttSettingsCodeEnum.PASSWORD.getCode();
35 | }
36 | return MqttSettingsCodeEnum.SSL.getCode();
37 | }
38 |
39 |
40 | @Override
41 | public String getValue(NodeContext context) {
42 | String data = context.getData();
43 | String value = "";
44 | if (!StringUtils.isBlank(data)) {
45 | value = data;
46 | }
47 | return value;
48 | }
49 |
50 | @Override
51 | public void prePrompt(NodeContext context) {
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/SettingsNameNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class SettingsNameNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 | }
23 |
24 | @Override
25 | public boolean check(NodeContext context) {
26 | if (StringUtils.isBlank(context.getData())) {
27 | System.out.println(ColorUtils.redError(bundle.getString("mqtt.settings.name.error")));
28 | context.setCheck(false);
29 | return false;
30 | }
31 | context.setCheck(true);
32 | return true;
33 |
34 | }
35 |
36 | @Override
37 | public String nodePrompt() {
38 | return bundle.getString(MqttSettingsCodeEnum.SETTINGS_NAME.getCode() + GlobalConstants.promptSuffix) +
39 | GlobalConstants.promptSeparator;
40 | }
41 |
42 | @Override
43 | public String nextNode(NodeContext context) {
44 | if (!context.isCheck()) {
45 | return MqttSettingsCodeEnum.SETTINGS_NAME.getCode();
46 | }
47 | return MqttSettingsCodeEnum.MQTT_VERSION.getCode();
48 | }
49 |
50 |
51 | @Override
52 | public String getValue(NodeContext context) {
53 | return context.getData();
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/UsernameNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.StringUtils;
9 |
10 | import java.util.ResourceBundle;
11 |
12 | /**
13 | * @author mushuwei
14 | */
15 | public class UsernameNode implements TkNode {
16 |
17 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
18 |
19 | @Override
20 | public boolean check(NodeContext context) {
21 | context.setCheck(true);
22 | return true;
23 | }
24 |
25 | @Override
26 | public String nodePrompt() {
27 | return bundle.getString(MqttSettingsCodeEnum.USERNAME.getCode() + GlobalConstants.promptSuffix) +
28 | GlobalConstants.promptSeparator;
29 | }
30 |
31 | @Override
32 | public String nextNode(NodeContext context) {
33 | if (!context.isCheck()) {
34 | return MqttSettingsCodeEnum.USERNAME.getCode();
35 | }
36 | return MqttSettingsCodeEnum.PASSWORD.getCode();
37 | }
38 |
39 |
40 | @Override
41 | public String getValue(NodeContext context) {
42 | String value = "";
43 | if (!StringUtils.isBlank(context.getData())) {
44 | value = context.getData();
45 | }
46 | return value;
47 | }
48 |
49 | @Override
50 | public void prePrompt(NodeContext context) {
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/node/lastWillTopicNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.mqtt.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.MqttSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class lastWillTopicNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public boolean check(NodeContext context) {
22 | if (StringUtils.isBlank(context.getData())) {
23 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
24 | context.setCheck(false);
25 | return false;
26 | }
27 | context.setCheck(true);
28 | return true;
29 | }
30 |
31 | @Override
32 | public String nodePrompt() {
33 | return bundle.getString(MqttSettingsCodeEnum.LAST_WILL_TOPIC.getCode() + GlobalConstants.promptSuffix) +
34 | GlobalConstants.promptSeparator;
35 | }
36 |
37 | @Override
38 | public String nextNode(NodeContext context) {
39 | if (!context.isCheck()) {
40 | return MqttSettingsCodeEnum.LAST_WILL_TOPIC.getCode();
41 | }
42 | return MqttSettingsCodeEnum.LAST_WILL_QOS.getCode();
43 | }
44 |
45 |
46 | @Override
47 | public String getValue(NodeContext context) {
48 | return context.getData();
49 | }
50 |
51 | @Override
52 | public void prePrompt(NodeContext context) {
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-mqtt/src/main/java/iot/technology/client/toolkit/mqtt/service/processor/shellmode/MqttProcessContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.mqtt.service.processor.shellmode;
17 |
18 | import iot.technology.client.toolkit.common.rule.ProcessContext;
19 | import iot.technology.client.toolkit.mqtt.config.MqttShellModeDomain;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class MqttProcessContext extends ProcessContext {
25 |
26 | private MqttShellModeDomain domain;
27 |
28 | public MqttShellModeDomain getDomain() {
29 | return domain;
30 | }
31 |
32 | public void setDomain(MqttShellModeDomain domain) {
33 | this.domain = domain;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/toolkit-nbiot/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
22 |
23 | iot-toolkit
24 | iot.technology
25 | 0.7.6
26 |
27 | 4.0.0
28 |
29 | toolkit-nbiot
30 | jar
31 | IoT Technology Toolkit NB-IoT
32 |
33 |
34 | 21
35 | 21
36 | UTF-8
37 |
38 |
39 |
40 |
41 | iot.technology
42 | toolkit-common
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/MobileDeviceDataService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile;
17 |
18 | /**
19 | * @author mushuwei
20 | */
21 | public class MobileDeviceDataService extends AbstractMobileService {
22 |
23 |
24 |
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/BaseOneNetResponse.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | public class BaseOneNetResponse implements Serializable {
6 |
7 | private Integer code;
8 |
9 | private String msg;
10 |
11 | private boolean success = false;
12 |
13 | public Integer getCode() {
14 | return code;
15 | }
16 |
17 | public void setCode(Integer code) {
18 | this.code = code;
19 | }
20 |
21 | public String getMsg() {
22 | return msg;
23 | }
24 |
25 | public void setMsg(String msg) {
26 | this.msg = msg;
27 | }
28 |
29 | public boolean isSuccess() {
30 | return success;
31 | }
32 |
33 | public void setSuccess(boolean success) {
34 | this.success = success;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/MobileConfigDomain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class MobileConfigDomain implements Serializable {
24 |
25 | private String productName;
26 |
27 | private String productId;
28 |
29 | private String accessKey;
30 |
31 | public String getProductName() {
32 | return productName;
33 | }
34 |
35 | public void setProductName(String productName) {
36 | this.productName = productName;
37 | }
38 |
39 | public String getProductId() {
40 | return productId;
41 | }
42 |
43 | public void setProductId(String productId) {
44 | this.productId = productId;
45 | }
46 |
47 | public String getAccessKey() {
48 | return accessKey;
49 | }
50 |
51 | public void setAccessKey(String accessKey) {
52 | this.accessKey = accessKey;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetCachedCommandBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import com.fasterxml.jackson.annotation.JsonProperty;
19 |
20 | import java.io.Serializable;
21 | import java.util.List;
22 |
23 | /**
24 | * @author mushuwei
25 | */
26 | public class OneNetCachedCommandBody implements Serializable {
27 |
28 | @JsonProperty("total_count")
29 | private Integer totalCount;
30 |
31 | private List items;
32 |
33 | public Integer getTotalCount() {
34 | return totalCount;
35 | }
36 |
37 | public void setTotalCount(Integer totalCount) {
38 | this.totalCount = totalCount;
39 | }
40 |
41 | public List getItems() {
42 | return items;
43 | }
44 |
45 | public void setItems(List items) {
46 | this.items = items;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetCachedCommandResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import iot.technology.client.toolkit.nb.service.mobile.domain.BaseOneNetResponse;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class OneNetCachedCommandResponse extends BaseOneNetResponse {
24 |
25 | private OneNetCachedCommandBody data;
26 |
27 | public OneNetCachedCommandBody getData() {
28 | return data;
29 | }
30 |
31 | public void setData(OneNetCachedCommandBody data) {
32 | this.data = data;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetDeviceHisDataBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import java.io.Serializable;
19 | import java.util.List;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class OneNetDeviceHisDataBody implements Serializable {
25 |
26 | private String cursor;
27 |
28 | private int count;
29 |
30 | private List datastreams;
31 |
32 | public String getCursor() {
33 | return cursor;
34 | }
35 |
36 | public void setCursor(String cursor) {
37 | this.cursor = cursor;
38 | }
39 |
40 | public int getCount() {
41 | return count;
42 | }
43 |
44 | public void setCount(int count) {
45 | this.count = count;
46 | }
47 |
48 | public List getDatastreams() {
49 | return datastreams;
50 | }
51 |
52 | public void setDatastreams(
53 | List datastreams) {
54 | this.datastreams = datastreams;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetDeviceHisDataPointsBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class OneNetDeviceHisDataPointsBody implements Serializable {
24 |
25 | private String at;
26 |
27 | private String value;
28 |
29 | public String getAt() {
30 | return at;
31 | }
32 |
33 | public void setAt(String at) {
34 | this.at = at;
35 | }
36 |
37 | public String getValue() {
38 | return value;
39 | }
40 |
41 | public void setValue(String value) {
42 | this.value = value;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetDeviceHisDataStreamsBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import java.io.Serializable;
19 | import java.util.List;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class OneNetDeviceHisDataStreamsBody implements Serializable {
25 |
26 | private String id;
27 |
28 | private List datapoints;
29 |
30 | public String getId() {
31 | return id;
32 | }
33 |
34 | public void setId(String id) {
35 | this.id = id;
36 | }
37 |
38 | public List getDatapoints() {
39 | return datapoints;
40 | }
41 |
42 | public void setDatapoints(
43 | List datapoints) {
44 | this.datapoints = datapoints;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetDeviceLatestDataBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import java.io.Serializable;
19 | import java.util.List;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class OneNetDeviceLatestDataBody implements Serializable {
25 |
26 | private List devices;
27 |
28 | public List getDevices() {
29 | return devices;
30 | }
31 |
32 | public void setDevices(List devices) {
33 | this.devices = devices;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetDeviceLatestDataDevicesBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import java.io.Serializable;
19 | import java.util.List;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class OneNetDeviceLatestDataDevicesBody implements Serializable {
25 |
26 | private String id;
27 |
28 | private String title;
29 |
30 | private List datastreams;
31 |
32 | public String getId() {
33 | return id;
34 | }
35 |
36 | public void setId(String id) {
37 | this.id = id;
38 | }
39 |
40 | public String getTitle() {
41 | return title;
42 | }
43 |
44 | public void setTitle(String title) {
45 | this.title = title;
46 | }
47 |
48 | public List getDatastreams() {
49 | return datastreams;
50 | }
51 |
52 | public void setDatastreams(
53 | List datastreams) {
54 | this.datastreams = datastreams;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/data/OneNetDeviceLatestDataStreamsBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.data;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class OneNetDeviceLatestDataStreamsBody implements Serializable {
24 |
25 | private String id;
26 |
27 | private String at;
28 |
29 | private String value;
30 |
31 | public String getId() {
32 | return id;
33 | }
34 |
35 | public void setId(String id) {
36 | this.id = id;
37 | }
38 |
39 | public String getAt() {
40 | return at;
41 | }
42 |
43 | public void setAt(String at) {
44 | this.at = at;
45 | }
46 |
47 | public String getValue() {
48 | return value;
49 | }
50 |
51 | public void setValue(String value) {
52 | this.value = value;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetCreateDeviceBody.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import java.io.Serializable;
4 |
5 | public class OneNetCreateDeviceBody implements Serializable {
6 |
7 | private Object did;
8 |
9 | private String pid;
10 |
11 | private String name;
12 |
13 | private Integer status;
14 |
15 | public Object getDid() {
16 | return did;
17 | }
18 |
19 | public void setDid(Object did) {
20 | this.did = did;
21 | }
22 |
23 | public String getPid() {
24 | return pid;
25 | }
26 |
27 | public void setPid(String pid) {
28 | this.pid = pid;
29 | }
30 |
31 | public String getName() {
32 | return name;
33 | }
34 |
35 | public void setName(String name) {
36 | this.name = name;
37 | }
38 |
39 | public Integer getStatus() {
40 | return status;
41 | }
42 |
43 | public void setStatus(Integer status) {
44 | this.status = status;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetCreateDeviceResponse.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 |
4 | import iot.technology.client.toolkit.nb.service.mobile.domain.BaseOneNetResponse;
5 |
6 | public class OneNetCreateDeviceResponse extends BaseOneNetResponse {
7 |
8 | private OneNetCreateDeviceBody data;
9 |
10 |
11 | public OneNetCreateDeviceBody getData() {
12 | return data;
13 | }
14 |
15 | public void setData(OneNetCreateDeviceBody data) {
16 | this.data = data;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetDelDeviceBody.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 |
7 | public class OneNetDelDeviceBody implements Serializable {
8 |
9 | private String did;
10 |
11 | private String pid;
12 |
13 | @JsonProperty("device_name")
14 | private String deviceName;
15 |
16 | private String imei;
17 |
18 | public String getDid() {
19 | return did;
20 | }
21 |
22 | public void setDid(String did) {
23 | this.did = did;
24 | }
25 |
26 | public String getPid() {
27 | return pid;
28 | }
29 |
30 | public void setPid(String pid) {
31 | this.pid = pid;
32 | }
33 |
34 | public String getDeviceName() {
35 | return deviceName;
36 | }
37 |
38 | public void setDeviceName(String deviceName) {
39 | this.deviceName = deviceName;
40 | }
41 |
42 | public String getImei() {
43 | return imei;
44 | }
45 |
46 | public void setImei(String imei) {
47 | this.imei = imei;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetDelDeviceRequest.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 |
7 | public class OneNetDelDeviceRequest implements Serializable {
8 |
9 | @JsonProperty("product_id")
10 | private String productId;
11 |
12 | @JsonProperty("device_name")
13 | private String deviceName;
14 |
15 | private String imei;
16 |
17 | public String getProductId() {
18 | return productId;
19 | }
20 |
21 | public void setProductId(String productId) {
22 | this.productId = productId;
23 | }
24 |
25 | public String getDeviceName() {
26 | return deviceName;
27 | }
28 |
29 | public void setDeviceName(String deviceName) {
30 | this.deviceName = deviceName;
31 | }
32 |
33 | public String getImei() {
34 | return imei;
35 | }
36 |
37 | public void setImei(String imei) {
38 | this.imei = imei;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetDelDeviceResponse.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import iot.technology.client.toolkit.nb.service.mobile.domain.BaseOneNetResponse;
4 |
5 | public class OneNetDelDeviceResponse extends BaseOneNetResponse {
6 |
7 | private OneNetDelDeviceBody data;
8 |
9 | public OneNetDelDeviceBody getData() {
10 | return data;
11 | }
12 |
13 | public void setData(OneNetDelDeviceBody data) {
14 | this.data = data;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetDeviceDetailRequest.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 |
7 | public class OneNetDeviceDetailRequest implements Serializable {
8 |
9 | @JsonProperty("product_id")
10 | private String productId;
11 |
12 | @JsonProperty("device_name")
13 | private String deviceName;
14 |
15 | private String imei;
16 |
17 | public String getProductId() {
18 | return productId;
19 | }
20 |
21 | public void setProductId(String productId) {
22 | this.productId = productId;
23 | }
24 |
25 | public String getDeviceName() {
26 | return deviceName;
27 | }
28 |
29 | public void setDeviceName(String deviceName) {
30 | this.deviceName = deviceName;
31 | }
32 |
33 | public String getImei() {
34 | return imei;
35 | }
36 |
37 | public void setImei(String imei) {
38 | this.imei = imei;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetDeviceListRequest.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 |
7 | public class OneNetDeviceListRequest implements Serializable {
8 |
9 | @JsonProperty("product_id")
10 | private String productId;
11 |
12 | @JsonProperty("device_name")
13 | private String deviceName;
14 |
15 | private Integer offset;
16 |
17 | private Integer limit;
18 |
19 | public String getProductId() {
20 | return productId;
21 | }
22 |
23 | public void setProductId(String productId) {
24 | this.productId = productId;
25 | }
26 |
27 | public String getDeviceName() {
28 | return deviceName;
29 | }
30 |
31 | public void setDeviceName(String deviceName) {
32 | this.deviceName = deviceName;
33 | }
34 |
35 | public Integer getOffset() {
36 | return offset;
37 | }
38 |
39 | public void setOffset(Integer offset) {
40 | this.offset = offset;
41 | }
42 |
43 | public Integer getLimit() {
44 | return limit;
45 | }
46 |
47 | public void setLimit(Integer limit) {
48 | this.limit = limit;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetDeviceListResponse.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import iot.technology.client.toolkit.nb.service.mobile.domain.BaseOneNetResponse;
4 |
5 | public class OneNetDeviceListResponse extends BaseOneNetResponse {
6 |
7 | private OneNetDevicePageResponse data;
8 |
9 | public OneNetDevicePageResponse getData() {
10 | return data;
11 | }
12 |
13 | public void setData(OneNetDevicePageResponse data) {
14 | this.data = data;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetDevicePageResponse.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | public class OneNetDevicePageResponse implements Serializable {
7 |
8 | private Integer offset;
9 |
10 | private Integer limit;
11 |
12 | private List list;
13 |
14 | public Integer getOffset() {
15 | return offset;
16 | }
17 |
18 | public void setOffset(Integer offset) {
19 | this.offset = offset;
20 | }
21 |
22 | public Integer getLimit() {
23 | return limit;
24 | }
25 |
26 | public void setLimit(Integer limit) {
27 | this.limit = limit;
28 | }
29 |
30 | public List getList() {
31 | return list;
32 | }
33 |
34 | public void setList(List list) {
35 | this.list = list;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetProductResponse.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import iot.technology.client.toolkit.nb.service.mobile.domain.BaseOneNetResponse;
4 |
5 |
6 | public class OneNetProductResponse extends BaseOneNetResponse {
7 |
8 | private OneNetProductBody data;
9 |
10 | public OneNetProductBody getData() {
11 | return data;
12 | }
13 |
14 | public void setData(OneNetProductBody data) {
15 | this.data = data;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetUpdateDeviceBody.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 |
7 | public class OneNetUpdateDeviceBody implements Serializable {
8 |
9 | private String did;
10 |
11 | private String pid;
12 |
13 | @JsonProperty("device_name")
14 | private String deviceName;
15 |
16 | private String imei;
17 |
18 | public String getDid() {
19 | return did;
20 | }
21 |
22 | public void setDid(String did) {
23 | this.did = did;
24 | }
25 |
26 | public String getPid() {
27 | return pid;
28 | }
29 |
30 | public void setPid(String pid) {
31 | this.pid = pid;
32 | }
33 |
34 | public String getDeviceName() {
35 | return deviceName;
36 | }
37 |
38 | public void setDeviceName(String deviceName) {
39 | this.deviceName = deviceName;
40 | }
41 |
42 | public String getImei() {
43 | return imei;
44 | }
45 |
46 | public void setImei(String imei) {
47 | this.imei = imei;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/action/device/OneNetUpdateDeviceResponse.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.action.device;
2 |
3 | import iot.technology.client.toolkit.nb.service.mobile.domain.BaseOneNetResponse;
4 |
5 | public class OneNetUpdateDeviceResponse extends BaseOneNetResponse {
6 |
7 | private OneNetUpdateDeviceBody data;
8 |
9 | public OneNetUpdateDeviceBody getData() {
10 | return data;
11 | }
12 |
13 | public void setData(OneNetUpdateDeviceBody data) {
14 | this.data = data;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/settings/MobProjectSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.mobile.domain.settings;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class MobProjectSettings implements Serializable {
24 |
25 | private String productName;
26 |
27 | private String productId;
28 |
29 | private String accessKey;
30 |
31 | private String serial;
32 |
33 | public String getProductName() {
34 | return productName;
35 | }
36 |
37 | public void setProductName(String productName) {
38 | this.productName = productName;
39 | }
40 |
41 | public String getProductId() {
42 | return productId;
43 | }
44 |
45 | public void setProductId(String productId) {
46 | this.productId = productId;
47 | }
48 |
49 | public String getAccessKey() {
50 | return accessKey;
51 | }
52 |
53 | public void setAccessKey(String accessKey) {
54 | this.accessKey = accessKey;
55 | }
56 |
57 | public String getSerial() {
58 | return serial;
59 | }
60 |
61 | public void setSerial(String serial) {
62 | this.serial = serial;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/settings/OneNetDeviceStatusEnum.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.settings;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 | import java.util.Objects;
6 |
7 | public enum OneNetDeviceStatusEnum {
8 |
9 | ONLINE(1, "online"),
10 | OFFLINE(0, "offline"),
11 | UN_ACTIVE(2, "un_active");
12 |
13 | private static final Map codeToMsgMap = new HashMap<>();
14 |
15 | OneNetDeviceStatusEnum(Integer code, String msg) {
16 | this.code = code;
17 | this.msg = msg;
18 | }
19 |
20 | static {
21 | for (OneNetDeviceStatusEnum deviceStatusEnum : OneNetDeviceStatusEnum.values()) {
22 | codeToMsgMap.put(deviceStatusEnum.getCode(), deviceStatusEnum.getMsg());
23 | }
24 | }
25 |
26 | public static String getMsgByCode(Integer code) {
27 | return Objects.isNull(codeToMsgMap.get(code)) ? UN_ACTIVE.getMsg() : codeToMsgMap.get(code);
28 | }
29 |
30 | private Integer code;
31 |
32 | private String msg;
33 |
34 | public Integer getCode() {
35 | return code;
36 | }
37 |
38 | public void setCode(Integer code) {
39 | this.code = code;
40 | }
41 |
42 | public String getMsg() {
43 | return msg;
44 | }
45 |
46 | public void setMsg(String msg) {
47 | this.msg = msg;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/mobile/domain/settings/OneNetRespCodeEnum.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.mobile.domain.settings;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 | import java.util.Objects;
6 |
7 | public enum OneNetRespCodeEnum {
8 |
9 | SUCCESS(0, "success"),
10 | FAIL(500, "other reasons"),
11 | PARAM_ERROR(10001, "param error"),
12 | AUTH_ERROR(10403, "auth error"),
13 | USER_OPERATIONS_ERROR(10407, "user operations error"),
14 | INTERNAL_ERROR(10500, "internal error"),
15 |
16 | PRODUCT_NOT_EXIST(10408, "product not exist"),
17 | PRODUCT_NOT_CREATE_DEVICE(10409, "product not create device"),
18 |
19 | DEVICE_IS_EXIST(10406, "device is exist"),
20 | DEVICE_NOT_EXIST(10410, "device not exist"),
21 | DEVICE_NOT_ONLINE(10421, "device not online"),
22 | ;
23 |
24 | private static final Map codeToMsgMap = new HashMap<>();
25 |
26 | static {
27 | for (OneNetRespCodeEnum oneNetRespCodeEnum : OneNetRespCodeEnum.values()) {
28 | codeToMsgMap.put(oneNetRespCodeEnum.getCode(), oneNetRespCodeEnum.getMsg());
29 | }
30 | }
31 |
32 | public static String getMsgByCode(Integer code) {
33 | return Objects.isNull(codeToMsgMap.get(code)) ? FAIL.msg : codeToMsgMap.get(code);
34 | }
35 |
36 | OneNetRespCodeEnum(Integer code, String msg) {
37 | this.code = code;
38 | this.msg = msg;
39 | }
40 |
41 | private Integer code;
42 |
43 | private String msg;
44 |
45 | public Integer getCode() {
46 | return code;
47 | }
48 |
49 | public void setCode(Integer code) {
50 | this.code = code;
51 | }
52 |
53 | public String getMsg() {
54 | return msg;
55 | }
56 |
57 | public void setMsg(String msg) {
58 | this.msg = msg;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/LwM2MComPeriodNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 |
10 | import java.util.ResourceBundle;
11 |
12 | /**
13 | * @author mushuwei
14 | */
15 | public class LwM2MComPeriodNode implements TkNode {
16 |
17 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
18 |
19 | @Override
20 | public void prePrompt(NodeContext context) {
21 | System.out.format(ColorUtils.greenItalic(bundle.getString(NbSettingsCodeEnum.NB_LWM2M_COMMUNICATION_PERIOD.getCode() + GlobalConstants.prePrompt)) + "%n");
22 | }
23 |
24 | @Override
25 | public boolean check(NodeContext context) {
26 | context.setCheck(true);
27 | return true;
28 | }
29 |
30 | @Override
31 | public String nodePrompt() {
32 | return bundle.getString(NbSettingsCodeEnum.NB_LWM2M_COMMUNICATION_PERIOD.getCode() + GlobalConstants.promptSuffix) +
33 | GlobalConstants.promptSeparator;
34 | }
35 |
36 | @Override
37 | public String nextNode(NodeContext context) {
38 | if (!context.isCheck()) {
39 | return NbSettingsCodeEnum.NB_LWM2M_COMMUNICATION_PERIOD.getCode();
40 | }
41 | return NbSettingsCodeEnum.NB_LWM2M_DTLS.getCode();
42 | }
43 |
44 | @Override
45 | public String getValue(NodeContext context) {
46 | return context.getData();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/LwM2MModelsFolderNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 |
10 | import java.util.ResourceBundle;
11 |
12 | /**
13 | * @author mushuwei
14 | */
15 | public class LwM2MModelsFolderNode implements TkNode {
16 |
17 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
18 |
19 | @Override
20 | public void prePrompt(NodeContext context) {
21 | System.out.format(ColorUtils.greenItalic(bundle.getString(NbSettingsCodeEnum.NB_LWM2M_MODELS_FOLDER.getCode() + GlobalConstants.prePrompt)) + "%n");
22 | }
23 |
24 | @Override
25 | public boolean check(NodeContext context) {
26 | context.setCheck(true);
27 | return true;
28 | }
29 |
30 | @Override
31 | public String nodePrompt() {
32 | return bundle.getString(NbSettingsCodeEnum.NB_LWM2M_MODELS_FOLDER.getCode() + GlobalConstants.promptSuffix) +
33 | GlobalConstants.promptSeparator;
34 | }
35 |
36 | @Override
37 | public String nextNode(NodeContext context) {
38 | if (!context.isCheck()) {
39 | return NbSettingsCodeEnum.NB_LWM2M_MODELS_FOLDER.getCode();
40 | }
41 | return NbSettingsCodeEnum.NB_LWM2M_LIFETIME.getCode();
42 | }
43 |
44 | @Override
45 | public String getValue(NodeContext context) {
46 | return context.getData();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/LwM2MPskIdentityNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class LwM2MPskIdentityNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 |
23 | }
24 |
25 | @Override
26 | public boolean check(NodeContext context) {
27 | if (StringUtils.isBlank(context.getData())) {
28 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
29 | context.setCheck(false);
30 | return false;
31 | }
32 | context.setCheck(true);
33 | return true;
34 | }
35 |
36 | @Override
37 | public String nodePrompt() {
38 | return bundle.getString(NbSettingsCodeEnum.NB_LWM2M_PSK_IDENTITY.getCode() + GlobalConstants.promptSuffix) +
39 | GlobalConstants.promptSeparator;
40 | }
41 |
42 | @Override
43 | public String nextNode(NodeContext context) {
44 | if (!context.isCheck()) {
45 | return NbSettingsCodeEnum.NB_LWM2M_PSK_IDENTITY.getCode();
46 | }
47 | return NbSettingsCodeEnum.NB_LWM2M_PSK_SHARE_KEY.getCode();
48 | }
49 |
50 | @Override
51 | public String getValue(NodeContext context) {
52 | return context.getData();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/LwM2MServerUrlNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 | import org.eclipse.californium.core.coap.CoAP;
11 |
12 | import java.util.ResourceBundle;
13 |
14 | /**
15 | * @author mushuwei
16 | */
17 | public class LwM2MServerUrlNode implements TkNode {
18 |
19 | public static final String DEFAULT_COAP_URL = "localhost";
20 |
21 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
22 |
23 | @Override
24 | public void prePrompt(NodeContext context) {
25 | System.out.format(ColorUtils.greenItalic("Default: " + DEFAULT_COAP_URL) + "%n");
26 | }
27 |
28 | @Override
29 | public boolean check(NodeContext context) {
30 | if (StringUtils.isBlank(context.getData())) {
31 | context.setData(DEFAULT_COAP_URL);
32 | }
33 | context.setCheck(true);
34 | return true;
35 | }
36 |
37 | @Override
38 | public String nodePrompt() {
39 | return bundle.getString(NbSettingsCodeEnum.NB_LWM2M_URL.getCode() + GlobalConstants.promptSuffix) +
40 | GlobalConstants.promptSeparator;
41 | }
42 |
43 | @Override
44 | public String nextNode(NodeContext context) {
45 | if (!context.isCheck()) {
46 | return NbSettingsCodeEnum.NB_LWM2M_URL.getCode();
47 | }
48 | return NbSettingsCodeEnum.NB_LWM2M_PORT.getCode();
49 | }
50 |
51 | @Override
52 | public String getValue(NodeContext context) {
53 | return context.getData();
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/LwM2MShareKeyNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class LwM2MShareKeyNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 |
23 | }
24 |
25 | @Override
26 | public boolean check(NodeContext context) {
27 | if (StringUtils.isBlank(context.getData())) {
28 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
29 | context.setCheck(false);
30 | return false;
31 | }
32 | context.setCheck(true);
33 | return true;
34 | }
35 |
36 | @Override
37 | public String nodePrompt() {
38 | return bundle.getString(NbSettingsCodeEnum.NB_LWM2M_PSK_SHARE_KEY.getCode() + GlobalConstants.promptSuffix) +
39 | GlobalConstants.promptSeparator;
40 | }
41 |
42 | @Override
43 | public String nextNode(NodeContext context) {
44 | if (!context.isCheck()) {
45 | return NbSettingsCodeEnum.NB_LWM2M_PSK_IDENTITY.getCode();
46 | }
47 | return NbSettingsCodeEnum.END.getCode();
48 | }
49 |
50 | @Override
51 | public String getValue(NodeContext context) {
52 | return context.getData();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/MobAccessKeyNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class MobAccessKeyNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 |
23 | }
24 |
25 | @Override
26 | public boolean check(NodeContext context) {
27 | if (StringUtils.isBlank(context.getData())) {
28 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
29 | context.setCheck(false);
30 | return false;
31 | }
32 | context.setCheck(true);
33 | return true;
34 | }
35 |
36 | @Override
37 | public String nodePrompt() {
38 | return bundle.getString(NbSettingsCodeEnum.NB_MOB_ACCESS_KEY.getCode() + GlobalConstants.promptSuffix) +
39 | GlobalConstants.promptSeparator;
40 | }
41 |
42 | @Override
43 | public String nextNode(NodeContext context) {
44 | if (!context.isCheck()) {
45 | return NbSettingsCodeEnum.NB_MOB_ACCESS_KEY.getCode();
46 | }
47 | if (context.getType() != null && context.getType().equals("settings")) {
48 | return NbSettingsCodeEnum.END.getCode();
49 | }
50 | return NbSettingsCodeEnum.NB_TYPE.getCode();
51 | }
52 |
53 | @Override
54 | public String getValue(NodeContext context) {
55 | return context.getData();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/MobProductIdNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class MobProductIdNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 |
23 | }
24 |
25 | @Override
26 | public boolean check(NodeContext context) {
27 | if (StringUtils.isBlank(context.getData())) {
28 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
29 | context.setCheck(false);
30 | return false;
31 | }
32 | context.setCheck(true);
33 | return true;
34 | }
35 |
36 | @Override
37 | public String nodePrompt() {
38 | return bundle.getString(NbSettingsCodeEnum.NB_MOB_PRODUCT_ID.getCode() + GlobalConstants.promptSuffix) +
39 | GlobalConstants.promptSeparator;
40 | }
41 |
42 | @Override
43 | public String nextNode(NodeContext context) {
44 | if (!context.isCheck()) {
45 | return NbSettingsCodeEnum.NB_MOB_PRODUCT_ID.getCode();
46 | }
47 | return NbSettingsCodeEnum.NB_MOB_ACCESS_KEY.getCode();
48 | }
49 |
50 | @Override
51 | public String getValue(NodeContext context) {
52 | return context.getData();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/MobProductNameNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class MobProductNameNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 | }
23 |
24 | @Override
25 | public boolean check(NodeContext context) {
26 | if (StringUtils.isBlank(context.getData())) {
27 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
28 | context.setCheck(false);
29 | return false;
30 | }
31 | context.setCheck(true);
32 | return true;
33 | }
34 |
35 | @Override
36 | public String nodePrompt() {
37 | return bundle.getString(NbSettingsCodeEnum.NB_MOB_PRODUCT_NAME.getCode() + GlobalConstants.promptSuffix) +
38 | GlobalConstants.promptSeparator;
39 | }
40 |
41 | @Override
42 | public String nextNode(NodeContext context) {
43 | if (!context.isCheck()) {
44 | return NbSettingsCodeEnum.NB_MOB_PRODUCT_NAME.getCode();
45 | }
46 | return NbSettingsCodeEnum.NB_MOB_PRODUCT_ID.getCode();
47 | }
48 |
49 | @Override
50 | public String getValue(NodeContext context) {
51 | return context.getData();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/NbSettingsNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.nb.service.processor.settings.NbSettingsHelpProcessor;
9 |
10 | import java.util.ResourceBundle;
11 |
12 | /**
13 | * @author mushuwei
14 | */
15 | public class NbSettingsNode implements TkNode {
16 |
17 | public static ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
18 |
19 | @Override
20 | public void prePrompt(NodeContext context) {
21 | }
22 |
23 | @Override
24 | public boolean check(NodeContext context) {
25 | return true;
26 | }
27 |
28 | @Override
29 | public String nodePrompt() {
30 | return bundle.getString(NbSettingsCodeEnum.NB_SETTINGS.getCode() + GlobalConstants.promptSuffix) +
31 | GlobalConstants.promptSeparator;
32 | }
33 |
34 | @Override
35 | public String nextNode(NodeContext context) {
36 | return NbSettingsCodeEnum.NB_SETTINGS.getCode();
37 | }
38 |
39 | @Override
40 | public String getValue(NodeContext context) {
41 | return context.getData();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/TelApiKeyNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class TelApiKeyNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 |
23 | }
24 |
25 | @Override
26 | public boolean check(NodeContext context) {
27 | if (StringUtils.isBlank(context.getData())) {
28 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
29 | context.setCheck(false);
30 | return false;
31 | }
32 | context.setCheck(true);
33 | return true;
34 | }
35 |
36 | @Override
37 | public String nodePrompt() {
38 | return bundle.getString(NbSettingsCodeEnum.NB_TEL_API_KEY.getCode() + GlobalConstants.promptSuffix)
39 | + GlobalConstants.promptSeparator;
40 | }
41 |
42 | @Override
43 | public String nextNode(NodeContext context) {
44 | if (!context.isCheck()) {
45 | return NbSettingsCodeEnum.NB_TEL_API_KEY.getCode();
46 | }
47 | if (context.getType() != null && context.getType().equals("settings")) {
48 | return NbSettingsCodeEnum.END.getCode();
49 | }
50 | return NbSettingsCodeEnum.NB_TYPE.getCode();
51 | }
52 |
53 | @Override
54 | public String getValue(NodeContext context) {
55 | return context.getData();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/TelAppKeyNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class TelAppKeyNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 |
23 | }
24 |
25 | @Override
26 | public boolean check(NodeContext context) {
27 | if (StringUtils.isBlank(context.getData())) {
28 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
29 | context.setCheck(false);
30 | return false;
31 | }
32 | context.setCheck(true);
33 | return true;
34 | }
35 |
36 | @Override
37 | public String nodePrompt() {
38 | return bundle.getString(NbSettingsCodeEnum.NB_TEL_APP_KEY.getCode() + GlobalConstants.promptSuffix) +
39 | GlobalConstants.promptSeparator;
40 | }
41 |
42 | @Override
43 | public String nextNode(NodeContext context) {
44 | if (!context.isCheck()) {
45 | return NbSettingsCodeEnum.NB_TEL_APP_KEY.getCode();
46 | }
47 | return NbSettingsCodeEnum.NB_TEL_APP_SECRET.getCode();
48 | }
49 |
50 | @Override
51 | public String getValue(NodeContext context) {
52 | return context.getData();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/TelAppSecretNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 | import iot.technology.client.toolkit.nb.service.NbBizService;
11 |
12 | import java.util.ResourceBundle;
13 |
14 | /**
15 | * @author mushuwei
16 | */
17 | public class TelAppSecretNode implements TkNode {
18 |
19 | private final NbBizService bizService = new NbBizService();
20 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
21 |
22 | @Override
23 | public void prePrompt(NodeContext context) {
24 |
25 | }
26 |
27 | @Override
28 | public boolean check(NodeContext context) {
29 | if (StringUtils.isBlank(context.getData())) {
30 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
31 | context.setCheck(false);
32 | return false;
33 | }
34 | context.setCheck(true);
35 | return true;
36 | }
37 |
38 | @Override
39 | public String nodePrompt() {
40 | return bundle.getString(NbSettingsCodeEnum.NB_TEL_APP_SECRET.getCode() + GlobalConstants.promptSuffix)
41 | + GlobalConstants.promptSeparator;
42 | }
43 |
44 | @Override
45 | public String nextNode(NodeContext context) {
46 | if (!context.isCheck()) {
47 | return NbSettingsCodeEnum.NB_TEL_APP_SECRET.getCode();
48 | }
49 | return NbSettingsCodeEnum.NB_TEL_PRODUCT_ID.getCode();
50 | }
51 |
52 | @Override
53 | public String getValue(NodeContext context) {
54 | return context.getData();
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/node/TelProductIdNode.java:
--------------------------------------------------------------------------------
1 | package iot.technology.client.toolkit.nb.service.node;
2 |
3 | import iot.technology.client.toolkit.common.constants.GlobalConstants;
4 | import iot.technology.client.toolkit.common.constants.NbSettingsCodeEnum;
5 | import iot.technology.client.toolkit.common.constants.StorageConstants;
6 | import iot.technology.client.toolkit.common.rule.NodeContext;
7 | import iot.technology.client.toolkit.common.rule.TkNode;
8 | import iot.technology.client.toolkit.common.utils.ColorUtils;
9 | import iot.technology.client.toolkit.common.utils.StringUtils;
10 |
11 | import java.util.ResourceBundle;
12 |
13 | /**
14 | * @author mushuwei
15 | */
16 | public class TelProductIdNode implements TkNode {
17 |
18 | ResourceBundle bundle = ResourceBundle.getBundle(StorageConstants.LANG_MESSAGES);
19 |
20 | @Override
21 | public void prePrompt(NodeContext context) {
22 | }
23 |
24 | @Override
25 | public boolean check(NodeContext context) {
26 | if (StringUtils.isBlank(context.getData())) {
27 | System.out.format(ColorUtils.redError(bundle.getString("param.error")));
28 | context.setCheck(false);
29 | return false;
30 | }
31 | context.setCheck(true);
32 | return true;
33 | }
34 |
35 | @Override
36 | public String nodePrompt() {
37 | return bundle.getString(NbSettingsCodeEnum.NB_TEL_PRODUCT_ID.getCode() + GlobalConstants.promptSuffix) +
38 | GlobalConstants.promptSeparator;
39 | }
40 |
41 | @Override
42 | public String nextNode(NodeContext context) {
43 | if (!context.isCheck()) {
44 | return NbSettingsCodeEnum.NB_TEL_PRODUCT_ID.getCode();
45 | }
46 | return NbSettingsCodeEnum.NB_TEL_API_KEY.getCode();
47 | }
48 |
49 | @Override
50 | public String getValue(NodeContext context) {
51 | return context.getData();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/processor/Lwm2mProcessContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.processor;
17 |
18 | import iot.technology.client.toolkit.common.rule.ProcessContext;
19 | import iot.technology.client.toolkit.nb.service.lwm2m.domain.Lwm2mConfigSettingsDomain;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class Lwm2mProcessContext extends ProcessContext {
25 |
26 | private Lwm2mConfigSettingsDomain domain;
27 |
28 | public Lwm2mConfigSettingsDomain getDomain() {
29 | return domain;
30 | }
31 |
32 | public void setDomain(Lwm2mConfigSettingsDomain domain) {
33 | this.domain = domain;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/processor/MobProcessContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.processor;
17 |
18 | import iot.technology.client.toolkit.common.rule.ProcessContext;
19 | import iot.technology.client.toolkit.nb.service.mobile.domain.MobileConfigDomain;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class MobProcessContext extends ProcessContext {
25 |
26 | private MobileConfigDomain mobileConfigDomain;
27 |
28 | public MobileConfigDomain getMobileConfigDomain() {
29 | return mobileConfigDomain;
30 | }
31 |
32 | public void setMobileConfigDomain(MobileConfigDomain mobileConfigDomain) {
33 | this.mobileConfigDomain = mobileConfigDomain;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/processor/NbSettingsContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.processor;
17 |
18 | import iot.technology.client.toolkit.common.rule.ProcessContext;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class NbSettingsContext extends ProcessContext {
24 |
25 | private String nbType;
26 |
27 | public String getNbType() {
28 | return nbType;
29 | }
30 |
31 | public void setNbType(String nbType) {
32 | this.nbType = nbType;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/processor/TelProcessContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.processor;
17 |
18 | import iot.technology.client.toolkit.common.rule.ProcessContext;
19 | import iot.technology.client.toolkit.nb.service.telecom.domain.TelecomConfigDomain;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class TelProcessContext extends ProcessContext {
25 |
26 | private TelecomConfigDomain telecomConfigDomain;
27 |
28 | public TelecomConfigDomain getTelecomConfigDomain() {
29 | return telecomConfigDomain;
30 | }
31 |
32 | public void setTelecomConfigDomain(TelecomConfigDomain telecomConfigDomain) {
33 | this.telecomConfigDomain = telecomConfigDomain;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/processor/lwm2m/LwM2MUpdateProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.processor.lwm2m;
17 |
18 | import iot.technology.client.toolkit.common.rule.ProcessContext;
19 | import iot.technology.client.toolkit.common.rule.TkAbstractProcessor;
20 | import iot.technology.client.toolkit.common.rule.TkProcessor;
21 | import iot.technology.client.toolkit.nb.service.lwm2m.domain.Lwm2mConfigSettingsDomain;
22 | import iot.technology.client.toolkit.nb.service.processor.Lwm2mProcessContext;
23 |
24 | /**
25 | * @author mushuwei
26 | */
27 | public class LwM2MUpdateProcessor extends TkAbstractProcessor implements TkProcessor {
28 |
29 | @Override
30 | public boolean supports(ProcessContext context) {
31 | return context.getData().startsWith("update");
32 | }
33 |
34 | @Override
35 | public void handle(ProcessContext context) {
36 | Lwm2mProcessContext lwm2mProcessContext = (Lwm2mProcessContext) context;
37 | Lwm2mConfigSettingsDomain domain = lwm2mProcessContext.getDomain();
38 |
39 | domain.getLeshanClient().triggerRegistrationUpdate();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/telecom/domain/BaseTelResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.telecom.domain;
17 |
18 | import java.io.Serializable;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class BaseTelResponse implements Serializable {
24 |
25 | private String msg;
26 |
27 | private Integer code;
28 |
29 | private boolean success = false;
30 |
31 | public String getMsg() {
32 | return msg;
33 | }
34 |
35 | public void setMsg(String msg) {
36 | this.msg = msg;
37 | }
38 |
39 | public Integer getCode() {
40 | return code;
41 | }
42 |
43 | public void setCode(Integer code) {
44 | this.code = code;
45 | }
46 |
47 | public boolean isSuccess() {
48 | return success;
49 | }
50 |
51 | public void setSuccess(boolean success) {
52 | this.success = success;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/telecom/domain/TelecomConfigDomain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.telecom.domain;
17 |
18 | import java.io.Serializable;
19 |
20 | public class TelecomConfigDomain implements Serializable {
21 |
22 | private String appKey;
23 |
24 | private String appSecret;
25 |
26 | private String masterKey;
27 |
28 | private String productId;
29 |
30 | private String productName;
31 |
32 |
33 | public String getAppKey() {
34 | return appKey;
35 | }
36 |
37 | public void setAppKey(String appKey) {
38 | this.appKey = appKey;
39 | }
40 |
41 | public String getAppSecret() {
42 | return appSecret;
43 | }
44 |
45 | public void setAppSecret(String appSecret) {
46 | this.appSecret = appSecret;
47 | }
48 |
49 | public String getMasterKey() {
50 | return masterKey;
51 | }
52 |
53 | public void setMasterKey(String masterKey) {
54 | this.masterKey = masterKey;
55 | }
56 |
57 | public String getProductId() {
58 | return productId;
59 | }
60 |
61 | public void setProductId(String productId) {
62 | this.productId = productId;
63 | }
64 |
65 | public String getProductName() {
66 | return productName;
67 | }
68 |
69 | public void setProductName(String productName) {
70 | this.productName = productName;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/telecom/domain/action/data/TelQueryDeviceCommandListBody.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.telecom.domain.action.data;
17 |
18 | import java.io.Serializable;
19 | import java.util.List;
20 |
21 | /**
22 | * @author mushuwei
23 | */
24 | public class TelQueryDeviceCommandListBody implements Serializable {
25 |
26 | private Integer pageNum;
27 |
28 | private Integer pageSize;
29 |
30 | private Integer total;
31 |
32 | private List list;
33 |
34 | public Integer getPageNum() {
35 | return pageNum;
36 | }
37 |
38 | public void setPageNum(Integer pageNum) {
39 | this.pageNum = pageNum;
40 | }
41 |
42 | public Integer getPageSize() {
43 | return pageSize;
44 | }
45 |
46 | public void setPageSize(Integer pageSize) {
47 | this.pageSize = pageSize;
48 | }
49 |
50 | public Integer getTotal() {
51 | return total;
52 | }
53 |
54 | public void setTotal(Integer total) {
55 | this.total = total;
56 | }
57 |
58 | public List getList() {
59 | return list;
60 | }
61 |
62 | public void setList(List list) {
63 | this.list = list;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/telecom/domain/action/data/TelQueryDeviceCommandListResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.telecom.domain.action.data;
17 |
18 | import iot.technology.client.toolkit.nb.service.telecom.domain.BaseTelResponse;
19 |
20 | /**
21 | * @author mushuwei
22 | */
23 | public class TelQueryDeviceCommandListResponse extends BaseTelResponse {
24 |
25 | private TelQueryDeviceCommandListBody result;
26 |
27 | public TelQueryDeviceCommandListBody getResult() {
28 | return result;
29 | }
30 |
31 | public void setResult(TelQueryDeviceCommandListBody result) {
32 | this.result = result;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/toolkit-nbiot/src/main/java/iot/technology/client/toolkit/nb/service/telecom/domain/action/data/TelQueryDeviceDataListResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019-2025 The Toolkit Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package iot.technology.client.toolkit.nb.service.telecom.domain.action.data;
17 |
18 | import com.fasterxml.jackson.annotation.JsonProperty;
19 | import iot.technology.client.toolkit.nb.service.telecom.domain.BaseTelResponse;
20 |
21 | import java.util.List;
22 |
23 | /**
24 | * @author mushuwei
25 | */
26 | public class TelQueryDeviceDataListResponse extends BaseTelResponse {
27 |
28 | @JsonProperty("page_timestamp")
29 | private String pageTimestamp;
30 |
31 | private List