Unverified Commit 975cd529 authored by Javier Guerra's avatar Javier Guerra Committed by GitHub

Merge pull request #15 from openconnectivity/develop

Merge develop into master
parents 6b6057b9 ec19f6f9
......@@ -11,7 +11,7 @@
# Constants
PROJECT_NAME="otgc"
VERSION="2.5.0"
VERSION="2.6.0"
program=$0
......
......@@ -6,7 +6,7 @@
<groupId>otgc</groupId>
<artifactId>otgc</artifactId>
<version>2.5.0</version>
<version>2.6.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
......@@ -22,6 +22,7 @@ import com.jfoenix.controls.JFXButton;
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import javafx.beans.binding.Bindings;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
......@@ -31,6 +32,8 @@ import javafx.stage.Stage;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.encoders.Base64;
import org.openconnectivity.otgc.domain.model.resource.secure.cred.OcCredential;
import org.openconnectivity.otgc.utils.util.Toast;
import org.openconnectivity.otgc.utils.viewmodel.Response;
import org.openconnectivity.otgc.viewmodel.TrustAnchorViewModel;
import javax.inject.Inject;
......@@ -50,17 +53,23 @@ public class TrustAnchorView implements FxmlView<TrustAnchorViewModel>, Initiali
@Inject
private Stage primaryStage;
private ResourceBundle resourceBundle;
@FXML private ListView<OcCredential> listView;
@FXML private JFXButton infoCaButton;
@FXML private JFXButton removeCaButton;
@Override
public void initialize(URL location, ResourceBundle resources) {
this.resourceBundle = resourceBundle;
viewModel.retrieveTrustAnchors();
listView.itemsProperty().bind(viewModel.trustAnchorListProperty());
listView.setCellFactory(deviceListView -> new TrustAnchorViewCell());
viewModel.storeTrustAnchorResponseProperty().addListener(this::processStoreTrustAnchorResponse);
infoCaButton.disableProperty().bind(Bindings.createBooleanBinding(() ->
listView.getSelectionModel().getSelectedItem() == null,
listView.getSelectionModel().selectedItemProperty()));
......@@ -139,6 +148,16 @@ public class TrustAnchorView implements FxmlView<TrustAnchorViewModel>, Initiali
}
}
private void processStoreTrustAnchorResponse(ObservableValue<? extends Response<Void>> obs, Response<Void> oldValue, Response<Void> newValue) {
switch (newValue.status) {
case ERROR:
Toast.show(primaryStage, resourceBundle.getString("trustanchor.create_cred.error"));
break;
default:
break;
}
}
@FXML
public void handleRemoveCaButton() {
viewModel.removeTrustAnchorByCredid(listView.getSelectionModel().getSelectedItem().getCredid());
......
......@@ -53,6 +53,7 @@ public class TrustAnchorViewModel implements ViewModel {
public ListProperty<OcCredential> trustAnchorListProperty() {
return trustAnchorList;
}
private final ObjectProperty<Response<Void>> storeTrustAnchorResponse = new SimpleObjectProperty<>();
@Inject
public TrustAnchorViewModel(SchedulersFacade schedulersFacade,
......@@ -65,6 +66,10 @@ public class TrustAnchorViewModel implements ViewModel {
this.remoteRemoveTrustAnchorByCredidUseCase = remoteRemoveTrustAnchorByCredidUseCase;
}
public ObjectProperty<Response<Void>> storeTrustAnchorResponseProperty() {
return storeTrustAnchorResponse;
}
public void retrieveTrustAnchors() {
disposable.add(getTrustAnchorUseCase.execute()
.subscribeOn(schedulersFacade.io())
......@@ -82,7 +87,7 @@ public class TrustAnchorViewModel implements ViewModel {
.observeOn(schedulersFacade.ui())
.subscribe(
() -> retrieveTrustAnchors(),
throwable -> {}
throwable -> storeTrustAnchorResponse.set(Response.error(throwable))
));
}
......
-----BEGIN CERTIFICATE-----
MIIEEzCCA7mgAwIBAgIJAI0K+3tTskzXMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM
MIIEEzCCA7mgAwIBAgIJAI0K+3tTsk0AMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM
A09DRjEiMCAGA1UECwwZS3lyaW8gVGVzdCBJbmZyYXN0cnVjdHVyZTEnMCUGA1UE
AwweS3lyaW8gVEVTVCBJbnRlcm1lZGlhdGUgQ0EwMDAyMB4XDTE5MDkyMzA5MjUx
OFoXDTE5MTAyMzA5MjUxO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IwUDAJAgECAgEAAgEAMDYMGTEuMy42LjEuNC4xLjUx
NDE0LjAuMC4xLjAMGTEuMy42LjEuNC4xLjUxNDE0LjAuMC4yLjAMBE9UR0MMBURF
S1JBMCoGCisGAQQBg5FWAQEEHDAaBgsrBgEEAYORVgEBAAYLKwYBBAGDkVYBAQEw
MAYKKwYBBAGDkVYBAgQiMCAMDjEuMy42LjEuNC4xLjcxDAlEaXNjb3ZlcnkMAzEu
MDAKBggqhkjOPQQDAgNIADBFAiBLKD1R5LUOUJdMq2VWlzbzpZjvLeN1CFQIPS4y
cjbm9wIhANmGPf7y8/s/fKWy/dEaIGjo79lButKOe0JWZaburW3P
MDAKBggqhkjOPQQDAgNIADBFAiEA3Ay4oPSGwARJWub9/k58xiqARpRKjCDaGGZi
mHTurqYCIC/e7Y9NAMiweZZ2JaGAYXC7T8YTqAFneT9jaq2o3c9m
-----END CERTIFICATE-----
-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIChO1xeRf0WA/npKbjLKPzlnTDhE7v95O5ZG2fhZbBjLoAoGCCqGSM49
AwEHoUQDQgAEI1ezCcJDuCeD1keCoG1R6xR0kIqRzETbu9ODj5pwEEN7ZxIY52MZ
9Ezgw7zfGHpBOb6Awzl/fJmKcYT2uYc+dg==
MHcCAQEEIDUCAKRYHFbz7MVYj4LASsOxX54sYcVNbE4MLwIa/0j/oAoGCCqGSM49
AwEHoUQDQgAE1ndLf+RmoRDFEm/HYWjiGXUwxw03pW1ln40sQOjoXDMtbihnsAoO
3tkdmUyu2TP7YSkl7jMsDdCVwOgaFvaJ/A==
-----END EC PRIVATE KEY-----
......@@ -163,6 +163,7 @@ linkdevices.radiobutton.uuid=UUID
linkdevices.radiobutton.role=Role
linkdevices.label.role_id=Role ID
linkdevices.label.role_authority= Role authority
trustanchor.create_cred.error=Cannot store root certificate from the selected location
## Dialog
dialog.title.select_oxm=Select OTM
......
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