usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [1/5] usergrid git commit: Add ShiroCache invalidation when app is restored, and make our Shiro session manager implement the right interface.
Date Mon, 26 Oct 2015 16:10:28 GMT
Repository: usergrid
Updated Branches:
  refs/heads/master a61607579 -> 690110ef8


Add ShiroCache invalidation when app is restored, and make our Shiro session manager implement
the right interface.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/9562ba73
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/9562ba73
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/9562ba73

Branch: refs/heads/master
Commit: 9562ba73399b860b028e02207881ef41ce561b0b
Parents: d1ed645
Author: Dave Johnson <snoopdave@apache.org>
Authored: Fri Oct 23 16:01:40 2015 -0400
Committer: Dave Johnson <snoopdave@apache.org>
Committed: Fri Oct 23 16:01:40 2015 -0400

----------------------------------------------------------------------
 .../security/shiro/session/HttpRequestSessionManager.java   | 9 +++++++--
 .../management/cassandra/ManagementServiceImpl.java         | 4 +++-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/9562ba73/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/session/HttpRequestSessionManager.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/session/HttpRequestSessionManager.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/session/HttpRequestSessionManager.java
index ac839d6..efcc76b 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/session/HttpRequestSessionManager.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/session/HttpRequestSessionManager.java
@@ -25,7 +25,7 @@ import org.apache.shiro.session.Session;
 import org.apache.shiro.session.SessionException;
 import org.apache.shiro.session.mgt.SessionContext;
 import org.apache.shiro.session.mgt.SessionKey;
-import org.apache.shiro.session.mgt.SessionManager;
+import org.apache.shiro.web.session.mgt.WebSessionManager;
 import org.apache.shiro.web.util.WebUtils;
 
 
@@ -34,7 +34,7 @@ import org.apache.shiro.web.util.WebUtils;
  * on each request. This necessarily means that a mechanism like form-based authentication
isn't viable, but the
  * intention is primarily for uses in stateless apis.
  */
-public class HttpRequestSessionManager implements SessionManager {
+public class HttpRequestSessionManager implements WebSessionManager {
 
     static final String REQUEST_ATTRIBUTE_KEY = "__SHIRO_REQUEST_SESSION";
 
@@ -85,4 +85,9 @@ public class HttpRequestSessionManager implements SessionManager {
     protected Session createSession( HttpServletRequest request, String host ) {
         return new HttpServletRequestSession( request, host );
     }
+
+    @Override
+    public boolean isServletContainerSessions() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9562ba73/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index ecf0ae2..d2fe61c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -1728,7 +1728,9 @@ public class ManagementServiceImpl implements ManagementService {
                     + ")</a> restored an application named " + appInfo.getName(), null
);
         }
 
-
+        ScopedCache scopedCache = cacheFactory.getScopedCache(
+            new CacheScope( new SimpleId( CpNamingUtils.MANAGEMENT_APPLICATION_ID, "application"
)));
+        scopedCache.invalidate();
 
         return new ApplicationInfo( applicationId, appInfo.getName() );
     }


Mime
View raw message