Migrate aaa-cert to JDT annotations 45/77545/4
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 6 Nov 2018 14:33:23 +0000 (15:33 +0100)
committerRobert Varga <nite@hq.sk>
Tue, 6 Nov 2018 15:59:03 +0000 (15:59 +0000)
Remove use of JSR305 annotations in favor of JDT ones.

Change-Id: I4be5568a792a7b78a4636a28d3c20883f01a1f28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-cert/src/main/java/org/opendaylight/aaa/cert/api/IAaaCertMdsalProvider.java
aaa-cert/src/main/java/org/opendaylight/aaa/cert/api/IAaaCertProvider.java
aaa-cert/src/main/java/org/opendaylight/aaa/cert/api/ICertificateManager.java

index fbf2a21988add7d179b242b58a2fc6d76b3ec69f..a21bc0d4a08fec4d9293af36d3209b2595d6cd2b 100644 (file)
@@ -5,12 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.aaa.cert.api;
 
 import java.security.KeyStore;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.mdsal.rev160321.key.stores.SslData;
 
 /**
@@ -37,10 +36,10 @@ public interface IAaaCertMdsalProvider {
      *     ,TLSv1.2 protocols should be separated by ","
      * @return the created SslData object
      */
-    SslData addSslDataKeystores(@Nonnull String bundleName, @Nonnull String odlKeystoreName,
-            @Nonnull String odlKeystorePwd, @Nonnull String odlKeystoreAlias, @Nonnull String odlKeystoreDname,
-            @Nonnull String trustKeystoreName, @Nonnull String trustKeystorePwd, @Nonnull String[] cipherSuites,
-            @Nonnull String tlsProtocols);
+    SslData addSslDataKeystores(@NonNull String bundleName, @NonNull String odlKeystoreName,
+            @NonNull String odlKeystorePwd, @NonNull String odlKeystoreAlias, @NonNull String odlKeystoreDname,
+            @NonNull String trustKeystoreName, @NonNull String trustKeystorePwd, @NonNull String[] cipherSuites,
+            @NonNull String tlsProtocols);
 
     /**
      * Add SslData object to Mdsal.
@@ -61,11 +60,11 @@ public interface IAaaCertMdsalProvider {
      *     protocols should be separated by ","
      * @return the created SslData object
      */
-    SslData addSslDataKeystores(@Nonnull String bundleName, @Nonnull String odlKeystoreName,
-            @Nonnull String odlKeystorePwd, @Nonnull String odlKeystoreAlias, @Nonnull String odlKeystoreDname,
-            @Nonnull String odlKeystoreKeyAlg, @Nonnull String odlKeystoreSignAlg, @Nonnull int odlKeystoreKeysize,
-            @Nonnull int odlKeystoreValidity, @Nonnull String trustKeystoreName, @Nonnull String trustKeystorePwd,
-            @Nonnull String[] cipherSuites, @Nonnull String tlsProtocols);
+    SslData addSslDataKeystores(@NonNull String bundleName, @NonNull String odlKeystoreName,
+            @NonNull String odlKeystorePwd, @NonNull String odlKeystoreAlias, @NonNull String odlKeystoreDname,
+            @NonNull String odlKeystoreKeyAlg, @NonNull String odlKeystoreSignAlg, int odlKeystoreKeysize,
+            int odlKeystoreValidity, @NonNull String trustKeystoreName, @NonNull String trustKeystorePwd,
+            @NonNull String[] cipherSuites, @NonNull String tlsProtocols);
 
     /**
      * add a ODL signed certificate that is signed by a CA based on a certificate request generated by
@@ -76,8 +75,8 @@ public interface IAaaCertMdsalProvider {
      * @param certificate as string
      * @return true for successful added certificate
      */
-    boolean addODLStoreSignedCertificate(@Nonnull String bundleName, @Nonnull String alias,
-            @Nonnull String certificate);
+    boolean addODLStoreSignedCertificate(@NonNull String bundleName, @NonNull String alias,
+            @NonNull String certificate);
 
     /**
      * Add a network node certificate to the trust keystore.
@@ -87,14 +86,14 @@ public interface IAaaCertMdsalProvider {
      * @param certificate as string
      * @return true for successful added certificate
      */
-    boolean addTrustNodeCertificate(@Nonnull String bundleName, @Nonnull String alias, @Nonnull String certificate);
+    boolean addTrustNodeCertificate(@NonNull String bundleName, @NonNull String alias, @NonNull String certificate);
 
     /**
      * Export the ODL keystore and Trust keystore to a file under karaf ssl/ directory.
      *
      * @param bundleName name of the bundle that will use the keystores
      */
