-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added capability to fetch certificate to send from the CertificateInf…
…oService Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
- Loading branch information
Showing
26 changed files
with
727 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | ||
<title>About</title> | ||
</head> | ||
<body lang="EN-US"> | ||
<h2>About This Content</h2> | ||
|
||
<p>November 30, 2017</p> | ||
<h3>License</h3> | ||
|
||
<p> | ||
The Eclipse Foundation makes available all content in this plug-in | ||
("Content"). Unless otherwise indicated below, the Content | ||
is provided to you under the terms and conditions of the Eclipse | ||
Public License Version 2.0 ("EPL"). A copy of the EPL is | ||
available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>. | ||
For purposes of the EPL, "Program" will mean the Content. | ||
</p> | ||
|
||
<p> | ||
If you did not receive this Content directly from the Eclipse | ||
Foundation, the Content is being redistributed by another party | ||
("Redistributor") and different terms and conditions may | ||
apply to your use of any object code in the Content. Check the | ||
Redistributor's license that was provided with the Content. If no such | ||
license exists, contact the Redistributor. Unless otherwise indicated | ||
below, the terms and conditions of the EPL still apply to any source | ||
code in the Content and such source code may be obtained at <a | ||
href="http://www.eclipse.org/">http://www.eclipse.org</a>. | ||
</p> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2017, 2021 Eurotech and/or its affiliates and others | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
Eurotech - initial API and implementation | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>kapua-console-module</artifactId> | ||
<groupId>org.eclipse.kapua</groupId> | ||
<version>1.5.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>kapua-console-module-certificate</artifactId> | ||
|
||
<dependencies> | ||
<!-- Console modules --> | ||
<dependency> | ||
<groupId>org.eclipse.kapua</groupId> | ||
<artifactId>kapua-console-module-api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<!-- GWT Maven Plugin --> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>gwt-maven-plugin</artifactId> | ||
|
||
<configuration> | ||
<module>org.eclipse.kapua.app.console.module.certificate.certificateModuleAbout</module> | ||
<i18nMessagesBundles> | ||
<i18nMessagesBundle>org.eclipse.kapua.app.console.module.certificate.client.messages.ConsoleCertificateMessages</i18nMessagesBundle> | ||
</i18nMessagesBundles> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
80 changes: 80 additions & 0 deletions
80
...rg/eclipse/kapua/app/console/module/certificate/server/GwtCertificateInfoServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.app.console.module.certificate.server; | ||
|
||
import org.eclipse.kapua.app.console.module.api.client.GwtKapuaException; | ||
import org.eclipse.kapua.app.console.module.api.server.KapuaRemoteServiceServlet; | ||
import org.eclipse.kapua.app.console.module.api.server.util.KapuaExceptionHandler; | ||
import org.eclipse.kapua.app.console.module.api.shared.util.KapuaGwtCommonsModelConverter; | ||
import org.eclipse.kapua.app.console.module.certificate.shared.model.GwtCertificateInfo; | ||
import org.eclipse.kapua.app.console.module.certificate.shared.service.GwtCertificateInfoService; | ||
import org.eclipse.kapua.commons.model.id.KapuaEid; | ||
import org.eclipse.kapua.locator.KapuaLocator; | ||
import org.eclipse.kapua.model.id.KapuaId; | ||
import org.eclipse.kapua.service.certificate.info.CertificateInfo; | ||
import org.eclipse.kapua.service.certificate.info.CertificateInfoFactory; | ||
import org.eclipse.kapua.service.certificate.info.CertificateInfoListResult; | ||
import org.eclipse.kapua.service.certificate.info.CertificateInfoQuery; | ||
import org.eclipse.kapua.service.certificate.info.CertificateInfoService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class GwtCertificateInfoServiceImpl extends KapuaRemoteServiceServlet implements GwtCertificateInfoService { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(GwtCertificateInfoServiceImpl.class); | ||
|
||
private static final KapuaLocator LOCATOR = KapuaLocator.getInstance(); | ||
|
||
private static final CertificateInfoService CERTIFICATE_INFO_SERVICE = LOCATOR.getService(CertificateInfoService.class); | ||
private static final CertificateInfoFactory CERTIFICATE_INFO_FACTORY = LOCATOR.getFactory(CertificateInfoFactory.class); | ||
|
||
@Override | ||
public List<GwtCertificateInfo> findAllCertificates(String scopeIdString) throws GwtKapuaException { | ||
try { | ||
KapuaId scopeId = KapuaEid.parseCompactId(scopeIdString); | ||
|
||
List<GwtCertificateInfo> gwtCertificateInfos = new ArrayList<GwtCertificateInfo>(); | ||
|
||
CertificateInfoQuery query = CERTIFICATE_INFO_FACTORY.newQuery(scopeId); | ||
CertificateInfoListResult certificateInfos = CERTIFICATE_INFO_SERVICE.query(query); | ||
|
||
for (CertificateInfo certificateInfo : certificateInfos.getItems()) { | ||
GwtCertificateInfo gwtCertificateInfo = new GwtCertificateInfo(); | ||
gwtCertificateInfo.setId(KapuaGwtCommonsModelConverter.convertKapuaId(certificateInfo.getId())); | ||
gwtCertificateInfo.setName(certificateInfo.getName()); | ||
|
||
gwtCertificateInfos.add(gwtCertificateInfo); | ||
} | ||
|
||
return gwtCertificateInfos; | ||
} catch (Exception e) { | ||
throw KapuaExceptionHandler.buildExceptionFromError(e); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isFindSupported() { | ||
try { | ||
CERTIFICATE_INFO_SERVICE.find(null, null); | ||
return false; | ||
} catch (UnsupportedOperationException uoe) { | ||
LOG.warn("The current deployment does not support CertificateInfoService.find(...). Some of the UI features will be disabled..."); | ||
return false; | ||
} catch (Exception e) { | ||
return true; | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...ava/org/eclipse/kapua/app/console/module/certificate/shared/model/GwtCertificateInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.app.console.module.certificate.shared.model; | ||
|
||
import com.google.gwt.user.client.rpc.IsSerializable; | ||
import org.eclipse.kapua.app.console.module.api.shared.model.GwtUpdatableEntityModel; | ||
|
||
public class GwtCertificateInfo extends GwtUpdatableEntityModel implements IsSerializable { | ||
|
||
public String getName() { | ||
return get("name"); | ||
} | ||
|
||
public void setName(String name) { | ||
set("name", name); | ||
} | ||
|
||
public String getCertificate() { | ||
return get("certificate"); | ||
} | ||
|
||
public void setCertificate(String certificate) { | ||
set("certificate", certificate); | ||
} | ||
} | ||
|
31 changes: 31 additions & 0 deletions
31
...clipse/kapua/app/console/module/certificate/shared/service/GwtCertificateInfoService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.app.console.module.certificate.shared.service; | ||
|
||
import com.google.gwt.user.client.rpc.RemoteService; | ||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; | ||
import org.eclipse.kapua.app.console.module.api.client.GwtKapuaException; | ||
import org.eclipse.kapua.app.console.module.certificate.shared.model.GwtCertificateInfo; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* This service retrieves a subset of configuration values for front-end usage. | ||
*/ | ||
@RemoteServiceRelativePath("certificateInfo") | ||
public interface GwtCertificateInfoService extends RemoteService { | ||
|
||
List<GwtCertificateInfo> findAllCertificates(String scopeIdString) throws GwtKapuaException; | ||
|
||
boolean isFindSupported(); | ||
} |
12 changes: 12 additions & 0 deletions
12
...ces/org.eclipse.kapua.app.console.module.api.client.ui.view.descriptor.MainViewDescriptor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
################################################################################ | ||
# Copyright (c) 2021 Eurotech and/or its affiliates and others | ||
# | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Eurotech - initial API and implementation | ||
################################################################################# |
25 changes: 25 additions & 0 deletions
25
...resources/org/eclipse/kapua/app/console/module/certificate/adminModuleCertificate.gwt.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- | ||
Copyright (c) 2021 Eurotech and/or its affiliates and others | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
Eurotech - initial API and implementation | ||
--> | ||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" | ||
"https://raw.githubusercontent.com/gwtproject/gwt/2.4.0/distro-source/core/src/gwt-module.dtd"> | ||
|
||
<module rename-to="adminModuleCertificate"> | ||
|
||
<inherits name="org.eclipse.kapua.app.console.module.api.adminModuleApi"/> | ||
|
||
<!-- Specify the paths for translatable code --> | ||
<source path='shared'/> | ||
<source path="client"/> | ||
|
||
</module> |
13 changes: 13 additions & 0 deletions
13
...apua/app/console/module/certificate/client/messages/ConsoleCertificateMessages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
################################################################################ | ||
# Copyright (c) 2021 Eurotech and/or its affiliates and others | ||
# | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Eurotech - initial API and implementation | ||
################################################################################# | ||
certificate=Certificate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.