You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2012/02/13 03:59:39 UTC

svn commit: r1243399 [3/7] - in /shindig/trunk: content/samplecontainer/examples/ content/samplecontainer/examples/oauth2/ extras/src/main/javascript/features-extras/firebug-lite/ features/src/main/javascript/features/container.site.gadget/ features/sr...

Modified: shindig/trunk/java/server-resources/pom.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/java/server-resources/pom.xml?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/server-resources/pom.xml (original)
+++ shindig/trunk/java/server-resources/pom.xml Mon Feb 13 02:59:33 2012
@@ -1,86 +1,86 @@
-<?xml version="1.0" encoding="UTF-8"?><!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.shindig</groupId>
-    <artifactId>shindig-project</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <artifactId>shindig-server-resources</artifactId>
-  <packaging>war</packaging>
-
-  <name>Apache Shindig Web App Resources</name>
-  <description>Shallow Default server war containing only the configuration and javascript for the gadget rendering and the social api.</description>
-
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/shindig/trunk/java/server-resources</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/shindig/trunk/java/server-resources</developerConnection>
-    <url>http://svn.apache.org/viewvc/shindig/trunk/java/server-resources</url>
-  </scm>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-war-plugin</artifactId>
-        <configuration>
-          <webResources>
-            <resource>
-              <!-- this is relative to the pom.xml directory -->
-              <directory>${basedir}/../../content/</directory>
-              <includes>
-                <include>**/*.*</include>
-              </includes>
-            </resource>
-            <resource>
-              <targetPath>META-INF</targetPath>
-              <directory>target/maven-shared-archive-resources/META-INF</directory>
-              <includes>
-                <include>**/*</include>
-              </includes>
-            </resource>
-          </webResources>
-          <classifier>${shindig.jdk.classifier}</classifier>
-        </configuration>
-      </plugin>
-    </plugins>
-    <resources>
-      <resource>
-        <targetPath>containers/default</targetPath>
-        <directory>${basedir}/../../config</directory>
-        <includes>
-          <include>container.js</include>
-        </includes>
-      </resource>
-      <resource>
-        <targetPath>config</targetPath>
-        <directory>${basedir}/../../config</directory>
-        <includes>
-          <include>oauth.json</include>
-          <include>oauth2.json</include>
-        </includes>
-      </resource>
-    </resources>
-  </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?><!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.shindig</groupId>
+    <artifactId>shindig-project</artifactId>
+    <version>3.0.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+
+  <artifactId>shindig-server-resources</artifactId>
+  <packaging>war</packaging>
+
+  <name>Apache Shindig Web App Resources</name>
+  <description>Shallow Default server war containing only the configuration and javascript for the gadget rendering and the social api.</description>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/shindig/trunk/java/server-resources</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/shindig/trunk/java/server-resources</developerConnection>
+    <url>http://svn.apache.org/viewvc/shindig/trunk/java/server-resources</url>
+  </scm>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <configuration>
+          <webResources>
+            <resource>
+              <!-- this is relative to the pom.xml directory -->
+              <directory>${basedir}/../../content/</directory>
+              <includes>
+                <include>**/*.*</include>
+              </includes>
+            </resource>
+            <resource>
+              <targetPath>META-INF</targetPath>
+              <directory>target/maven-shared-archive-resources/META-INF</directory>
+              <includes>
+                <include>**/*</include>
+              </includes>
+            </resource>
+          </webResources>
+          <classifier>${shindig.jdk.classifier}</classifier>
+        </configuration>
+      </plugin>
+    </plugins>
+    <resources>
+      <resource>
+        <targetPath>containers/default</targetPath>
+        <directory>${basedir}/../../config</directory>
+        <includes>
+          <include>container.js</include>
+        </includes>
+      </resource>
+      <resource>
+        <targetPath>config</targetPath>
+        <directory>${basedir}/../../config</directory>
+        <includes>
+          <include>oauth.json</include>
+          <include>oauth2.json</include>
+        </includes>
+      </resource>
+    </resources>
+  </build>
+
+</project>

