incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r792292 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme: actor/UserActor.scala api/RestAPI.scala lib/AccessPoolMgr.scala lib/MsgParser.scala model/AccessPool.scala model/Mailbox.scala
Date Wed, 08 Jul 2009 20:21:20 GMT
Author: vdichev
Date: Wed Jul  8 20:21:20 2009
New Revision: 792292

URL: http://svn.apache.org/viewvc?rev=792292&view=rev
Log:
Cleanup

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala?rev=792292&r1=792291&r2=792292&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala Wed Jul
 8 20:21:20 2009
@@ -217,13 +217,7 @@
           case DirectReason(fromId) => mb.directlyFrom(fromId)
           case ConversationReason(convId) => mb.conversation(convId)
           case ResendReason(resender) => mb.resentBy(resender)
-          case LoginReason(loggedId) => mb.login(loggedId)
-          case FollowedReason(followerId) => mb.followed(followerId)
-          case UnfollowedReason(unfollowerId) => mb.unfollowed(unfollowerId)
-          case ProfileReason(moduserId) => mb.profile(moduserId)
-          case RegularReason(actionId) => mb.regular(actionId)
-          case InterpreterReason(userId) => mb.interpreter(userId)
-          case NoReason =>
+          case _ =>
         }
         mb.saveMe
           

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala?rev=792292&r1=792291&r2=792292&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala Wed Jul 
8 20:21:20 2009
@@ -295,7 +295,7 @@
       val from: String = params.param("via") openOr "api"
       val pool = for (poolName <- params.param("pool");
                       p <- AccessPool.findPool(poolName,
-                        params.param("realm") openOr "Native")
+                        params.param("realm") openOr AccessPool.Native)
                       ) yield p.id.is
 
       val xml: Box[Elem] = params.param("metadata").flatMap(md =>
@@ -354,7 +354,7 @@
   def addPool(poolName: String): LiftResponse = {
     val r: Box[Boolean] =
     for (user <- User.currentUser;
-         pool <- AccessPool.create.realm("Native").setName(poolName);
+         pool <- AccessPool.create.realm(AccessPool.Native).setName(poolName);
          privilegeSaved = Privilege.create.pool(pool.saveMe).user(user).
            permission(Permission.Admin).save
     ) yield {
@@ -369,7 +369,7 @@
     val r: Box[Boolean] = 
     for (adminUser <- User.currentUser;
          poolName <- S.param("pool") ?~ "Pool not specified";
-         realm <- (S.param("realm") or Full("Native"));
+         realm <- (S.param("realm") or Full(AccessPool.Native));
          pool <- AccessPool.findPool(poolName, realm) ?~ "Pool not found";
          userName <- S.param("user") ?~ "User to add to pool not specified";
          user <- User.findFromWeb(userName) ?~ "User not found";

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala?rev=792292&r1=792291&r2=792292&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala Wed
Jul  8 20:21:20 2009
@@ -67,7 +67,7 @@
       name.trim match {
         case x if x.length < 3 => S.error("Name too short")
         case x => {
-          val pool = AccessPool.create.realm("Native").setName(name)
+          val pool = AccessPool.create.realm(AccessPool.Native).setName(name)
           pool match {
             case Failure(_,_,_) => S.error("Duplicate pool name!")
             case Full(p: AccessPool) => val privilegeSaved =

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala?rev=792292&r1=792291&r2=792292&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala Wed Jul
 8 20:21:20 2009
@@ -65,7 +65,7 @@
   
   lazy val poolName: Parser[MsgInfo] = acceptCI("pool:") ~> poolNameStr ^^ {
     case name => 
-      AccessPool.findPool(name, "Native") match {
+      AccessPool.findPool(name, AccessPool.Native) match {
         case Full(p) => PoolName(p)
         case _ => MsgText("pool:"+name)
       }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala?rev=792292&r1=792291&r2=792292&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala Wed
Jul  8 20:21:20 2009
@@ -29,6 +29,7 @@
 import scala.xml.Text
 
 object AccessPool extends AccessPool with LongKeyedMetaMapper[AccessPool] {
+  val Native = "Native"
 
   def findPool(name: String, realm: String): Box[AccessPool] = 
     AccessPool.find(By(AccessPool.name,  name),

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala?rev=792292&r1=792291&r2=792292&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala Wed Jul
 8 20:21:20 2009
@@ -56,12 +56,6 @@
   object directlyFrom extends MappedLongForeignKey(this, User)
   object conversation extends MappedLongForeignKey(this, Message)
   object resentBy extends MappedLongForeignKey(this, User)
-  object login extends MappedLongForeignKey(this, User)
-  object followed extends MappedLongForeignKey(this, User)
-  object unfollowed extends MappedLongForeignKey(this, User)
-  object profile extends MappedLongForeignKey(this, User)
-  object regular extends MappedLongForeignKey(this, Action)
-  object interpreter extends MappedLongForeignKey(this, User)
 
   lazy val reason: MailboxReason =
   viaTrack.can.map(TrackReason) or directlyFrom.can.map(DirectReason)  or



Mime
View raw message