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 16:59:31 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f2fe6260e -> db1e5146e


[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/db1e5146
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/db1e5146
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/db1e5146

Branch: refs/heads/master
Commit: db1e5146e6312a4be35b0ca2644a691cb1d41a0f
Parents: f2fe626
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 16:59:16 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/db1e5146/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 95ab72f..68252f1 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
@@ -440,11 +440,16 @@ 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);
@@ -467,6 +472,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/db1e5146/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 888731f..e186935 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<>(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/db1e5146/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 8a9c36b..77f0be4 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/db1e5146/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 4e6e5e6..a5addd2 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/db1e5146/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 befd05f..ce49673 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