[kune-commits] r1865 - in trunk: debian src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/manager src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/rpc

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun May 6 00:49:51 CEST 2012


Author: vjrj_
Date: 2012-05-06 00:49:50 +0200 (Sun, 06 May 2012)
New Revision: 1865

Modified:
   trunk/debian/changelog
   trunk/debian/files
   trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
   trunk/src/main/java/cc/kune/core/server/manager/SocialNetworkManager.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
Log:
Some minor fix in SN Caching

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2012-05-02 23:30:11 UTC (rev 1864)
+++ trunk/debian/changelog	2012-05-05 22:49:50 UTC (rev 1865)
@@ -1,3 +1,9 @@
+kune (0.2.0+b5) unstable; urgency=low
+
+  * Some UI improvements (header and sitebar reorganization, etc)
+
+ -- Vicente J. Ruiz Jurado <vjrj at ourproject.org>  Thu, 03 May 2012 01:30:52 +0200
+
 kune (0.2.0+b4) unstable; urgency=low
 
   * Added some kune.wave.import.usernamespairs param

Modified: trunk/debian/files
===================================================================
--- trunk/debian/files	2012-05-02 23:30:11 UTC (rev 1864)
+++ trunk/debian/files	2012-05-05 22:49:50 UTC (rev 1865)
@@ -1 +1 @@
-kune_0.2.0+b4_all.deb java optional
+kune_0.2.0+b5_all.deb java optional

Modified: trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/UserSessionManager.java	2012-05-02 23:30:11 UTC (rev 1864)
+++ trunk/src/main/java/cc/kune/core/server/UserSessionManager.java	2012-05-05 22:49:50 UTC (rev 1865)
@@ -66,6 +66,8 @@
     //
     // Best way maybe it's accessing openfire db:
     // http://www.mastertheboss.com/jboss-howto/45-jboss-persistence/110-jboss-persistencexml-multiple-database.html
+
+    // FIXME add sessions from restored ?
     logins = new HashSet<String>();
   }
 

Modified: trunk/src/main/java/cc/kune/core/server/manager/SocialNetworkManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/SocialNetworkManager.java	2012-05-02 23:30:11 UTC (rev 1864)
+++ trunk/src/main/java/cc/kune/core/server/manager/SocialNetworkManager.java	2012-05-05 22:49:50 UTC (rev 1865)
@@ -19,8 +19,6 @@
  */
 package cc.kune.core.server.manager;
 
-
-
 import cc.kune.core.client.errors.AccessViolationException;
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.shared.dto.SocialNetworkRequestResult;
@@ -32,30 +30,33 @@
 
 public interface SocialNetworkManager extends Manager<SocialNetwork, Long> {
 
-    void acceptJoinGroup(User userLogged, Group group, Group inGroup) throws DefaultException;
+  void acceptJoinGroup(User userLogged, Group group, Group inGroup) throws DefaultException;
 
-    void addGroupToAdmins(User userLogged, Group group, Group inGroup) throws DefaultException;
+  void addAsBuddie(User userLogged, User toUser);
 
-    void addGroupToCollabs(User userLogged, Group group, Group inGroup) throws DefaultException;
+  void addGroupToAdmins(User userLogged, Group group, Group inGroup) throws DefaultException;
 
-    void addGroupToViewers(User userLogged, Group group, Group inGroup) throws DefaultException;
+  void addGroupToCollabs(User userLogged, Group group, Group inGroup) throws DefaultException;
 
-    void deleteMember(User userLogged, Group group, Group inGroup) throws DefaultException, AccessViolationException;
+  void addGroupToViewers(User userLogged, Group group, Group inGroup) throws DefaultException;
 
-    void denyJoinGroup(User userLogged, Group group, Group inGroup) throws DefaultException;
+  void deleteMember(User userLogged, Group group, Group inGroup) throws DefaultException,
+      AccessViolationException;
 
-    ParticipationData findParticipation(User user, Group group) throws DefaultException;
+  void denyJoinGroup(User userLogged, Group group, Group inGroup) throws DefaultException;
 
-    SocialNetwork get(User userLogged, Group group) throws DefaultException;
+  ParticipationData findParticipation(User user, Group group) throws DefaultException;
 
-    SocialNetworkData getSocialNetworkData(User userLogged, Group group);
+  SocialNetwork get(User userLogged, Group group) throws DefaultException;
 
-    SocialNetworkRequestResult requestToJoin(User user, Group inGroup) throws DefaultException;
+  SocialNetworkData getSocialNetworkData(User userLogged, Group group);
 
-    void setAdminAsCollab(User userLogged, Group group, Group inGroup) throws DefaultException;
+  SocialNetworkRequestResult requestToJoin(User user, Group inGroup) throws DefaultException;
 
-    void setCollabAsAdmin(User userLogged, Group group, Group inGroup) throws DefaultException;
+  void setAdminAsCollab(User userLogged, Group group, Group inGroup) throws DefaultException;
 
-    void unJoinGroup(Group groupToUnJoin, Group inGroup) throws DefaultException;
+  void setCollabAsAdmin(User userLogged, Group group, Group inGroup) throws DefaultException;
 
+  void unJoinGroup(Group groupToUnJoin, Group inGroup) throws DefaultException;
+
 }

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java	2012-05-02 23:30:11 UTC (rev 1864)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java	2012-05-05 22:49:50 UTC (rev 1865)
@@ -37,6 +37,7 @@
 import cc.kune.core.server.error.ServerException;
 import cc.kune.core.server.manager.SocialNetworkManager;
 import cc.kune.core.server.manager.UserManager;
+import cc.kune.core.server.notifier.NotificationService;
 import cc.kune.core.server.persist.DataSourceKune;
 import cc.kune.core.shared.domain.AdmissionType;
 import cc.kune.core.shared.domain.GroupListMode;
@@ -64,18 +65,21 @@
 
   private final AccessRightsService accessRightsService;
   private final GroupFinder finder;
+  private final NotificationService notifyService;
   private final SocialNetworkCache snCache;
   private final UserManager userManager;
 
   @Inject
   public SocialNetworkManagerDefault(@DataSourceKune final Provider<EntityManager> provider,
       final GroupFinder finder, final AccessRightsService accessRightsService,
-      final UserManager userManager, final SocialNetworkCache snCache) {
+      final UserManager userManager, final SocialNetworkCache snCache,
+      final NotificationService notifyService) {
     super(provider, SocialNetwork.class);
     this.finder = finder;
     this.accessRightsService = accessRightsService;
     this.userManager = userManager;
     this.snCache = snCache;
+    this.notifyService = notifyService;
   }
 
   @Override
@@ -100,6 +104,13 @@
   }
 
   @Override
+  public void addAsBuddie(final User userLogged, final User toUser) {
+    notifyService.notifyUserToUser(userLogged, toUser, "Added as buddie", "He/she added you as buddie");
+    snCache.expire(userLogged.getUserGroup());
+    snCache.expire(toUser.getUserGroup());
+  }
+
+  @Override
   public void addGroupToAdmins(final User userLogged, final Group group, final Group inGroup)
       throws DefaultException {
     checkGroupAddingToSelf(group, inGroup);

Modified: trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java	2012-05-02 23:30:11 UTC (rev 1864)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java	2012-05-05 22:49:50 UTC (rev 1865)
@@ -103,9 +103,7 @@
   @Authenticated
   @KuneTransactional
   public void addAsBuddie(final String hash, final String userName) throws DefaultException {
-    final User userLogged = userSessionManager.getUser();
-    final User toUser = userFinder.findByShortName(userName);
-    notifyService.notifyUserToUser(userLogged, toUser, "Added as buddie", "He/she added you as buddie");
+    socialNetworkManager.addAsBuddie(userSessionManager.getUser(), userFinder.findByShortName(userName));
   }
 
   @Override




More information about the kune-commits mailing list