Unverified Commit f46fa900 authored by Javier Guerra's avatar Javier Guerra Committed by GitHub

Merge pull request #11 from openconnectivity/develop

Merge develop into master
parents cf64dce7 a3829142
......@@ -35,7 +35,18 @@ To import the IoTivity-lite API Binary into the OTGC Linux App project:
4. Copy **libiotivity-lite.so** into <otgc-linux>/lib/jni
5. Add the following command, to link the previous libraries with iotivity.jar, in the run/debug configuration:
5. Install iotivity-lite.jar into the local Maven repository
```
mvn install:install-file \
-Dfile=lib/iotivity-lite.jar \
-DgroupId=org.iotivity \
-DartifactId=iotivity-lite \
-Dversion=1.0 \
-Dpackaging=jar \
-DgeneratePom=true
```
6. Add the following command, to link the previous libraries with iotivity.jar, in the run/debug configuration:
```
-Djava.library.path=<otgc-linux>/lib/jni
```
......@@ -54,7 +65,6 @@ git checkout swig
2. Apply all patchs of the OTGC in IoTivity-lite
```
git apply <otgc-linux>/extlibs/patchs/remove_cred_by_credid.patch
git apply <otgc-linux>/extlibs/patchs/fix_oc_api.patch
```
3. Go to the linux directory.
```
......
......@@ -11,21 +11,23 @@
# Constants
PROJECT_NAME="otgc"
VERSION="2.1.0"
VERSION="2.2.0"
program=$0
function usage()
{
echo "usage: $program app_path"
echo "usage: $program app_path arch"
echo " path Path to assets, libraries and application jar"
echo " arch Target architecture (see values with the command dpkg-architecture -L)"
exit 1
}
if [ $# -ne 1 ] ; then
if [ $# -ne 2 ] ; then
usage
else
path=$1
arch=$2
mkdir $(pwd)/out
......@@ -40,12 +42,17 @@ else
mkdir -p $(pwd)/out/$PROJECT_NAME-$VERSION/usr/share/applications # item desktop
# Copy configuration and script files to DEBIAN folder
if [ -e "$(pwd)/control" ]
if [ -e "$(pwd)/template_control.sh" ]
then
cp $(pwd)/control $(pwd)/out/$PROJECT_NAME-$VERSION/DEBIAN
else
echo "Control file does not exist."
exit 1
chmod 755 $(pwd)/template_control.sh
if [ -e "$(pwd)/out/control" ]
then
rm $(pwd)/out/control
fi
$(pwd)/template_control.sh "$VERSION" $arch > $(pwd)/out/control
chmod 755 $(pwd)/out/control
cp $(pwd)/out/control $(pwd)/out/$PROJECT_NAME-$VERSION/DEBIAN
rm $(pwd)/out/control
fi
# Pre-Installation script
if [ -e "$(pwd)/template_preinst.sh" ]
......
#!/bin/bash
# Define parameters which are passed in
VERSION=$1
ARCH=$2
# Define the template
cat << EOF
Package: OTGC
Version: 2.1.0
Version: $VERSION
Section: custom
Priority: optional
Architecture: amd64
Architecture: $ARCH
Pre-Depends: openjdk-8-jdk, openjfx
Maintainer: DEKRA Testing and Certification, S.A.U.
Description: Onboarding Tool and Generic Client.
EOF
iotivity-lite @ 66a2d087
Subproject commit d301b81dc3ce39f477318be219ede1d9ab835940
Subproject commit 66a2d08784903110b7dead5b9a518933a355e1e6
diff --git a/swig/swig_interfaces/oc_api.i b/swig/swig_interfaces/oc_api.i
index e600456c..47ff85cb 100644
--- a/swig/swig_interfaces/oc_api.i
+++ b/swig/swig_interfaces/oc_api.i
@@ -1372,7 +1372,7 @@ bool jni_oc_init_post(const char *uri, oc_endpoint_t *endpoint, const char *quer
OC_DBG("JNI - initPost failed releasing jni_sync_lock");
OC_DBG("JNI: - unlock %s\n", __func__);
}
- return returnValue
+ return returnValue;
}
%}
......@@ -6,7 +6,7 @@
<groupId>otgc</groupId>
<artifactId>otgc</artifactId>
<version>2.1.0</version>
<version>2.2.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -73,7 +73,7 @@
</goals>
<configuration>
<!-- <outputDirectory>${project.build.directory}/classes/lib</outputDirectory> -->
<outputDirectory>${build.directory}/jfx/app/lib</outputDirectory>
<outputDirectory>${project.build.directory}/jfx/app/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
......@@ -98,8 +98,6 @@
<groupId>org.iotivity</groupId>
<artifactId>iotivity-lite</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/iotivity-lite.jar</systemPath>
</dependency>
<!-- -->
<dependency>
......@@ -168,25 +166,19 @@
<artifactId>hsqldb</artifactId>
<version>2.4.0</version>
</dependency>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- JUnit -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-junit</artifactId>
<version>2.0.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- Mockito -->
<dependency>
<groupId>org.mockito</groupId>
......@@ -238,11 +230,5 @@
<artifactId>cbor</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -276,9 +276,7 @@ public class CmsRepository {
return Completable.create(emitter -> {
OCUuid di = OCUuidUtil.stringToUuid(deviceId);
OCRole role = new OCRole();
role.setRole(roleId);
role.setAuthority(roleAuthority);
OCRole roles = OCObt.addRoleId(null, roleId, roleAuthority);
OCObtStatusHandler handler = (int status) -> {
if (status >= 0) {
......@@ -289,9 +287,10 @@ public class CmsRepository {
}
};
int ret = OCObt.provisionRoleCertificate(role, di, handler);
int ret = OCObt.provisionRoleCertificate(roles, di, handler);
if (ret < 0) {
emitter.onError(new IOException("Provision role certificate error"));
OCObt.freeRoleId(roles);
}
});
}
......
......@@ -45,8 +45,8 @@ public class DeleteAclUseCase {
public Completable execute(Device device, long aceId) {
return iotivityRepository.getSecureEndpoint(device)
.flatMapCompletable(endpoint ->
pstatRepository.changeDeviceStatus(device.getIpv6SecureHost(), device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFPRO)
.andThen(amsRepository.deleteAcl(device.getIpv6SecureHost(), device.getDeviceId(), aceId))
.andThen(pstatRepository.changeDeviceStatus(device.getIpv6SecureHost(), device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFNOP)));
pstatRepository.changeDeviceStatus(endpoint, device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFPRO)
.andThen(amsRepository.deleteAcl(endpoint, device.getDeviceId(), aceId))
.andThen(pstatRepository.changeDeviceStatus(endpoint, device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFNOP)));
}
}
......@@ -19,12 +19,11 @@
package org.openconnectivity.otgc.utils.constant;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
public class OcfResourceAttributeKey {
private OcfResourceAttributeKey() {
throw new NotImplementedException();
private OcfResourceAttributeKey() throws Exception {
throw new Exception("Static class");
}
/* Resource base */
......
......@@ -19,12 +19,11 @@
package org.openconnectivity.otgc.utils.constant;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
public class OcfResourceUri {
private OcfResourceUri() {
throw new NotImplementedException();
private OcfResourceUri() throws Exception {
throw new Exception("Static class");
}
// URIs
......
......@@ -19,14 +19,12 @@
package org.openconnectivity.otgc.utils.constant;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.io.File;
public class OtgcConstant {
private OtgcConstant() {
throw new NotImplementedException();
private OtgcConstant() throws Exception {
throw new Exception("Static class");
}
// Data resource path
......
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXCheckBox?>
<?import com.jfoenix.controls.JFXRadioButton?>
<?import com.jfoenix.controls.JFXTextField?>
<?import com.jfoenix.controls.JFXCheckBox?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<!--
~ Copyright 2018 DEKRA Testing and Certification, S.A.U. All Rights Reserved.
~
......@@ -29,84 +34,75 @@
~
-->
<AnchorPane maxHeight="1000" maxWidth="Infinity" minHeight="300" minWidth="400"
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="org.openconnectivity.otgc.view.accesscontrol.AccessControlView">
<AnchorPane maxHeight="1000" maxWidth="Infinity" minHeight="300" minWidth="400" xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.openconnectivity.otgc.view.accesscontrol.AccessControlView">
<children>
<GridPane fx:id="amsGrid" AnchorPane.topAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.leftAnchor="0.0">
<GridPane fx:id="amsGrid" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints>
<ColumnConstraints percentWidth="50.0" halignment="CENTER" hgrow="ALWAYS" />
<ColumnConstraints percentWidth="50.0" halignment="CENTER" hgrow="ALWAYS" />
<ColumnConstraints halignment="CENTER" hgrow="ALWAYS" percentWidth="50.0" />
<ColumnConstraints halignment="CENTER" hgrow="ALWAYS" percentWidth="50.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints valignment="CENTER" vgrow="ALWAYS" />
</rowConstraints>
<children>
<AnchorPane GridPane.columnIndex="0" prefWidth="100">
<AnchorPane GridPane.columnIndex="0">
<children>
<ListView fx:id="amsListView" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="0.0"/>
<ListView fx:id="amsListView" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
<AnchorPane GridPane.columnIndex="1" prefWidth="100">
<AnchorPane GridPane.columnIndex="1">
<children>
<ScrollPane AnchorPane.topAnchor="0.0" AnchorPane.bottomAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.leftAnchor="0.0">
<ScrollPane fitToHeight="true" fitToWidth="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<content>
<VBox spacing="20" >
<VBox spacing="20">
<children>
<VBox alignment="CENTER_LEFT" spacing="7">
<VBox alignment="CENTER_LEFT" spacing="7" VBox.vgrow="ALWAYS">
<children>
<Label text="%accesscontrol.label.subject_type" />
<JFXRadioButton fx:id="uuidRadioButton" selected="true" text="%accesscontrol.radiobutton.uuid"
onAction="#handleSubjectGroup">
<JFXRadioButton fx:id="uuidRadioButton" onAction="#handleSubjectGroup" selected="true" text="%accesscontrol.radiobutton.uuid">
<toggleGroup>
<ToggleGroup fx:id="toggleSubjectGroup"/>
<ToggleGroup fx:id="toggleSubjectGroup" />
</toggleGroup>
</JFXRadioButton>
<JFXRadioButton fx:id="roleRadioButton" selected="false" onAction="#handleSubjectGroup"
text="%accesscontrol.radiobutton.role" toggleGroup="$toggleSubjectGroup" />
<JFXRadioButton fx:id="conntypeRadioButton" selected="false" onAction="#handleSubjectGroup"
text="%accesscontrol.radiobutton.conntype" toggleGroup="$toggleSubjectGroup" />
<JFXRadioButton fx:id="roleRadioButton" onAction="#handleSubjectGroup" selected="false" text="%accesscontrol.radiobutton.role" toggleGroup="$toggleSubjectGroup" />
<JFXRadioButton fx:id="conntypeRadioButton" onAction="#handleSubjectGroup" selected="false" text="%accesscontrol.radiobutton.conntype" toggleGroup="$toggleSubjectGroup" />
</children>
</VBox>
<VBox alignment="CENTER_LEFT" spacing="7">
<VBox alignment="CENTER_LEFT" spacing="7" VBox.vgrow="ALWAYS">
<children>
<JFXTextField fx:id="uuidTextField" labelFloat="true" promptText="%accesscontrol.label.uuid" />
<HBox fx:id="roleBox" spacing="5" disable="true">
<HBox fx:id="roleBox" disable="true" spacing="5">
<children>
<JFXTextField fx:id="roleidTextField" labelFloat="true" promptText="%accesscontrol.label.role_id" />
<JFXTextField fx:id="authorityTextField" labelFloat="true" promptText="%accesscontrol.label.role_authority" />
</children>
</HBox>
<VBox fx:id="conntypeBox" spacing="7" disable="true">
<VBox fx:id="conntypeBox" disable="true" spacing="7">
<children>
<Label text="%accesscontrol.label.conntype" />
<JFXRadioButton fx:id="anonRadioButton" selected="true" text="%accesscontrol.radiobutton.anon">
<toggleGroup>
<ToggleGroup fx:id="toggleConnGroup"/>
<ToggleGroup fx:id="toggleConnGroup" />
</toggleGroup>
</JFXRadioButton>
<JFXRadioButton fx:id="authRadioButton" selected="false"
text="%accesscontrol.radiobutton.auth" toggleGroup="$toggleConnGroup" />
<JFXRadioButton fx:id="authRadioButton" selected="false" text="%accesscontrol.radiobutton.auth" toggleGroup="$toggleConnGroup" />
</children>
</VBox>
</children>
</VBox>
<HBox>
<JFXCheckBox fx:id="wildcardCheck" text="%accesscontrol.checkbox.wildcard"
onMouseClicked="#handleWildcardCheck"/>
<HBox VBox.vgrow="ALWAYS">
<JFXCheckBox fx:id="wildcardCheck" onMouseClicked="#handleWildcardCheck" text="%accesscontrol.checkbox.wildcard" />
</HBox>
<VBox fx:id="wildcardBox" disable="true" spacing="10">
<VBox fx:id="wildcardBox" disable="true" spacing="10" VBox.vgrow="ALWAYS">
<children>
<JFXCheckBox fx:id="wcAll" text="%accesscontrol.checkbox.wc_all" />
<JFXCheckBox fx:id="wcAllSecure" text="%accesscontrol.checkbox.wc_all_secure" />
<JFXCheckBox fx:id="wcAllPublic" text="%accesscontrol.checkbox.wc_all_public" />
</children>
</VBox>
<HBox>
<HBox VBox.vgrow="ALWAYS">
<children>
<ListView fx:id="verticalResourcesList" prefHeight="100" />
<ListView fx:id="verticalResourcesList" minHeight="200.0" HBox.hgrow="ALWAYS" />
</children>
</HBox>
<HBox alignment="CENTER_LEFT" spacing="7">
......@@ -120,8 +116,8 @@
</HBox>
<HBox alignment="CENTER_RIGHT" spacing="7">
<children>
<JFXButton fx:id="saveButton" text="%accesscontrol.button.save" onAction="#handleSaveACL" />
<JFXButton fx:id="deleteButton" text="%accesscontrol.button.delete" onAction="#handleDeleteACL" />
<JFXButton fx:id="saveButton" onAction="#handleSaveACL" text="%accesscontrol.button.save" />
<JFXButton fx:id="deleteButton" onAction="#handleDeleteACL" text="%accesscontrol.button.delete" />
</children>
</HBox>
</children>
......
......@@ -73,8 +73,8 @@ settings.label.discovery_scope=Multicast IPv6 scope
settings.title.discovery_scope=Select IPv6 scope
settings.label.requests_delay=Requests delay
# Main
main.init_oic_stack.success=OIC Stack initialized
main.init_oic_stack.error=Error initializing OIC Stack
main.init_oic_stack.success=IoTivity-lite stack initialized
main.init_oic_stack.error=Error initializing IoTivity-lite stack
# Device List
devicelist.scan.load=Scanning devices...
devicelist.scan.success=Scanning devices finished
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment