ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1369323 - in /ace/sandbox/marrs: org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/ org.apache.ace.client.repository.impl/src/org/apache/ace/client/repository/impl/ org.apache.ace.client.rest/src/org/apache/ace/clie...
Date Sat, 04 Aug 2012 13:41:44 GMT
Author: marrs
Date: Sat Aug  4 13:41:44 2012
New Revision: 1369323

URL: http://svn.apache.org/viewvc?rev=1369323&view=rev
Log:
ACE-287 Split logout and local cleanup because you don't always want to do both. Added local
cleanup to the closing of the WebUI (when a session expires).

Modified:
    ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/RepositoryAdmin.java
    ace/sandbox/marrs/org.apache.ace.client.repository.impl/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java
    ace/sandbox/marrs/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java
    ace/sandbox/marrs/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java

Modified: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/RepositoryAdmin.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/RepositoryAdmin.java?rev=1369323&r1=1369322&r2=1369323&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/RepositoryAdmin.java
(original)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/RepositoryAdmin.java
Sat Aug  4 13:41:44 2012
@@ -155,4 +155,12 @@ public interface RepositoryAdmin
      * and have the given working state.
      */
     public int getNumberWithWorkingState(Class<? extends RepositoryObject> clazz, WorkingState
state);
+    
+    /**
+     * Cleans up the local files that make up the client-side cache. This method
+     * can be invoked after logging out of a session to clean up. This operation
+     * is optional, since you might want to be able to log back in in which case
+     * you probably don't want to delete the cache.
+     */
+    public void deleteLocal();
 }
\ No newline at end of file

Modified: ace/sandbox/marrs/org.apache.ace.client.repository.impl/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.impl/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java?rev=1369323&r1=1369322&r2=1369323&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.impl/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java
(original)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.impl/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java
Sat Aug  4 13:41:44 2012
@@ -388,17 +388,23 @@ public class RepositoryAdminImpl impleme
             for (RepositorySet set : m_repositorySets) {
                 set.clearRepositories();
                 set.unregisterHandler();
-                set.deleteLocal();
+//                set.deleteLocal();
             }
 
             m_user = null;
-            m_repositorySets = new RepositorySet[0];
+//            m_repositorySets = new RepositorySet[0];
         }
         m_changeNotifier.notifyChanged(TOPIC_LOGOUT_SUFFIX, null);
         if (exception != null) {
             throw exception;
         }
     }
+    
+    public void deleteLocal() {
+        for (RepositorySet set : m_repositorySets) {
+            set.deleteLocal();
+        }
+    }
 
     private boolean loggedIn() {
         return m_user != null;

Modified: ace/sandbox/marrs/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java?rev=1369323&r1=1369322&r2=1369323&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java
(original)
+++ ace/sandbox/marrs/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java
Sat Aug  4 13:41:44 2012
@@ -196,6 +196,7 @@ public class Workspace {
     public void logout() throws IOException {
         try {
             m_repositoryAdmin.logout(true);
+            m_repositoryAdmin.deleteLocal();
         }
         catch (IllegalStateException ise) {
             m_log.log(LogService.LOG_DEBUG, "Nobody was logged into this session, continuing.");

Modified: ace/sandbox/marrs/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java?rev=1369323&r1=1369322&r2=1369323&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java
(original)
+++ ace/sandbox/marrs/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java
Sat Aug  4 13:41:44 2012
@@ -268,7 +268,7 @@ public class VaadinClient extends com.va
         // Authenticate the user either by showing a login window; or by another means...
         authenticate();
     }
-
+    
     /**
      * Shows the login window on the center of the main window.
      */
@@ -935,9 +935,8 @@ public class VaadinClient extends com.va
 
     @Override
     public void close() {
+        m_admin.deleteLocal();
         super.close();
-        // when the session times out
-        // TODO: clean up the ace client session?
     }
 
     private void showAddArtifactDialog() {



Mime
View raw message