Bug 2809:Fix AAA error reporting 10/21910/1
authorDebalina Ghosh <debalina.ghosh@hp.com>
Thu, 4 Jun 2015 22:39:56 +0000 (15:39 -0700)
committerDebalina Ghosh <debalina.ghosh@hp.com>
Thu, 4 Jun 2015 22:39:56 +0000 (15:39 -0700)
Change-Id: I61c923cec41fbe2244151c354ccba0fc49703faf
Signed-off-by: Debalina Ghosh <debalina.ghosh@hp.com>
aaa-authn-federation/src/main/java/org/opendaylight/aaa/federation/ClaimAuthFilter.java
aaa-authn-federation/src/main/java/org/opendaylight/aaa/federation/FederationConfiguration.java
aaa-authn-odl-plugin/src/main/java/org/opendaylight/aaa/odl/CredentialServiceAuthProvider.java
aaa-authn-store/src/main/java/org/opendaylight/aaa/store/DefaultTokenStore.java
aaa-idmlight/src/main/java/org/opendaylight/aaa/idm/IdmLightProxy.java
aaa-idp-mapping/src/main/java/org/opendaylight/aaa/idpmapping/RuleProcessor.java
aaa-idp-mapping/src/main/java/org/opendaylight/aaa/idpmapping/Token.java

index 70fd197f1e5a2d1fd8bb4e92ce128c88edacde5f..cc4adca6856abd3ffdaac95f23436feafb3f2fd5 100644 (file)
@@ -245,7 +245,7 @@ public class ClaimAuthFilter implements Filter {
         try {
             return new String(string.getBytes("ISO8859-1"), "UTF-8");
         } catch (UnsupportedEncodingException e) {
-            logger.warn("Unable to UTF-8 decode: " + string);
+            logger.warn("Unable to UTF-8 decode: " , string , e);
             return string;
         }
     }
index c0ebce8c44b6b668797e09034a8ce557b9f92112..e81c6f067c2b8162786d76703a91d220a1bc793a 100644 (file)
@@ -66,7 +66,7 @@ public class FederationConfiguration implements ManagedService {
                     configs.put(key, (String) props.get(key));
                 }
             } catch (Throwable t) {
-                throw new ConfigurationException(null, FEDERATION_CONFIG_ERR);
+                throw new ConfigurationException(null, FEDERATION_CONFIG_ERR, t);
             }
         }
     }
index 40c4712a377efe179aef8f33766ceff340511b4f..4ef93c755c2b3e8ffc6b87d93042bca056c0f471 100644 (file)
@@ -76,7 +76,7 @@ public final class CredentialServiceAuthProvider implements AuthProvider {
         try {
             claim = nullableCredService.authenticate(new PasswordCredentialsWrapper(username, password), DOMAIN);
         } catch (AuthenticationException e) {
-            logger.debug("Authentication failed for user '{}' : {}", username);
+            logger.debug("Authentication failed for user '{}' : {}", username, e);
             return false;
         }
 
index 0c8b2c168239fa16a2e9d7de0327e8476ad0dd3b..95f9c9fc7236a5c765fd99b5ba04fc15a47722f5 100644 (file)
@@ -152,7 +152,7 @@ public class DefaultTokenStore implements TokenStore, ManagedService {
             config.maxEntriesLocalHeap(maxMem);
             config.maxEntriesLocalDisk(maxDisk);
         } catch (Throwable t) {
-            throw new ConfigurationException(null, TOKEN_STORE_CONFIG_ERR);
+            throw new ConfigurationException(null, TOKEN_STORE_CONFIG_ERR, t);
         } finally {
             cacheLock.unlock();
         }
index 16f3d0b69ec7165d6b2039fb7b3f077c62aa37c9..b29f78fe55c3e965a198a834a08a0a353748e187 100644 (file)
@@ -99,7 +99,7 @@ public class IdmLightProxy implements CredentialAuth<PasswordCredentials>,
            domain = domainList.get(0);
         }
         catch (StoreException se) {
-           throw new AuthenticationException("idm data store exception :" + se.toString());
+           throw new AuthenticationException("idm data store exception :" + se.toString() + se);
         }
 
         // check to see user exists and passes cred check
@@ -138,7 +138,7 @@ public class IdmLightProxy implements CredentialAuth<PasswordCredentials>,
            return claim.build();
         }
         catch (StoreException se) {
-           throw new AuthenticationException("idm data store exception :" + se.toString());
+           throw new AuthenticationException("idm data store exception :" + se.toString() + se);
         }
     }
 
@@ -155,7 +155,7 @@ public class IdmLightProxy implements CredentialAuth<PasswordCredentials>,
            return user.getUserid().toString();
         }
         catch (StoreException se) {
-           logger.warn("error getting user " + se.toString());
+           logger.warn("error getting user " , se.toString(), se);
            return null;
         }
     }
@@ -169,7 +169,7 @@ public class IdmLightProxy implements CredentialAuth<PasswordCredentials>,
            uid = Long.parseLong(userId);
         }
         catch (NumberFormatException nfe) {
-           logger.warn("not a valid userid:" + userId);
+           logger.warn("not a valid userid:" ,userId, nfe);
            return domains;
         }
         try {
@@ -183,7 +183,7 @@ public class IdmLightProxy implements CredentialAuth<PasswordCredentials>,
            return domains;
         }
         catch (StoreException se) {
-           logger.warn("error getting domains " + se.toString());
+           logger.warn("error getting domains " , se.toString(), se);
            return domains;
         }
 
