incubator-amber-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1399748 - /incubator/amber/trunk/oauth-2.0/common/src/main/java/org/apache/amber/oauth2/common/exception/OAuthProblemException.java
Date Thu, 18 Oct 2012 17:48:59 GMT
Author: asanso
Date: Thu Oct 18 17:48:59 2012
New Revision: 1399748

URL: http://svn.apache.org/viewvc?rev=1399748&view=rev
Log:
AMBER-62 - Add Extra fields to OAuthProblemException for easier spec compliant error handling.
Thanks Stein Welberg for the patch!!

Modified:
    incubator/amber/trunk/oauth-2.0/common/src/main/java/org/apache/amber/oauth2/common/exception/OAuthProblemException.java

Modified: incubator/amber/trunk/oauth-2.0/common/src/main/java/org/apache/amber/oauth2/common/exception/OAuthProblemException.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/common/src/main/java/org/apache/amber/oauth2/common/exception/OAuthProblemException.java?rev=1399748&r1=1399747&r2=1399748&view=diff
==============================================================================
--- incubator/amber/trunk/oauth-2.0/common/src/main/java/org/apache/amber/oauth2/common/exception/OAuthProblemException.java
(original)
+++ incubator/amber/trunk/oauth-2.0/common/src/main/java/org/apache/amber/oauth2/common/exception/OAuthProblemException.java
Thu Oct 18 17:48:59 2012
@@ -40,6 +40,8 @@ public final class OAuthProblemException
     private String scope;
     private String redirectUri;
 
+    private int responseStatus;
+
     private Map<String, String> parameters = new HashMap<String, String>();
 
     private OAuthProblemException(String error) {
@@ -81,6 +83,11 @@ public final class OAuthProblemException
         return this;
     }
 
+    public OAuthProblemException responseStatus(int responseStatus) {
+        this.responseStatus = responseStatus;
+        return this;
+    }
+
     public OAuthProblemException setParameter(String name, String value) {
         parameters.put(name, value);
         return this;
@@ -106,6 +113,10 @@ public final class OAuthProblemException
         return scope;
     }
 
+    public int getResponseStatus() {
+        return responseStatus == 0 ? 400 : responseStatus;
+    }
+
     public String get(String name) {
         return parameters.get(name);
     }



Mime
View raw message