-    void exportSslDataKeystores(@Nonnull String bundleName);
+    void exportSslDataKeystores(@NonNull String bundleName);
 
     /**
      * Generate a certificate request to be signed by a CA with default sign algorithm SHA1WithRSAEncryption.
@@ -103,7 +102,7 @@ public interface IAaaCertMdsalProvider {
      * @param withTag boolean to add cert-req tag to the return string
      * @return certificate request as string
      */
-    String genODLKeyStoreCertificateReq(@Nonnull String bundleName, boolean withTag);
+    String genODLKeyStoreCertificateReq(@NonNull String bundleName, boolean withTag);
 
     /**
      * Get the ODL keystore certificate.
@@ -112,8 +111,7 @@ public interface IAaaCertMdsalProvider {
      * @param withTag  boolean to add cert tag to the return string
      * @return certificate as string
      */
-    @Nullable
-    String getODLStoreCertificate(@Nonnull String bundleName, boolean withTag);
+    @Nullable String getODLStoreCertificate(@NonNull String bundleName, boolean withTag);
 
     /**
      * Get a Network node certificate from the Trust keystore.
@@ -123,8 +121,7 @@ public interface IAaaCertMdsalProvider {
      * @param withTag  boolean to add cert tag to the return string
      * @return certificate as string
      */
-    @Nullable
-    String getTrustStoreCertificate(@Nonnull String bundleName, @Nonnull String alias,  boolean withTag);
+    @Nullable String getTrustStoreCertificate(@NonNull String bundleName, @NonNull String alias,  boolean withTag);
 
     /**
      * Get the SslData.
@@ -132,7 +129,7 @@ public interface IAaaCertMdsalProvider {
      * @param bundleName name of the bundle that will use the keystores
      * @return the SslData
      */
-    SslData getSslData(@Nonnull String bundleName);
+    SslData getSslData(@NonNull String bundleName);
 
     /**
      * Get the ODL keystore object to be used by the SSLContext to establish the SSL connection.
@@ -140,7 +137,7 @@ public interface IAaaCertMdsalProvider {
      * @param bundleName name of the bundle that will use the keystores
      * @return ODL keystore
      */
-    KeyStore getODLKeyStore(@Nonnull String bundleName);
+    KeyStore getODLKeyStore(@NonNull String bundleName);
 
     /**
      * Get the trust keystore object to be used by the SSLContext to establish the SSL connection.
@@ -148,7 +145,7 @@ public interface IAaaCertMdsalProvider {
      * @param bundleName name of the bundle that will use the keystores
      * @return Trust keystore
      */
-    KeyStore getTrustKeyStore(@Nonnull String bundleName);
+    KeyStore getTrustKeyStore(@NonNull String bundleName);
 
     /**
      * Get array of cipher suites that will be used in to establish the SSL connection.
@@ -156,7 +153,7 @@ public interface IAaaCertMdsalProvider {
      * @param bundleName name of the bundle that will use the keystores
      * @return Cipher Suites
      */
-    String[] getCipherSuites(@Nonnull String bundleName);
+    String[] getCipherSuites(@NonNull String bundleName);
 
     /**
      * Get list of the supported TLS protocols.
@@ -164,7 +161,7 @@ public interface IAaaCertMdsalProvider {
      * @param bundleName of the required TLS protocols
      * @return TLS protocols
      */
-    String[] getTlsProtocols(@Nonnull String bundleName);
+    String[] getTlsProtocols(@NonNull String bundleName);
 
     /**
      * Create SslData based on pre-established keystores for ODL and network nodes.
@@ -182,10 +179,10 @@ public interface IAaaCertMdsalProvider {
      *     protocols should be separated by ","
      * @return the created SslData object
      */