@@ -210,7 +210,7 @@ public class IdmLightProxy implements CredentialAuth<PasswordCredentials>,
               uid = Long.parseLong(userId);
            }
            catch (NumberFormatException nfe) {
-              logger.warn("not a valid userid:" + userId);
+              logger.warn("not a valid userid:" ,userId, nfe);
               return roles;
            }
 
@@ -226,7 +226,7 @@ public class IdmLightProxy implements CredentialAuth<PasswordCredentials>,
            return roles;
         }
         catch (StoreException se) {
-           logger.warn("error getting roles " + se.toString());
+           logger.warn("error getting roles " , se.toString(), se);
            return roles;
         }
     }
index cb5e5a3741fec4843717da2b90df799504f60bd9..57ed23c5f4650a5beb790f6ef780c7f891671957 100644 (file)
@@ -283,7 +283,7 @@ public class RuleProcessor {
       mapping = map;
     } catch (java.lang.ClassCastException e) {
       throw new InvalidRuleException(String.format("%s rule defines 'mapping' but it is not a Map",
-          this.ruleId(namespace)));
+          this.ruleId(namespace), e));
     }
     if (mapping != null) {
       return mapping;
@@ -292,7 +292,7 @@ public class RuleProcessor {
       mappingName = (String) rule.get("mapping_name");
     } catch (java.lang.ClassCastException e) {
       throw new InvalidRuleException(String.format(
-          "%s rule defines 'mapping_name' but it is not a string", this.ruleId(namespace)));
+          "%s rule defines 'mapping_name' but it is not a string", this.ruleId(namespace), e));
     }
     if (mappingName == null) {
       throw new InvalidRuleException(String.format(
@@ -344,7 +344,7 @@ public class RuleProcessor {
     } catch (IndexOutOfBoundsException e) {
       throw new InvalidRuleException(String.format(
           "verb '%s' requires at least %d items but only %d are available.", verb, index + 1,
-          statement.size()));
+          statement.size(), e));
     }
 
     try {
@@ -384,7 +384,7 @@ public class RuleProcessor {
     } catch (IndexOutOfBoundsException e) {
       throw new InvalidRuleException(String.format(
           "verb '%s' requires at least %d items but only %d are available.", verb, index + 1,
-          statement.size()));
+          statement.size(), e));
     }
 
     try {
@@ -420,7 +420,7 @@ public class RuleProcessor {
     } catch (IndexOutOfBoundsException e) {
       throw new InvalidRuleException(String.format(
           "verb '%s' requires at least %d items but only %d are available.", verb, index + 1,
-          statement.size()));
+          statement.size(),e));
     }
 
     if (tokenTypes != null) {
@@ -446,7 +446,7 @@ public class RuleProcessor {
     } catch (IndexOutOfBoundsException e) {
       throw new InvalidRuleException(String.format(
           "verb '%s' requires at least %d items but only %d are available.", verb, index + 1,
-          statement.size()));
+          statement.size(), e));
     }
 
     try {
@@ -850,7 +850,7 @@ public class RuleProcessor {
             } catch (ClassCastException e) {
               throw new InvalidValueException(String.format(
                   "verb '%s' failed, array item (%s) is not a string, array=%s", verb, item,
-                  parameter.getObjectValue()));
+                  parameter.getObjectValue(), e));
             }
             newItem = oldItem.toLowerCase();
             newValue.add(newItem);
@@ -921,7 +921,7 @@ public class RuleProcessor {
             } catch (ClassCastException e) {
               throw new InvalidValueException(String.format(
                   "verb '%s' failed, array item (%s) is not a string, array=%s", verb, item,
-                  parameter.getObjectValue()));
+                  parameter.getObjectValue(), e));
             }
             newItem = oldItem.toUpperCase();
             newValue.add(newItem);
index 9b835cb9032ede2480cd925452cacf3f40856a59..03d7d53c9fb7329fb96ed28825cdc23da74bd1b3 100644 (file)
@@ -188,7 +188,7 @@ class Token {
                 String
                     .format(
                         "variable '%s' is an array indexed by '%s', however the index cannot be converted to an integer",
-                        this.name, index));
+                        this.name, index,e));
           }
         } else {
           throw new InvalidTypeException(
@@ -205,7 +205,7 @@ class Token {
               String
                   .format(
                       "variable '%s' is an array of size %d indexed by '%s', however the index is out of bounds",
-                      this.name, list.size(), idx));
+                      this.name, list.size(), idx, e));
         }
       } else if (base instanceof Map) {
         @SuppressWarnings("unchecked")
@@ -275,7 +275,7 @@ class Token {
                 String
                     .format(
                         "variable '%s' is an array indexed by '%s', however the index cannot be converted to an integer",
-                        this.name, index));
+                        this.name, index, e));
           }
         } else {
           throw new InvalidTypeException(
@@ -292,7 +292,7 @@ class Token {
               String
                   .format(
                       "variable '%s' is an array of size %d indexed by '%s', however the index is out of bounds",
-                      this.name, list.size(), idx));
+                      this.name, list.size(), idx, e));
         }
       } else if (base instanceof Map) {
         @SuppressWarnings("unchecked")
@@ -400,7 +400,4 @@ class Token {
   public Object getObjectValue() {
     return this.value;
   }
-
-
-
 }