Alexander Wels has posted comments on this change.

Change subject: engine: Import single certificate
......................................................................


Patch Set 30:

(7 comments)

http://gerrit.ovirt.org/#/c/35485/30/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetProviderCertificateChainQuery.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetProviderCertificateChainQuery.java:

Line 37:             List<? extends Certificate> chain = 
proxy.getCertificateChain();
Line 38:             if (!chain.isEmpty()) {
Line 39:                 List<CertificateInfo> results = new 
ArrayList<CertificateInfo>();
Line 40:                 for (Certificate cert : chain) {
Line 41:                     
results.add(createCertificateInfo((X509Certificate) cert));
Should we check that the certificate is X509? I am sure findbugs/coverity will 
complain about the blind cast.
Line 42:                 }
Line 43:                 getQueryReturnValue().setReturnValue(results);
Line 44:             }
Line 45:         } catch (Exception e) {


http://gerrit.ovirt.org/#/c/35485/30/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportProviderCertificateParameters.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportProviderCertificateParameters.java:

Line 14: 
Line 15:     public ImportProviderCertificateParameters() {
Line 16:     }
Line 17: 
Line 18:     public String getCertificate() {
This is base64 encoded string right? Might want to add some javadoc stating 
this.
Line 19:         return certificate;
Line 20:     }
Line 21: 
Line 22:     public void setCertificate(final String certificate) {


Line 18:     public String getCertificate() {
Line 19:         return certificate;
Line 20:     }
Line 21: 
Line 22:     public void setCertificate(final String certificate) {
Same as above note the base64 encoded string.
Line 23:         this.certificate = certificate;
Line 24:     }
Line 25: 


http://gerrit.ovirt.org/#/c/35485/30/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java:

Line 3046:             @Override
Line 3047:             public Object Convert(Object source, AsyncQuery 
_asyncQuery)
Line 3048:             {
Line 3049:                 if (source == null) {
Line 3050:                     return new ArrayList<CertificateInfo>();
Not sure if it matter much, but the 'better' way of getting an empty list is:

  return Collections.emptyList();

In this case however we need to specify the type:

  return Collections.<CertificateInfo>emptyList();

As the compiler cannot infer the proper return type.
Line 3051:                 }
Line 3052:                 return source;
Line 3053:             }
Line 3054:         };


http://gerrit.ovirt.org/#/c/35485/30/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java:

Line 331:                     boolean ok = false;
Line 332:                     certificate = null;
Line 333:                     if (returnValue != null) {
Line 334:                         List<CertificateInfo> certs = 
(List<CertificateInfo>) returnValue;
Line 335:                         if (certs.size() > 0) {
The 'proper' java way to test an empty list/collections is:

  if (!certs.isEmpty()) {
Line 336:                             certificate = certs.get(0).getPayload();
Line 337:                             ConfirmationModel confirmationModel =
Line 338:                                     
getImportCertificateConfirmationModel(certs.get(0));
Line 339:                             
sourceListModel.setConfirmWindow(confirmationModel);


Line 332:                     certificate = null;
Line 333:                     if (returnValue != null) {
Line 334:                         List<CertificateInfo> certs = 
(List<CertificateInfo>) returnValue;
Line 335:                         if (certs.size() > 0) {
Line 336:                             certificate = certs.get(0).getPayload();
Are we guaranteed to only get one certificate? Or could we potentially get more 
than one? If more than one should we loop over the collection?
Line 337:                             ConfirmationModel confirmationModel =
Line 338:                                     
getImportCertificateConfirmationModel(certs.get(0));
Line 339:                             
sourceListModel.setConfirmWindow(confirmationModel);
Line 340:                             ok = true;


http://gerrit.ovirt.org/#/c/35485/30/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/UIConstants_de_DE.properties
File 
frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/UIConstants_de_DE.properties:

Line 520
Line 521
Line 522
Line 523
Line 524
You don't need to manually remove these, whenever we pull the properties from 
zanate this will get over written.


-- 
To view, visit http://gerrit.ovirt.org/35485
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9adb21ded6e6d9fb09fc68331872c1cd88f88a9
Gerrit-PatchSet: 30
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Alexander Wels <aw...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Einav Cohen <eco...@redhat.com>
Gerrit-Reviewer: Greg Sheremeta <gsher...@redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vsz...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to