-    SslData importSslDataKeystores(@Nonnull String bundleName, @Nonnull String odlKeystoreName,
-            @Nonnull String odlKeystorePwd, @Nonnull String odlKeystoreAlias, @Nonnull KeyStore odlKeyStore,
-            @Nonnull String trustKeystoreName, @Nonnull String trustKeystorePwd, @Nonnull KeyStore trustKeyStore,
-            @Nonnull String[] cipherSuites, @Nonnull String tlsProtocols);
+    SslData importSslDataKeystores(@NonNull String bundleName, @NonNull String odlKeystoreName,
+            @NonNull String odlKeystorePwd, @NonNull String odlKeystoreAlias, @NonNull KeyStore odlKeyStore,
+            @NonNull String trustKeystoreName, @NonNull String trustKeystorePwd, @NonNull KeyStore trustKeyStore,
+            @NonNull String[] cipherSuites, @NonNull String tlsProtocols);
 
     /**
      * Delete the SslData from Mdsal.
@@ -193,7 +190,7 @@ public interface IAaaCertMdsalProvider {
      * @param bundleName name of the bundle that will use the keystores
      * @return true for succeed delete
      */
-    boolean removeSslData(@Nonnull String bundleName);
+    boolean removeSslData(@NonNull String bundleName);
 
     /**
      * Update the SslData.
@@ -201,7 +198,7 @@ public interface IAaaCertMdsalProvider {
      * @param sslData SSL Data
      * @return the updated SslData object
      */
