Skip to content

Commit

Permalink
Fixed retrieval of CertificateInfos
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Jul 13, 2021
1 parent 2fca7c0 commit b9fa30c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -42,13 +42,15 @@ public class GwtCertificateInfoServiceImpl extends KapuaRemoteServiceServlet imp
private static final CertificateInfoFactory CERTIFICATE_INFO_FACTORY = LOCATOR.getFactory(CertificateInfoFactory.class);

@Override
public List<GwtCertificateInfo> findAllCertificates(String scopeIdString) throws GwtKapuaException {
public List<GwtCertificateInfo> findAll(String scopeIdString) throws GwtKapuaException {
try {
KapuaId scopeId = KapuaEid.parseCompactId(scopeIdString);

List<GwtCertificateInfo> gwtCertificateInfos = new ArrayList<GwtCertificateInfo>();

CertificateInfoQuery query = CERTIFICATE_INFO_FACTORY.newQuery(scopeId);
query.setIncludeInherited(true);

CertificateInfoListResult certificateInfos = CERTIFICATE_INFO_SERVICE.query(query);

for (CertificateInfo certificateInfo : certificateInfos.getItems()) {
Expand Down
Expand Up @@ -25,7 +25,7 @@
@RemoteServiceRelativePath("certificateInfo")
public interface GwtCertificateInfoService extends RemoteService {

List<GwtCertificateInfo> findAllCertificates(String scopeIdString) throws GwtKapuaException;
List<GwtCertificateInfo> findAll(String scopeIdString) throws GwtKapuaException;

boolean isFindSupported();
}
Expand Up @@ -156,7 +156,7 @@ public void onSuccess(List<GwtDeviceKeystore> gwtKeystores) {
}
});

GWT_CERTIFICATE_INFO_SERVICE.findAllCertificates(gwtDevice.getScopeId(), new AsyncCallback<List<GwtCertificateInfo>>() {
GWT_CERTIFICATE_INFO_SERVICE.findAll(gwtDevice.getScopeId(), new AsyncCallback<List<GwtCertificateInfo>>() {
@Override
public void onFailure(Throwable t) {
certificateInfoCombo.setEmptyText("Error while loading certificate info!");
Expand Down

0 comments on commit b9fa30c

Please sign in to comment.