Propchange: shindig/trunk/java/server-resources/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: shindig/trunk/java/server-resources/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthenticationHandler.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthenticationHandler.java?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthenticationHandler.java (original)
+++ shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthenticationHandler.java Mon Feb 13 02:59:33 2012
@@ -1,83 +1,83 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.shindig.social.core.oauth2;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.shindig.auth.AnonymousSecurityToken;
-import org.apache.shindig.auth.AuthenticationHandler;
-import org.apache.shindig.auth.SecurityToken;
-import org.apache.shindig.common.logging.i18n.MessageKeys;
-
-import com.google.inject.Inject;
-
-/**
- * Authentication handler for OAuth 2.0.  Authenticates requests for resources
- * using one of the OAuth 2.0 flows.
- */
-public class OAuth2AuthenticationHandler implements AuthenticationHandler {
-  
-  //class name for logging purpose
-  private static final String classname = OAuth2AuthenticationHandler.class.getName();
-  private static final Logger LOG = Logger.getLogger(classname,MessageKeys.MESSAGES);
-
-  private OAuth2Service store;
-
-  public String getName() {
-    return "OAuth2";
-  }
-
-  @Inject
-  public OAuth2AuthenticationHandler(OAuth2Service store) {
-    this.store = store;
-  }
-
-  /**
-   * Only denies authentication when an invalid bearer token is received.
-   * Unauthenticated requests can pass through to other AuthenticationHandlers.
-   */
-  public SecurityToken getSecurityTokenFromRequest(HttpServletRequest request)
-      throws InvalidAuthenticationException {
-
-    OAuth2NormalizedRequest normalizedReq;
-    try {
-      normalizedReq = new OAuth2NormalizedRequest(request);
-    } catch (OAuth2Exception oae) {   // request failed to normalize
-      LOG.logp(Level.WARNING, classname, "getSecurityTokenFromRequest", MessageKeys.INVALID_OAUTH);
-      return null;
-    }
-    try {
-      if (normalizedReq.getAccessToken() != null) {
-        store.validateRequestForResource(normalizedReq, null);
-        return new AnonymousSecurityToken(); // Return your valid security token
-      }
-    } catch (OAuth2Exception oae) {
-      // TODO (Eric): process OAuth2Exception properly
-      throw new InvalidAuthenticationException("Something went wrong: ", oae);
-    }
-    return null;
-  }
-
-  public String getWWWAuthenticateHeader(String realm) {
-    return String.format("Bearer realm=\"%s\"", realm);
-  }
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.social.core.oauth2;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shindig.auth.AnonymousSecurityToken;
+import org.apache.shindig.auth.AuthenticationHandler;
+import org.apache.shindig.auth.SecurityToken;
+import org.apache.shindig.common.logging.i18n.MessageKeys;
+
+import com.google.inject.Inject;
+
+/**
+ * Authentication handler for OAuth 2.0.  Authenticates requests for resources
+ * using one of the OAuth 2.0 flows.
+ */
+public class OAuth2AuthenticationHandler implements AuthenticationHandler {
+  
+  //class name for logging purpose
+  private static final String classname = OAuth2AuthenticationHandler.class.getName();
+  private static final Logger LOG = Logger.getLogger(classname,MessageKeys.MESSAGES);
+
+  private OAuth2Service store;
+
+  public String getName() {
+    return "OAuth2";
+  }
+
+  @Inject
+  public OAuth2AuthenticationHandler(OAuth2Service store) {
+    this.store = store;
+  }
+
+  /**
+   * Only denies authentication when an invalid bearer token is received.
+   * Unauthenticated requests can pass through to other AuthenticationHandlers.
+   */
+  public SecurityToken getSecurityTokenFromRequest(HttpServletRequest request)
+      throws InvalidAuthenticationException {
+
+    OAuth2NormalizedRequest normalizedReq;
+    try {
+      normalizedReq = new OAuth2NormalizedRequest(request);
+    } catch (OAuth2Exception oae) {   // request failed to normalize
+      LOG.logp(Level.WARNING, classname, "getSecurityTokenFromRequest", MessageKeys.INVALID_OAUTH);
+      return null;
+    }
+    try {
+      if (normalizedReq.getAccessToken() != null) {
+        store.validateRequestForResource(normalizedReq, null);
+        return new AnonymousSecurityToken(); // Return your valid security token
+      }
+    } catch (OAuth2Exception oae) {
+      // TODO (Eric): process OAuth2Exception properly
+      throw new InvalidAuthenticationException("Something went wrong: ", oae);
+    }
+    return null;
+  }
+
+  public String getWWWAuthenticateHeader(String realm) {
+    return String.format("Bearer realm=\"%s\"", realm);
+  }
+
 }
\ No newline at end of file

Propchange: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthenticationHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthorizationHandler.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthorizationHandler.java?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthorizationHandler.java (original)
+++ shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthorizationHandler.java Mon Feb 13 02:59:33 2012
@@ -1,115 +1,115 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.shindig.social.core.oauth2;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.shindig.social.core.oauth2.OAuth2Types.ErrorType;
-import org.apache.shindig.social.core.oauth2.OAuth2Types.TokenFormat;
-
-/**
- * Handles requests to the OAuth 2.0 authorization end-point.
- */
-public class OAuth2AuthorizationHandler {
-
-  private OAuth2Service service;
-
-  public OAuth2AuthorizationHandler(OAuth2Service service) {
-    this.service = service;
-  }
-
-  /**
-   * Handles an OAuth 2.0 authorization request.
-   * 
-   * @param request is the original request
-   * @param response is the response of the request
-   * @return OAuth2NormalizedResponse represents the OAuth 2.0 response
-   * 
-   * @throws ServletException
-   * @throws IOException
-   */
-  public OAuth2NormalizedResponse handle(HttpServletRequest request,
-      HttpServletResponse response) throws ServletException, IOException {
-    try {
-      // normalize the request
-      OAuth2NormalizedRequest normalizedReq = new OAuth2NormalizedRequest(
-          request);
-
-      // process request according to flow
-      OAuth2NormalizedResponse normalizedResp = new OAuth2NormalizedResponse();
-      if (normalizedReq.getResponseType() != null) {
-        switch (normalizedReq.getEnumeratedResponseType()) {
-        case CODE:
-          // authorization code flow
-          service.validateRequestForAuthCode(normalizedReq);
-          OAuth2Code authCode = service.grantAuthorizationCode(normalizedReq);
-
-          // send response
-          normalizedResp.setCode(authCode.getValue());
-          if (normalizedReq.getState() != null)
-            normalizedResp.setState(normalizedReq.getState());
-          normalizedResp.setHeader(
-              "Location",
-              OAuth2Utils.buildUrl(authCode.getRedirectURI(),
-                  normalizedResp.getResponseParameters(), null));
-          normalizedResp.setStatus(HttpServletResponse.SC_FOUND);
-          normalizedResp.setBodyReturned(false);
-          return normalizedResp;
-        case TOKEN:
-          // implicit flow
-          service.validateRequestForAccessToken(normalizedReq);
-          OAuth2Code accessToken = service.grantAccessToken(normalizedReq);
-
-          // send response
-          normalizedResp.setAccessToken(accessToken.getValue());
-          normalizedResp.setTokenType(TokenFormat.BEARER.toString());
-          normalizedResp.setExpiresIn((accessToken.getExpiration() - System
-              .currentTimeMillis()) + "");
-          if (normalizedReq.getState() != null)
-            normalizedResp.setState(normalizedReq.getState());
-          normalizedResp.setHeader("Location", OAuth2Utils.buildUrl(
-              accessToken.getRedirectURI(), null,
-              normalizedResp.getResponseParameters()));
-          normalizedResp.setStatus(HttpServletResponse.SC_FOUND);
-          normalizedResp.setBodyReturned(false);
-          return normalizedResp;
-        default:
-          OAuth2NormalizedResponse resp = new OAuth2NormalizedResponse();
-          resp.setError(ErrorType.UNSUPPORTED_RESPONSE_TYPE.toString());
-          resp.setErrorDescription("Unsupported response type");
-          resp.setStatus(HttpServletResponse.SC_FOUND);
-          resp.setBodyReturned(false);
-          throw new OAuth2Exception(resp);
-        }
-      } else {
-        OAuth2NormalizedResponse resp = new OAuth2NormalizedResponse();
-        resp.setError(ErrorType.UNSUPPORTED_RESPONSE_TYPE.toString());
-        resp.setErrorDescription("Unsupported response type");
-        resp.setStatus(HttpServletResponse.SC_FOUND);
-        resp.setBodyReturned(false);
-        throw new OAuth2Exception(resp);
-      }
-    } catch (OAuth2Exception oae) {
-      return oae.getNormalizedResponse();
-    }
-  }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.social.core.oauth2;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shindig.social.core.oauth2.OAuth2Types.ErrorType;
+import org.apache.shindig.social.core.oauth2.OAuth2Types.TokenFormat;
+
+/**
+ * Handles requests to the OAuth 2.0 authorization end-point.
+ */
+public class OAuth2AuthorizationHandler {
+
+  private OAuth2Service service;
+
+  public OAuth2AuthorizationHandler(OAuth2Service service) {
+    this.service = service;
+  }
+
+  /**
+   * Handles an OAuth 2.0 authorization request.
+   * 
+   * @param request is the original request
+   * @param response is the response of the request
+   * @return OAuth2NormalizedResponse represents the OAuth 2.0 response
+   * 
+   * @throws ServletException
+   * @throws IOException
+   */
+  public OAuth2NormalizedResponse handle(HttpServletRequest request,
+      HttpServletResponse response) throws ServletException, IOException {
+    try {
+      // normalize the request
+      OAuth2NormalizedRequest normalizedReq = new OAuth2NormalizedRequest(
+          request);
+
+      // process request according to flow
+      OAuth2NormalizedResponse normalizedResp = new OAuth2NormalizedResponse();
+      if (normalizedReq.getResponseType() != null) {
+        switch (normalizedReq.getEnumeratedResponseType()) {
+        case CODE:
+          // authorization code flow
+          service.validateRequestForAuthCode(normalizedReq);
+          OAuth2Code authCode = service.grantAuthorizationCode(normalizedReq);
+
+          // send response
+          normalizedResp.setCode(authCode.getValue());
+          if (normalizedReq.getState() != null)
+            normalizedResp.setState(normalizedReq.getState());
+          normalizedResp.setHeader(
+              "Location",
+              OAuth2Utils.buildUrl(authCode.getRedirectURI(),
+                  normalizedResp.getResponseParameters(), null));
+          normalizedResp.setStatus(HttpServletResponse.SC_FOUND);
+          normalizedResp.setBodyReturned(false);
+          return normalizedResp;
+        case TOKEN:
+          // implicit flow
+          service.validateRequestForAccessToken(normalizedReq);
+          OAuth2Code accessToken = service.grantAccessToken(normalizedReq);
+
+          // send response
+          normalizedResp.setAccessToken(accessToken.getValue());
+          normalizedResp.setTokenType(TokenFormat.BEARER.toString());
+          normalizedResp.setExpiresIn((accessToken.getExpiration() - System
+              .currentTimeMillis()) + "");
+          if (normalizedReq.getState() != null)
+            normalizedResp.setState(normalizedReq.getState());
+          normalizedResp.setHeader("Location", OAuth2Utils.buildUrl(
+              accessToken.getRedirectURI(), null,
+              normalizedResp.getResponseParameters()));
+          normalizedResp.setStatus(HttpServletResponse.SC_FOUND);
+          normalizedResp.setBodyReturned(false);
+          return normalizedResp;
+        default:
+          OAuth2NormalizedResponse resp = new OAuth2NormalizedResponse();
+          resp.setError(ErrorType.UNSUPPORTED_RESPONSE_TYPE.toString());
+          resp.setErrorDescription("Unsupported response type");
+          resp.setStatus(HttpServletResponse.SC_FOUND);
+          resp.setBodyReturned(false);
+          throw new OAuth2Exception(resp);
+        }
+      } else {
+        OAuth2NormalizedResponse resp = new OAuth2NormalizedResponse();
+        resp.setError(ErrorType.UNSUPPORTED_RESPONSE_TYPE.toString());
+        resp.setErrorDescription("Unsupported response type");
+        resp.setStatus(HttpServletResponse.SC_FOUND);
+        resp.setBodyReturned(false);
+        throw new OAuth2Exception(resp);
+      }
+    } catch (OAuth2Exception oae) {
+      return oae.getNormalizedResponse();
+    }
+  }
 }
\ No newline at end of file

Propchange: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2AuthorizationHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Client.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Client.java?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Client.java (original)
+++ shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Client.java Mon Feb 13 02:59:33 2012
@@ -1,213 +1,213 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.shindig.social.core.oauth2;
-
-/**
- * Represents an OAuth 2.0 client.
- */
-public class OAuth2Client {
-
-  protected String id;
-  protected String secret;
-  protected String redirectURI;
-  protected String title;
-  protected String iconUrl;
-  protected ClientType type;
-  private Flow flow;
-
-  /**
-   * Gets the client's ID.
-   * 
-   * @return String represents the client's ID.
-   */
-  public String getId() {
-    return id;
-  }
-
-  /**
-   * Sets the client's ID.
-   * 
-   * @param id
-   *          represents the client's ID.
-   */
-  public void setId(String id) {
-    this.id = id;
-  }
-
-  /**
-   * Gets the client's secret.
-   * 
-   * @return String represents the client's secret
-   */
-  public String getSecret() {
-    return secret;
-  }
-
-  /**
-   * Sets the client's secret.
-   * 
-   * @param secret
-   *          represents the client's secret
-   */
-  public void setSecret(String secret) {
-    this.secret = secret;
-  }
-
-  /**
-   * Gets the client's redirect URI.
-   * 
-   * @return String represents the client's redirect URI
-   */
-  public String getRedirectURI() {
-    return redirectURI;
-  }
-
-  /**
-   * Sets the client's redirect URI.
-   * 
-   * @param redirectUri
-   *          represents the client's redirect URI
-   */
-  public void setRedirectURI(String redirectUri) {
-    this.redirectURI = redirectUri;
-  }
-
-  /**
-   * Gets the client's title.
-   * 
-   * @return String represents the client's title
-   */
-  public String getTitle() {
-    return title;
-  }
-
-  /**
-   * Sets the client's title.
-   * 
-   * @param title
-   *          represents the client's title
-   */
-  public void setTitle(String title) {
-    this.title = title;
-  }
-
-  /**
-   * Gets the client's icon URL.
-   * 
-   * @return String represents the client's icon URL
-   */
-  public String getIconUrl() {
-    return iconUrl;
-  }
-
-  /**
-   * Sets the client's icon URL.
-   * 
-   * @param iconUrl
-   *          represents the client's icon URL
-   */
-  public void setIconUrl(String iconUrl) {
-    this.iconUrl = iconUrl;
-  }
-
-  /**
-   * Gets the client's type.
-   * 
-   * @return ClientType represents the client's type
-   */
-  public ClientType getType() {
-    return type;
-  }
-
-  /**
-   * Sets the client's type.
-   * 
-   * @param clientType
-   *          represents the client's type
-   */
-  public void setType(ClientType type) {
-    this.type = type;
-  }
-
-  /**
-   * Sets the client's OAuth2 flow (via a String flow identifier)
-   * 
-   * @param flow
-   */
-  public void setFlow(String flow) {
-    if (Flow.CLIENT_CREDENTIALS.toString().equals(flow)) {
-      this.flow = Flow.CLIENT_CREDENTIALS;
-    } else if (Flow.AUTHORIZATION_CODE.toString().equals(flow)) {
-      this.flow = Flow.AUTHORIZATION_CODE;
-    } else if (Flow.IMPLICIT.toString().equals(flow)) {
-      this.flow = Flow.IMPLICIT;
-    } else {
-      this.flow = null;
-    }
-  }
-
-  /**
-   * Sets the client's OAuth2 flow
-   * 
-   * @param flow
-   */
-  public void setFlowEnum(Flow flow) {
-    this.flow = flow;
-  }
-
-  /**
-   * Gets the client's OAuth2 flow
-   * 
-   * @return
-   */
-  public Flow getFlow() {
-    return flow;
-  }
-
-  /**
-   * Enumerated client types in the OAuth 2.0 specification.
-   */
-  public static enum ClientType {
-    PUBLIC("public"), CONFIDENTIAL("confidential");
-
-    private final String name;
-
-    private ClientType(String name) {
-      this.name = name;
-    }
-
-    public String toString() {
-      return name;
-    }
-  }
-
-  public static enum Flow {
-    CLIENT_CREDENTIALS("client_credentials"), AUTHORIZATION_CODE(
-        "authorization_code"), IMPLICIT("implicit");
-
-    private final String name;
-
-    private Flow(String name) {
-      this.name = name;
-    }
-
-    public String toString() {
-      return name;
-    }
-  }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.social.core.oauth2;
+
+/**
+ * Represents an OAuth 2.0 client.
+ */
+public class OAuth2Client {
+
+  protected String id;
+  protected String secret;
+  protected String redirectURI;
+  protected String title;
+  protected String iconUrl;
+  protected ClientType type;
+  private Flow flow;
+
+  /**
+   * Gets the client's ID.
+   * 
+   * @return String represents the client's ID.
+   */
+  public String getId() {
+    return id;
+  }
+
+  /**
+   * Sets the client's ID.
+   * 
+   * @param id
+   *          represents the client's ID.
+   */
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  /**
+   * Gets the client's secret.
+   * 
+   * @return String represents the client's secret
+   */
+  public String getSecret() {
+    return secret;
+  }
+
+  /**
+   * Sets the client's secret.
+   * 
+   * @param secret
+   *          represents the client's secret
+   */
+  public void setSecret(String secret) {
+    this.secret = secret;
+  }
+
+  /**
+   * Gets the client's redirect URI.
+   * 
+   * @return String represents the client's redirect URI
+   */
+  public String getRedirectURI() {
+    return redirectURI;
+  }
+
+  /**
+   * Sets the client's redirect URI.
+   * 
+   * @param redirectUri
+   *          represents the client's redirect URI
+   */
+  public void setRedirectURI(String redirectUri) {
+    this.redirectURI = redirectUri;
+  }
+
+  /**
+   * Gets the client's title.
+   * 
+   * @return String represents the client's title
+   */
+  public String getTitle() {
+    return title;
+  }
+
+  /**
+   * Sets the client's title.
+   * 
+   * @param title
+   *          represents the client's title
+   */
+  public void setTitle(String title) {
+    this.title = title;
+  }
+
+  /**
+   * Gets the client's icon URL.
+   * 
+   * @return String represents the client's icon URL
+   */
+  public String getIconUrl() {
+    return iconUrl;
+  }
+
+  /**
+   * Sets the client's icon URL.
+   * 
+   * @param iconUrl
+   *          represents the client's icon URL
+   */
+  public void setIconUrl(String iconUrl) {
+    this.iconUrl = iconUrl;
+  }
+
+  /**
+   * Gets the client's type.
+   * 
+   * @return ClientType represents the client's type
+   */
+  public ClientType getType() {
+    return type;
+  }
+
+  /**
+   * Sets the client's type.
+   * 
+   * @param clientType
+   *          represents the client's type
+   */
+  public void setType(ClientType type) {
+    this.type = type;
+  }
+
+  /**
+   * Sets the client's OAuth2 flow (via a String flow identifier)
+   * 
+   * @param flow
+   */
+  public void setFlow(String flow) {
+    if (Flow.CLIENT_CREDENTIALS.toString().equals(flow)) {
+      this.flow = Flow.CLIENT_CREDENTIALS;
+    } else if (Flow.AUTHORIZATION_CODE.toString().equals(flow)) {
+      this.flow = Flow.AUTHORIZATION_CODE;
+    } else if (Flow.IMPLICIT.toString().equals(flow)) {
+      this.flow = Flow.IMPLICIT;
+    } else {
+      this.flow = null;
+    }
+  }
+
+  /**
+   * Sets the client's OAuth2 flow
+   * 
+   * @param flow
+   */
+  public void setFlowEnum(Flow flow) {
+    this.flow = flow;
+  }
+
+  /**
+   * Gets the client's OAuth2 flow
+   * 
+   * @return
+   */
+  public Flow getFlow() {
+    return flow;
+  }
+
+  /**
+   * Enumerated client types in the OAuth 2.0 specification.
+   */
+  public static enum ClientType {
+    PUBLIC("public"), CONFIDENTIAL("confidential");
+
+    private final String name;
+
+    private ClientType(String name) {
+      this.name = name;
+    }
+
+    public String toString() {
+      return name;
+    }
+  }
+
+  public static enum Flow {
+    CLIENT_CREDENTIALS("client_credentials"), AUTHORIZATION_CODE(
+        "authorization_code"), IMPLICIT("implicit");
+
+    private final String name;
+
+    private Flow(String name) {
+      this.name = name;
+    }
+
+    public String toString() {
+      return name;
+    }
+  }
 }
\ No newline at end of file

Propchange: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Client.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Code.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Code.java?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Code.java (original)
+++ shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Code.java Mon Feb 13 02:59:33 2012
@@ -1,243 +1,243 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.shindig.social.core.oauth2;
-
-import java.util.List;
-
-import org.apache.shindig.social.core.oauth2.OAuth2Types.CodeType;
-
-/**
- * Represents a "code" string in an OAuth 2.0 handshake, including authorization
- * code, access token, or refresh token. These signatures may all expire. They
- * may also be associated with a redirect_url and/or another code.
- */
-public class OAuth2Code implements Comparable<OAuth2Code> {
-
-  private String value;
-  private String redirectURI;
-  private long expiration;
-  private List<String> scope; // TODO (Eric): should be a string, interpret as a list during validation
-  private OAuth2Client client;
-  private OAuth2Code relatedAuthCode;
-  private OAuth2Code relatedRefreshToken;
-  private OAuth2Code relatedAccessToken;
-  private CodeType type;
-
-  public OAuth2Code() {
-
-  }
-
-  /**
-   * Constructs an OAuth2Code.
-   * 
-   * @param value is the String key that makes up the code
-   * @param redirectURI is redirect URI associated with this code
-   * @param expiration indicates when this code expires
-   * @param scope indicates the scope of this code
-   */
-  public OAuth2Code(String value, String redirectURI, long expiration,
-      List<String> scope) {
-    this.value = value;
-    this.redirectURI = redirectURI;
-    this.expiration = expiration;
-    this.scope = scope;
-  }
-
-  /**
-   * Constructs an OAuth2Code with a value.
-   * 
-   * @param value is the String key that makes up the code
-   */
-  public OAuth2Code(String value) {
-    this.value = value;
-  }
-
-  /**
-   * Returns the value of this code.
-   * 
-   * @return String is the key of this code
-   */
-  public String getValue() {
-    return value;
-  }
-
-  /**
-   * Sets the value of this code.
-   * 
-   * @param value is the value to set this code to
-   */
-  public void setValue(String value) {
-    this.value = value;
-  }
-
-  /**
-   * Returns the redirect URI associated with this code.
-   * 
-   * @return String represents this code's redirect URI
-   */
-  public String getRedirectURI() {
-    return redirectURI;
-  }
-
-  /**
-   * Sets the redirect URI associated with this code.
-   * 
-   * @param redirectURI represents the redirect URI of this code
-   */
-  public void setRedirectURI(String redirectURI) {
-    this.redirectURI = redirectURI;
-  }
-
-  /**
-   * Returns when this code expires.
-   * 
-   * @return long represents when this code will expire
-   */
-  public long getExpiration() {
-    return expiration;
-  }
-
-  /**
-   * Sets the expiration of this code.
-   * 
-   * @param expiration is when this code will expire
-   */
-  public void setExpiration(long expiration) {
-    this.expiration = expiration;
-  }
-
-  /**
-   * Compares this code to another code.
-   * 
-   * @return int indicates how the value of this code compares to another
-   */
-  public int compareTo(OAuth2Code target) {
-    return value.compareTo(target.getValue());
-  }
-
-  /**
-   * Returns the scope of this code.
-   * 
-   * @return List<String> represents the scope of this code
-   */
-  public List<String> getScope() {
-    return scope;
-  }
-
-  /**
-   * Sets the scope of this code.
-   * 
-   * @param scope is this code's authorized scope
-   */
-  public void setScope(List<String> scope) {
-    this.scope = scope;
-  }
-
-  /**
-   * Sets the client associated with this code.
-   * 
-   * @param client is the client to associate with this code
-   */
-  public void setClient(OAuth2Client client) {
-    this.client = client;
-  }
-
-  /**
-   * Returns the client associated with this code.
-   * 
-   * @return OAuth2Client represents the client associated with this code
-   */
-  public OAuth2Client getClient() {
-    return client;
-  }
-
-  /**
-   * Sets the type of this code; one of
-   *  AUTHORIZATION_CODE,
-   *  ACCESS_TOKEN,
-   *  REFRESH_TOKEN
-   *  
-   * @param type is this code's type
-   */
-  public void setType(CodeType type) {
-    this.type = type;
-  }
-
-  /**
-   * Returns the type of this code.
-   * 
-   * @return CodeType represents the type of this code
-   */
-  public CodeType getType() {
-    return type;
-  }
-
-  /**
-   * Sets the authorization code that this code is related to, if applicable.
-   * 
-   * @param code is the authorization code to associate with this code
-   */
-  public void setRelatedAuthCode(OAuth2Code code) {
-    this.relatedAuthCode = code;
-  }
-
-  /**
-   * Returns the authorization code related to this code.
-   * 
-   * @return OAuth2Code is the authorization code related to this code
-   */
-  public OAuth2Code getRelatedAuthCode() {
-    return relatedAuthCode;
-  }
-
-  /**
-   * Sets the related refresh token.
-   * 
-   * @param relatedRefreshToken is the refresh token related to this code
-   */
-  public void setRelatedRefreshToken(OAuth2Code relatedRefreshToken) {
-    this.relatedRefreshToken = relatedRefreshToken;
-  }
-
-  /**
-   * Gets the related refresh token.
-   * 
-   * @return OAuth2Code is the refresh token related to this code
-   */
-  public OAuth2Code getRelatedRefreshToken() {
-    return relatedRefreshToken;
-  }
-
-  /**
-   * Sets the related access token.
-   * 
-   * @param relatedAccessToken is the access token related to this code
-   */
-  public void setRelatedAccessToken(OAuth2Code relatedAccessToken) {
-    this.relatedAccessToken = relatedAccessToken;
-  }
-
-  /**
-   * Gets the related access token.
-   * 
-   * @return OAuth2Code is the access token related to this code
-   */
-  public OAuth2Code getRelatedAccessToken() {
-    return relatedAccessToken;
-  }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.social.core.oauth2;
+
+import java.util.List;
+
+import org.apache.shindig.social.core.oauth2.OAuth2Types.CodeType;
+
+/**
+ * Represents a "code" string in an OAuth 2.0 handshake, including authorization
+ * code, access token, or refresh token. These signatures may all expire. They
+ * may also be associated with a redirect_url and/or another code.
+ */
+public class OAuth2Code implements Comparable<OAuth2Code> {
+
+  private String value;
+  private String redirectURI;
+  private long expiration;
+  private List<String> scope; // TODO (Eric): should be a string, interpret as a list during validation
+  private OAuth2Client client;
+  private OAuth2Code relatedAuthCode;
+  private OAuth2Code relatedRefreshToken;
+  private OAuth2Code relatedAccessToken;
+  private CodeType type;
+
+  public OAuth2Code() {
+
+  }
+
+  /**
+   * Constructs an OAuth2Code.
+   * 
+   * @param value is the String key that makes up the code
+   * @param redirectURI is redirect URI associated with this code
+   * @param expiration indicates when this code expires
+   * @param scope indicates the scope of this code
+   */
+  public OAuth2Code(String value, String redirectURI, long expiration,
+      List<String> scope) {
+    this.value = value;
+    this.redirectURI = redirectURI;
+    this.expiration = expiration;
+    this.scope = scope;
+  }
+
+  /**
+   * Constructs an OAuth2Code with a value.
+   * 
+   * @param value is the String key that makes up the code
+   */
+  public OAuth2Code(String value) {
+    this.value = value;
+  }
+
+  /**
+   * Returns the value of this code.
+   * 
+   * @return String is the key of this code
+   */
+  public String getValue() {
+    return value;
+  }
+
+  /**
+   * Sets the value of this code.
+   * 
+   * @param value is the value to set this code to
+   */
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  /**
+   * Returns the redirect URI associated with this code.
+   * 
+   * @return String represents this code's redirect URI
+   */
+  public String getRedirectURI() {
+    return redirectURI;
+  }
+
+  /**
+   * Sets the redirect URI associated with this code.
+   * 
+   * @param redirectURI represents the redirect URI of this code
+   */
+  public void setRedirectURI(String redirectURI) {
+    this.redirectURI = redirectURI;
+  }
+
+  /**
+   * Returns when this code expires.
+   * 
+   * @return long represents when this code will expire
+   */
+  public long getExpiration() {
+    return expiration;
+  }
+
+  /**
+   * Sets the expiration of this code.
+   * 
+   * @param expiration is when this code will expire
+   */
+  public void setExpiration(long expiration) {
+    this.expiration = expiration;
+  }
+
+  /**
+   * Compares this code to another code.
+   * 
+   * @return int indicates how the value of this code compares to another
+   */
+  public int compareTo(OAuth2Code target) {
+    return value.compareTo(target.getValue());
+  }
+
+  /**
+   * Returns the scope of this code.
+   * 
+   * @return List<String> represents the scope of this code
+   */
+  public List<String> getScope() {
+    return scope;
+  }
+
+  /**
+   * Sets the scope of this code.
+   * 
+   * @param scope is this code's authorized scope
+   */
+  public void setScope(List<String> scope) {
+    this.scope = scope;
+  }
+
+  /**
+   * Sets the client associated with this code.
+   * 
+   * @param client is the client to associate with this code
+   */
+  public void setClient(OAuth2Client client) {
+    this.client = client;
+  }
+
+  /**
+   * Returns the client associated with this code.
+   * 
+   * @return OAuth2Client represents the client associated with this code
+   */
+  public OAuth2Client getClient() {
+    return client;
+  }
+
+  /**
+   * Sets the type of this code; one of
+   *  AUTHORIZATION_CODE,
+   *  ACCESS_TOKEN,
+   *  REFRESH_TOKEN
+   *  
+   * @param type is this code's type
+   */
+  public void setType(CodeType type) {
+    this.type = type;
+  }
+
+  /**
+   * Returns the type of this code.
+   * 
+   * @return CodeType represents the type of this code
+   */
+  public CodeType getType() {
+    return type;
+  }
+
+  /**
+   * Sets the authorization code that this code is related to, if applicable.
+   * 
+   * @param code is the authorization code to associate with this code
+   */
+  public void setRelatedAuthCode(OAuth2Code code) {
+    this.relatedAuthCode = code;
+  }
+
+  /**
+   * Returns the authorization code related to this code.
+   * 
+   * @return OAuth2Code is the authorization code related to this code
+   */
+  public OAuth2Code getRelatedAuthCode() {
+    return relatedAuthCode;
+  }
+
+  /**
+   * Sets the related refresh token.
+   * 
+   * @param relatedRefreshToken is the refresh token related to this code
+   */
+  public void setRelatedRefreshToken(OAuth2Code relatedRefreshToken) {
+    this.relatedRefreshToken = relatedRefreshToken;
+  }
+
+  /**
+   * Gets the related refresh token.
+   * 
+   * @return OAuth2Code is the refresh token related to this code
+   */
+  public OAuth2Code getRelatedRefreshToken() {
+    return relatedRefreshToken;
+  }
+
+  /**
+   * Sets the related access token.
+   * 
+   * @param relatedAccessToken is the access token related to this code
+   */
+  public void setRelatedAccessToken(OAuth2Code relatedAccessToken) {
+    this.relatedAccessToken = relatedAccessToken;
+  }
+
+  /**
+   * Gets the related access token.
+   * 
+   * @return OAuth2Code is the access token related to this code
+   */
+  public OAuth2Code getRelatedAccessToken() {
+    return relatedAccessToken;
+  }
 }
\ No newline at end of file

Propchange: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Code.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataService.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataService.java?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataService.java (original)
+++ shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataService.java Mon Feb 13 02:59:33 2012
@@ -1,113 +1,113 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.shindig.social.core.oauth2;
-
-/**
- * Services to support the management of data for the OAuth 2.0 specification.
- * Includes management of clients, authorization codes, access tokens, and
- * refresh tokens.
- * 
- * TODO (Eric): client registration services
- */
-public interface OAuth2DataService {
-
-  /**
-   * Retrieves a pre-registered client by ID.
-   * 
-   * @param clientId identifies the client to retrieve
-   * 
-   * @param OAuth2Client is the retrieved client
-   */
-  public OAuth2Client getClient(String clientId);
-
-  /**
-   * Retrieves an authorization code by its value.
-   * 
-   * @param clientId identifies the client who owns the authorization code
-   * @param authCode is the value of the authorization code to get
-   * 
-   * @return OAuth2Code is the retrieved authorization code
-   */
-  public OAuth2Code getAuthorizationCode(String clientId, String authCode);
-
-  /**
-   * Registers an authorization code with a client.
-   * 
-   * @param clientId identifies the client who owns the authorization code
-   * @param authCode is the authorization code to register with the client
-   */
-  public void registerAuthorizationCode(String clientId, OAuth2Code authCode);
-
-  /**
-   * Unregisters an authorization code with a client.
-   * 
-   * @param clientId identifies the client who owns the authorization code
-   * @param authCode is the value of the authorization code to unregister
-   */
-  public void unregisterAuthorizationCode(String clientId, String authCode);
-
-  /**
-   * Retrieves an access token by its value.
-   * 
-   * @param accessToken is the value of the accessToken to retrieve
-   * 
-   * @return OAuth2Code is the retrieved access token; null if not found
-   */
-  public OAuth2Code getAccessToken(String accessToken);
-
-  /**
-   * Registers an access token with a client.
-   * 
-   * @param clientId identifies the client to register the access token with
-   * @param accessToken is the access token to register with the client
-   */
-  public void registerAccessToken(String clientId, OAuth2Code accessToken);
-
-  /**
-   * Unregisters an access token with a client.
-   * 
-   * @param clientId identifies the client who owns the access token
-   * @param accessToken is the value of the access token to unregister
-   */
-  public void unregisterAccessToken(String clientId, String accessToken);
-
-  /**
-   * Retrieves a refresh token by its value.
-   * 
-   * @param refreshToken is the value of the refresh token to retrieve
-   * 
-   * @return OAuth2Code is the retrieved refresh token; null if not found
-   */
-  public OAuth2Code getRefreshToken(String refreshToken);
-
-  /**
-   * Registers a refresh token with a client.
-   * 
-   * @param clientId identifies the client who owns the refresh token
-   * @param refreshToken is the refresh token to register with the client
-   */
-  public void registerRefreshToken(String clientId, OAuth2Code refreshToken);
-
-  /**
-   * Unregisters a refresh token with a client.
-   * 
-   * @param clientId identifies the client who owns the refresh token
-   * @param refreshToken is the value of the refresh token to unregister
-   */
-  public void unregisterRefreshToken(String clientId, String refreshToken);
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.social.core.oauth2;
+
+/**
+ * Services to support the management of data for the OAuth 2.0 specification.
+ * Includes management of clients, authorization codes, access tokens, and
+ * refresh tokens.
+ * 
+ * TODO (Eric): client registration services
+ */
+public interface OAuth2DataService {
+
+  /**
+   * Retrieves a pre-registered client by ID.
+   * 
+   * @param clientId identifies the client to retrieve
+   * 
+   * @param OAuth2Client is the retrieved client
+   */
+  public OAuth2Client getClient(String clientId);
+
+  /**
+   * Retrieves an authorization code by its value.
+   * 
+   * @param clientId identifies the client who owns the authorization code
+   * @param authCode is the value of the authorization code to get
+   * 
+   * @return OAuth2Code is the retrieved authorization code
+   */
+  public OAuth2Code getAuthorizationCode(String clientId, String authCode);
+
+  /**
+   * Registers an authorization code with a client.
+   * 
+   * @param clientId identifies the client who owns the authorization code
+   * @param authCode is the authorization code to register with the client
+   */
+  public void registerAuthorizationCode(String clientId, OAuth2Code authCode);
+
+  /**
+   * Unregisters an authorization code with a client.
+   * 
+   * @param clientId identifies the client who owns the authorization code
+   * @param authCode is the value of the authorization code to unregister
+   */
+  public void unregisterAuthorizationCode(String clientId, String authCode);
+
+  /**
+   * Retrieves an access token by its value.
+   * 
+   * @param accessToken is the value of the accessToken to retrieve
+   * 
+   * @return OAuth2Code is the retrieved access token; null if not found
+   */
+  public OAuth2Code getAccessToken(String accessToken);
+
+  /**
+   * Registers an access token with a client.
+   * 
+   * @param clientId identifies the client to register the access token with
+   * @param accessToken is the access token to register with the client
+   */
+  public void registerAccessToken(String clientId, OAuth2Code accessToken);
+
+  /**
+   * Unregisters an access token with a client.
+   * 
+   * @param clientId identifies the client who owns the access token
+   * @param accessToken is the value of the access token to unregister
+   */
+  public void unregisterAccessToken(String clientId, String accessToken);
+
+  /**
+   * Retrieves a refresh token by its value.
+   * 
+   * @param refreshToken is the value of the refresh token to retrieve
+   * 
+   * @return OAuth2Code is the retrieved refresh token; null if not found
+   */
+  public OAuth2Code getRefreshToken(String refreshToken);
+
+  /**
+   * Registers a refresh token with a client.
+   * 
+   * @param clientId identifies the client who owns the refresh token
+   * @param refreshToken is the refresh token to register with the client
+   */
+  public void registerRefreshToken(String clientId, OAuth2Code refreshToken);
+
+  /**
+   * Unregisters a refresh token with a client.
+   * 
+   * @param clientId identifies the client who owns the refresh token
+   * @param refreshToken is the value of the refresh token to unregister
+   */
+  public void unregisterRefreshToken(String clientId, String refreshToken);
 }
\ No newline at end of file

Propchange: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataServiceImpl.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataServiceImpl.java?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataServiceImpl.java (original)
+++ shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataServiceImpl.java Mon Feb 13 02:59:33 2012
@@ -1,187 +1,187 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.shindig.social.core.oauth2;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.shindig.common.util.ResourceLoader;
-import org.apache.shindig.protocol.ProtocolException;
-import org.apache.shindig.protocol.conversion.BeanConverter;
-import org.apache.shindig.social.core.oauth2.OAuth2Client.ClientType;
-import org.apache.shindig.social.core.oauth2.OAuth2Types.CodeType;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-
-public class OAuth2DataServiceImpl implements OAuth2DataService {
-
-  private JSONObject oauthDB; // the OAuth 2.0 JSON DB
-  private BeanConverter converter; // the JSON<->Bean converter
-  private List<OAuth2Client> clients; // list of clients
-  private Map<String, List<OAuth2Code>> authCodes; // authorization codes per client
-  private Map<String, List<OAuth2Code>> accessTokens; // access tokens per client
-
-  @Inject
-  public OAuth2DataServiceImpl(
-      @Named("shindig.canonical.json.db") String jsonLocation,
-      @Named("shindig.bean.converter.json") BeanConverter converter,
-      @Named("shindig.contextroot") String contextroot) throws Exception {
-    String content = IOUtils.toString(ResourceLoader.openResource(jsonLocation), "UTF-8");
-    content = content.replace("%contextRoot%", contextroot);
-    this.oauthDB = new JSONObject(content).getJSONObject("oauth2");
-    this.converter = converter;
-    this.clients = Lists.newArrayList();
-    this.authCodes = Maps.newHashMap();
-    this.accessTokens = Maps.newHashMap();
-    loadClientsFromCanonical();
-  }
-
-  public OAuth2Client getClient(String clientId) {
-    for (OAuth2Client client : clients) {
-      if (client.getId().equals(clientId)) {
-        return client;
-      }
-    }
-    return null;
-  }
-
-  public OAuth2Code getAuthorizationCode(String clientId, String authCode) {
-    if (authCodes.containsKey(clientId)) {
-      List<OAuth2Code> codes = authCodes.get(clientId);
-      for (OAuth2Code code : codes) {
-        if (code.getValue().equals(authCode)) {
-          return code;
-        }
-      }
-    }
-    return null;
-  }
-
-  public void registerAuthorizationCode(String clientId, OAuth2Code authCode) {
-    if (authCodes.containsKey(clientId)) {
-      authCodes.get(clientId).add(authCode);
-    } else {
-      List<OAuth2Code> list = Lists.newArrayList();
-      list.add(authCode);
-      authCodes.put(clientId, list);
-    }
-  }
-
-  public void unregisterAuthorizationCode(String clientId, String authCode) {
-    if (authCodes.containsKey(clientId)) {
-      List<OAuth2Code> codes = authCodes.get(clientId);
-      for (OAuth2Code code : codes) {
-        if (code.getValue().equals(authCode)) {
-          codes.remove(code);
-          return;
-        }
-      }
-    }
-    throw new RuntimeException("signature not found"); // TODO (Eric): handle error
-  }
-
-  public OAuth2Code getAccessToken(String accessToken) {
-    for (String clientId : accessTokens.keySet()) {
-      List<OAuth2Code> tokens = accessTokens.get(clientId);
-      for (OAuth2Code token : tokens) {
-        if (token.getValue().equals(accessToken)) {
-          return token;
-        }
-      }
-    }
-    return null;
-  }
-
-  public void registerAccessToken(String clientId, OAuth2Code accessToken) {
-    if (accessTokens.containsKey(clientId)) {
-      accessTokens.get(clientId).add(accessToken);
-    } else {
-      List<OAuth2Code> list = Lists.newArrayList();
-      list.add(accessToken);
-      accessTokens.put(clientId, list);
-    }
-  }
-
-  public void unregisterAccessToken(String clientId, String accessToken) {
-    if (accessTokens.containsKey(clientId)) {
-      List<OAuth2Code> tokens = accessTokens.get(clientId);
-      for (OAuth2Code token : tokens) {
-        if (token.getValue().equals(accessToken)) {
-          tokens.remove(token);
-          return;
-        }
-      }
-    }
-    throw new RuntimeException("access token not found"); // TODO (Eric): handle error
-  }
-
-  public OAuth2Code getRefreshToken(String refreshToken) {
-    throw new RuntimeException("not yet implemented");
-  }
-
-  public void registerRefreshToken(String clientId, OAuth2Code refreshToken) {
-    throw new RuntimeException("not yet implemented");
-  }
-
-  public void unregisterRefreshToken(String clientId, String refreshToken) {
-    throw new RuntimeException("not yet implemented");
-  }
-
-  private void loadClientsFromCanonical() {
-    for (String clientId : JSONObject.getNames(oauthDB)) {
-      JSONObject clientJson;
-      try {
-        clientJson = oauthDB.getJSONObject(clientId).getJSONObject("registration");
-        OAuth2Client client = converter.convertToObject(clientJson.toString(), OAuth2Client.class);
-        client.setType(clientJson.getString("type").equals("public") ? ClientType.PUBLIC : ClientType.CONFIDENTIAL);
-        clients.add(client);
-        JSONObject clientJS = oauthDB.getJSONObject(clientId);
-        if (clientJS.has("authorizationCodes")) {
-          JSONObject authCodes = clientJS.getJSONObject("authorizationCodes");
-          for (String authCodeId : JSONObject.getNames(authCodes)) {
-            OAuth2Code code = converter.convertToObject(authCodes
-                .getJSONObject(authCodeId).toString(), OAuth2Code.class);
-            code.setValue(authCodeId);
-            code.setClient(client);
-            registerAuthorizationCode(clientId, code);
-          }
-        }
-        if (clientJS.has("accessTokens")) {
-          JSONObject accessTokens = clientJS.getJSONObject("accessTokens");
-          for (String accessTokenId : JSONObject.getNames(accessTokens)) {
-            OAuth2Code code = converter.convertToObject(accessTokens.getJSONObject(accessTokenId).toString(), OAuth2Code.class);
-            code.setValue(accessTokenId);
-            code.setClient(client);
-            code.setType(CodeType.ACCESS_TOKEN);
-            registerAccessToken(clientId, code);
-          }
-        }
-      } catch (JSONException je) {
-        throw new ProtocolException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, je.getMessage(), je);
-      }
-    }
-  }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.social.core.oauth2;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.shindig.common.util.ResourceLoader;
+import org.apache.shindig.protocol.ProtocolException;
+import org.apache.shindig.protocol.conversion.BeanConverter;
+import org.apache.shindig.social.core.oauth2.OAuth2Client.ClientType;
+import org.apache.shindig.social.core.oauth2.OAuth2Types.CodeType;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+
+public class OAuth2DataServiceImpl implements OAuth2DataService {
+
+  private JSONObject oauthDB; // the OAuth 2.0 JSON DB
+  private BeanConverter converter; // the JSON<->Bean converter
+  private List<OAuth2Client> clients; // list of clients
+  private Map<String, List<OAuth2Code>> authCodes; // authorization codes per client
+  private Map<String, List<OAuth2Code>> accessTokens; // access tokens per client
+
+  @Inject
+  public OAuth2DataServiceImpl(
+      @Named("shindig.canonical.json.db") String jsonLocation,
+      @Named("shindig.bean.converter.json") BeanConverter converter,
+      @Named("shindig.contextroot") String contextroot) throws Exception {
+    String content = IOUtils.toString(ResourceLoader.openResource(jsonLocation), "UTF-8");
+    content = content.replace("%contextRoot%", contextroot);
+    this.oauthDB = new JSONObject(content).getJSONObject("oauth2");
+    this.converter = converter;
+    this.clients = Lists.newArrayList();
+    this.authCodes = Maps.newHashMap();
+    this.accessTokens = Maps.newHashMap();
+    loadClientsFromCanonical();
+  }
+
+  public OAuth2Client getClient(String clientId) {
+    for (OAuth2Client client : clients) {
+      if (client.getId().equals(clientId)) {
+        return client;
+      }
+    }
+    return null;
+  }
+
+  public OAuth2Code getAuthorizationCode(String clientId, String authCode) {
+    if (authCodes.containsKey(clientId)) {
+      List<OAuth2Code> codes = authCodes.get(clientId);
+      for (OAuth2Code code : codes) {
+        if (code.getValue().equals(authCode)) {
+          return code;
+        }
+      }
+    }
+    return null;
+  }
+
+  public void registerAuthorizationCode(String clientId, OAuth2Code authCode) {
+    if (authCodes.containsKey(clientId)) {
+      authCodes.get(clientId).add(authCode);
+    } else {
+      List<OAuth2Code> list = Lists.newArrayList();
+      list.add(authCode);
+      authCodes.put(clientId, list);
+    }
+  }
+
+  public void unregisterAuthorizationCode(String clientId, String authCode) {
+    if (authCodes.containsKey(clientId)) {
+      List<OAuth2Code> codes = authCodes.get(clientId);
+      for (OAuth2Code code : codes) {
+        if (code.getValue().equals(authCode)) {
+          codes.remove(code);
+          return;
+        }
+      }
+    }
+    throw new RuntimeException("signature not found"); // TODO (Eric): handle error
+  }
+
+  public OAuth2Code getAccessToken(String accessToken) {
+    for (String clientId : accessTokens.keySet()) {
+      List<OAuth2Code> tokens = accessTokens.get(clientId);
+      for (OAuth2Code token : tokens) {
+        if (token.getValue().equals(accessToken)) {
+          return token;
+        }
+      }
+    }
+    return null;
+  }
+
+  public void registerAccessToken(String clientId, OAuth2Code accessToken) {
+    if (accessTokens.containsKey(clientId)) {
+      accessTokens.get(clientId).add(accessToken);
+    } else {
+      List<OAuth2Code> list = Lists.newArrayList();
+      list.add(accessToken);
+      accessTokens.put(clientId, list);
+    }
+  }
+
+  public void unregisterAccessToken(String clientId, String accessToken) {
+    if (accessTokens.containsKey(clientId)) {
+      List<OAuth2Code> tokens = accessTokens.get(clientId);
+      for (OAuth2Code token : tokens) {
+        if (token.getValue().equals(accessToken)) {
+          tokens.remove(token);
+          return;
+        }
+      }
+    }
+    throw new RuntimeException("access token not found"); // TODO (Eric): handle error
+  }
+
+  public OAuth2Code getRefreshToken(String refreshToken) {
+    throw new RuntimeException("not yet implemented");
+  }
+
+  public void registerRefreshToken(String clientId, OAuth2Code refreshToken) {
+    throw new RuntimeException("not yet implemented");
+  }
+
+  public void unregisterRefreshToken(String clientId, String refreshToken) {
+    throw new RuntimeException("not yet implemented");
+  }
+
+  private void loadClientsFromCanonical() {
+    for (String clientId : JSONObject.getNames(oauthDB)) {
+      JSONObject clientJson;
+      try {
+        clientJson = oauthDB.getJSONObject(clientId).getJSONObject("registration");
+        OAuth2Client client = converter.convertToObject(clientJson.toString(), OAuth2Client.class);
+        client.setType(clientJson.getString("type").equals("public") ? ClientType.PUBLIC : ClientType.CONFIDENTIAL);
+        clients.add(client);
+        JSONObject clientJS = oauthDB.getJSONObject(clientId);
+        if (clientJS.has("authorizationCodes")) {
+          JSONObject authCodes = clientJS.getJSONObject("authorizationCodes");
+          for (String authCodeId : JSONObject.getNames(authCodes)) {
+            OAuth2Code code = converter.convertToObject(authCodes
+                .getJSONObject(authCodeId).toString(), OAuth2Code.class);
+            code.setValue(authCodeId);
+            code.setClient(client);
+            registerAuthorizationCode(clientId, code);
+          }
+        }
+        if (clientJS.has("accessTokens")) {
+          JSONObject accessTokens = clientJS.getJSONObject("accessTokens");
+          for (String accessTokenId : JSONObject.getNames(accessTokens)) {
+            OAuth2Code code = converter.convertToObject(accessTokens.getJSONObject(accessTokenId).toString(), OAuth2Code.class);
+            code.setValue(accessTokenId);
+            code.setClient(client);
+            code.setType(CodeType.ACCESS_TOKEN);
+            registerAccessToken(clientId, code);
+          }
+        }
+      } catch (JSONException je) {
+        throw new ProtocolException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, je.getMessage(), je);
+      }
+    }
+  }
 }
\ No newline at end of file

Propchange: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2DataServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Exception.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Exception.java?rev=1243399&r1=1243398&r2=1243399&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Exception.java (original)
+++ shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Exception.java Mon Feb 13 02:59:33 2012
@@ -1,47 +1,47 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.shindig.social.core.oauth2;
-
-/**
- * Represents an exception while dancing with OAuth 2.0.
- */
-public class OAuth2Exception extends Exception {
-
-  private static final long serialVersionUID = -5892464438773813010L;
-  private OAuth2NormalizedResponse response;
-
-  /**
-   * Constructs an OAuth2Exception.
-   * 
-   * @param response is the normalized response that should be used to
-   * formulate a server response.
-   */
-  public OAuth2Exception(OAuth2NormalizedResponse response) {
-    super(response.getErrorDescription());
-    this.response = response;
-  }
-
-  /**
-   * Retrieves the normalized response.
-   * 
-   * @return OAuth2NormalizedResponse encapsulates the OAuth error
-   */
-  public OAuth2NormalizedResponse getNormalizedResponse() {
-    return response;
-  }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.social.core.oauth2;
+
+/**
+ * Represents an exception while dancing with OAuth 2.0.
+ */
+public class OAuth2Exception extends Exception {
+
+  private static final long serialVersionUID = -5892464438773813010L;
+  private OAuth2NormalizedResponse response;
+
+  /**
+   * Constructs an OAuth2Exception.
+   * 
+   * @param response is the normalized response that should be used to
+   * formulate a server response.
+   */
+  public OAuth2Exception(OAuth2NormalizedResponse response) {
+    super(response.getErrorDescription());
+    this.response = response;
+  }
+
+  /**
+   * Retrieves the normalized response.
+   * 
+   * @return OAuth2NormalizedResponse encapsulates the OAuth error
+   */
+  public OAuth2NormalizedResponse getNormalizedResponse() {
+    return response;
+  }
 }
\ No newline at end of file

Propchange: shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/oauth2/OAuth2Exception.java
------------------------------------------------------------------------------
    svn:eol-style = native