-    SslData updateSslData(@Nonnull SslData sslData);
+    SslData updateSslData(@NonNull SslData sslData);
 
     /**
      * Initialize the Keystore data tree at Mdsal.
index 9f365834bf5f9144aad63babe97fb4b03cc2ae6c..6ea194e5d956b4ea039d89dcb5f23c9d257f1d5d 100644 (file)
@@ -5,11 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.aaa.cert.api;
 
 import java.security.KeyStore;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa.cert.service.config.CtlKeystore;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa.cert.service.config.TrustKeystore;
 
@@ -17,7 +16,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa
  * IAaaCertProvider defines the basic operation for certificates management.
  *
  * @author mserngawy
- *
  */
 public interface IAaaCertProvider {
 
@@ -30,7 +28,7 @@ public interface IAaaCertProvider {
      * @param certificate certificate @Nonnull String
      * @return true at successful adding certificate
      */
-    boolean addCertificateODLKeyStore(@Nonnull String storePasswd, @Nonnull String alias, @Nonnull String certificate);
+    boolean addCertificateODLKeyStore(@NonNull String storePasswd, @NonNull String alias, @NonNull String certificate);
 
     /**
      * Add certificate to ODL keystore, the certificate should be signed
@@ -40,7 +38,7 @@ public interface IAaaCertProvider {
      * @param certificate certificate @Nonnull String
      * @return true at successful adding certificate
      */
-    boolean addCertificateODLKeyStore(@Nonnull String alias, @Nonnull String certificate);
+    boolean addCertificateODLKeyStore(@NonNull String alias, @NonNull String certificate);
 
     /**
      * Add certificate to Trust keystore.
@@ -50,7 +48,7 @@ public interface IAaaCertProvider {
      * @param certificate certificate @Nonnull String
      * @return true at successful adding certificate
      */
-    boolean addCertificateTrustStore(@Nonnull String storePasswd, @Nonnull String alias, @Nonnull String certificate);
+    boolean addCertificateTrustStore(@NonNull String storePasswd, @NonNull String alias, @NonNull String certificate);
 
     /**
      * Add certificate to Trust keystore.
@@ -59,7 +57,7 @@ public interface IAaaCertProvider {
      * @param certificate certificate @Nonnull String
      * @return true if certificate was added successfully
      */
-    boolean addCertificateTrustStore(@Nonnull String alias, @Nonnull String certificate);
+    boolean addCertificateTrustStore(@NonNull String alias, @NonNull String certificate);
 
     /**
      * Generate certificate request from the ODL keystore to be signed by a CA.
@@ -68,7 +66,7 @@ public interface IAaaCertProvider {
      * @param withTag return the certificate Req string with tag if true
      * @return the certificate request
      */
-    @Nonnull String genODLKeyStoreCertificateReq(@Nonnull String storePasswd, boolean withTag);
+    @NonNull String genODLKeyStoreCertificateReq(@NonNull String storePasswd, boolean withTag);
 
     /**
      * Generate certificate request from the ODL keystore to be signed by a CA.
@@ -76,7 +74,7 @@ public interface IAaaCertProvider {
      * @param withTag return the certificate Req string with tag if true
      * @return the certificate request
      */
-    @Nonnull String genODLKeyStoreCertificateReq(boolean withTag);
+    @NonNull String genODLKeyStoreCertificateReq(boolean withTag);
 
     /**
      * Get certificate from the Trust keystore.
@@ -86,7 +84,7 @@ public interface IAaaCertProvider {
      * @param withTag return the certificate string with tag if true
      * @return the certificate
      */
-    @Nonnull String getCertificateTrustStore(@Nonnull String storePasswd, @Nonnull String alias, boolean withTag);
+    @NonNull String getCertificateTrustStore(@NonNull String storePasswd, @NonNull String alias, boolean withTag);
 
     /**
      * Get certificate from the Trust keystore.
@@ -95,7 +93,7 @@ public interface IAaaCertProvider {
      * @param withTag return certificate string with tag if true
      * @return the certificate
      */
-    @Nonnull String getCertificateTrustStore(@Nonnull String alias, boolean withTag);
+    @NonNull String getCertificateTrustStore(@NonNull String alias, boolean withTag);
 
     /**
      * Get ODL keystore certificate.
@@ -104,7 +102,7 @@ public interface IAaaCertProvider {
      * @param withTag return certificate string with tag if true
      * @return the certificate
      */
-    @Nonnull String getODLKeyStoreCertificate(@Nonnull String storePasswd, boolean withTag);
+    @NonNull String getODLKeyStoreCertificate(@NonNull String storePasswd, boolean withTag);
 
     /**
      * Get ODL keystore certificate.
@@ -112,7 +110,7 @@ public interface IAaaCertProvider {
      * @param withTag return certificate string with tag if true
      * @return the certificate
      */
-    @Nonnull String getODLKeyStoreCertificate(boolean withTag);
+    @NonNull String getODLKeyStoreCertificate(boolean withTag);
 
     /**
      * Get ODL Keystore as java keystore object.
index 58b98e16b96775a43cc0fff0cf90aec023c9e1b2..8ee00a313cb7e3bbe2c9c4ab11b2ef1aeeb3d45b 100644 (file)
@@ -5,12 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.aaa.cert.api;
 
 import java.security.KeyStore;
-import javax.annotation.Nonnull;
 import javax.net.ssl.SSLContext;
+import org.eclipse.jdt.annotation.NonNull;
 
 /**
  * ICertifcateManager defines the basic functions that are consumed by other bundles to establish the SSLContext.
@@ -56,7 +55,7 @@ public interface ICertificateManager {
      * @param withTag return the certificate string with tag if true
      * @return the certificate
      */
-    @Nonnull String getCertificateTrustStore(@Nonnull String storePasswd, @Nonnull String alias, boolean withTag);
+    @NonNull String getCertificateTrustStore(@NonNull String storePasswd, @NonNull String alias, boolean withTag);
 
     /**
      * Get ODL keystore certificate.
@@ -65,7 +64,7 @@ public interface ICertificateManager {
      * @param withTag return certificate string with tag if true
      * @return the certificate
      */
-    @Nonnull String getODLKeyStoreCertificate(@Nonnull String storePasswd, boolean withTag);
+    @NonNull String getODLKeyStoreCertificate(@NonNull String storePasswd, boolean withTag);
 
     /**
      * Generate certificate request from the ODL keystore to be signed by a CA.
@@ -74,7 +73,7 @@ public interface ICertificateManager {
      * @param withTag return the certificate Req string with tag if true
      * @return the certificate request
      */
-    @Nonnull String genODLKeyStoreCertificateReq(@Nonnull String storePasswd, boolean withTag);
+    @NonNull String genODLKeyStoreCertificateReq(@NonNull String storePasswd, boolean withTag);
 
     /**
      * Get the SSL Context that will be used to establish the connection.
@@ -96,10 +95,10 @@ public interface ICertificateManager {
      *      protocols should be separated by ","
      * @return true if succeed
      */
-    boolean importSslDataKeystores(@Nonnull String odlKeystoreName, @Nonnull String odlKeystorePwd,
-                        @Nonnull String odlKeystoreAlias, @Nonnull String trustKeystoreName,
-                        @Nonnull String trustKeystorePwd, @Nonnull String[] cipherSuites,
-                                   @Nonnull String tlsProtocols);
+    boolean importSslDataKeystores(@NonNull String odlKeystoreName, @NonNull String odlKeystorePwd,
+                        @NonNull String odlKeystoreAlias, @NonNull String trustKeystoreName,
+                        @NonNull String trustKeystorePwd, @NonNull String[] cipherSuites,
+                        @NonNull String tlsProtocols);
 
     /**
      * Export the ODL keystore and Trust keystore to keystore files under configuration/ssl/ directory.