cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7268] Preparing for getting some more boilerplate code into AbstractOAuthDataProvider
Date Mon, 06 Mar 2017 17:02:26 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes bcd73b382 -> 6e06a523a


[CXF-7268] Preparing for getting some more boilerplate code into AbstractOAuthDataProvider


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6e06a523
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6e06a523
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6e06a523

Branch: refs/heads/3.1.x-fixes
Commit: 6e06a523ab07e9e6ad31e4a611b1378f319daf29
Parents: bcd73b3
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Mar 6 16:59:16 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Mar 6 17:02:07 2017 +0000

----------------------------------------------------------------------
 .../oauth2/provider/AbstractOAuthDataProvider.java        | 10 +++++++++-
 .../oauth2/provider/DefaultEHCacheOAuthDataProvider.java  |  4 ++--
 .../provider/DefaultEncryptingOAuthDataProvider.java      |  2 +-
 .../security/oauth2/provider/JCacheOAuthDataProvider.java |  2 +-
 .../rs/security/oauth2/provider/JPAOAuthDataProvider.java |  2 +-
 5 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6e06a523/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
index e5a8eba..bcbb0ef 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
@@ -445,12 +445,17 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
     
     @Override
     public Client removeClient(String clientId) {
-        Client c = getClient(clientId);
+        Client c = doGetClient(clientId);
         removeClientTokens(c);
         doRemoveClient(c);
         return c;
     }
     
+    @Override
+    public Client getClient(String clientId) {
+        return doGetClient(clientId);
+    }
+
     protected ServerAccessToken revokeAccessToken(String accessTokenKey) {
         ServerAccessToken at = getAccessToken(accessTokenKey);
         if (at != null) {
@@ -472,6 +477,9 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
     protected abstract void doRevokeAccessToken(ServerAccessToken accessToken);
     protected abstract void doRevokeRefreshToken(RefreshToken  refreshToken);
     protected abstract RefreshToken getRefreshToken(String refreshTokenKey);
+    
+    protected abstract Client doGetClient(String clientId);
+    
     protected abstract void doRemoveClient(Client c);
 
     public List<String> getDefaultScopes() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e06a523/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
index 0db66e9..f406185 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
@@ -74,7 +74,7 @@ public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider
{
     }
     
     @Override
-    public Client getClient(String clientId) throws OAuthServiceException {
+    public Client doGetClient(String clientId) throws OAuthServiceException {
         return getCacheValue(clientCache, clientId, Client.class);
     }
     
@@ -92,7 +92,7 @@ public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider
{
         List<String> keys = CastUtils.cast(clientCache.getKeys());
         List<Client> clients = new ArrayList<Client>(keys.size());
         for (String key : keys) {
-            Client c = getClient(key);
+            Client c = doGetClient(key);
             if (isClientMatched(c, resourceOwner)) {
                 clients.add(c);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e06a523/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEncryptingOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEncryptingOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEncryptingOAuthDataProvider.java
index 02d66d8..8fa7e77 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEncryptingOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEncryptingOAuthDataProvider.java
@@ -52,7 +52,7 @@ public class DefaultEncryptingOAuthDataProvider extends AbstractOAuthDataProvide
     }
     
     @Override
-    public Client getClient(String clientId) throws OAuthServiceException {
+    public Client doGetClient(String clientId) throws OAuthServiceException {
         return ModelEncryptionSupport.decryptClient(clientsMap.get(clientId), key);
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e06a523/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
index 2c6981b..f60747c 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
@@ -100,7 +100,7 @@ public class JCacheOAuthDataProvider extends AbstractOAuthDataProvider
{
     }
     
     @Override
-    public Client getClient(String clientId) throws OAuthServiceException {
+    public Client doGetClient(String clientId) throws OAuthServiceException {
         return clientCache.get(clientId);
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e06a523/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
index 209088c..183014b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
@@ -59,7 +59,7 @@ public class JPAOAuthDataProvider extends AbstractOAuthDataProvider {
     }
 
     @Override
-    public Client getClient(final String clientId) throws OAuthServiceException {
+    public Client doGetClient(final String clientId) throws OAuthServiceException {
         return execute(new EntityManagerOperation<Client>() {
             @Override
             public Client execute(EntityManager em) {


Mime
View raw message