Start shaving user actor in preparation for new billing framework
authorChristos KK Loverdos <loverdos@gmail.com>
Mon, 5 Mar 2012 15:59:30 +0000 (17:59 +0200)
committerChristos KK Loverdos <loverdos@gmail.com>
Mon, 5 Mar 2012 15:59:30 +0000 (17:59 +0200)
src/main/scala/gr/grnet/aquarium/user/actor/UserActor.scala

index 7748607..74f2ac7 100644 (file)
@@ -93,12 +93,6 @@ class UserActor extends AquariumActor
     }
   }
 
-  private[this] def findRelatedEntries(res: DSLResource, instid: String): List[WalletEntry] = {
-    val walletDB = _configurator.storeProvider.walletEntryStore
-    walletDB.findPreviousEntry(_userId, res.name, instid, Some(false))
-  }
-
-
   private[this] def processModifyUser(event: UserEvent): Unit = {
     val now = TimeHelpers.nowMillis
     val newActive = ActiveStateSnapshot(event.isStateActive, now)
@@ -183,22 +177,6 @@ class UserActor extends AquariumActor
    */
   def replayUserEvents(initState: UserState, events: List[UserEvent],
                        from: Long, to: Long): UserState = {
-//    var act = initState.active
-//    var rol = initState.roles
-//    events
-//      .filter(e => e.occurredMillis >= from && e.occurredMillis < to)
-//      .foreach {
-//        e =>
-//          act = act.copy(
-//            data = e.isStateActive, snapshotTime = e.occurredMillis)
-//          // TODO: Implement the following
-//          //_userState.agreement = _userState.agreement.copy(
-//          //  data = e.newAgreement, e.occurredMillis)
-//
-//          rol = rol.copy(data = e.roles,
-//            snapshotTime = e.occurredMillis)
-//    }
-//    initState.copy(active = act, roles = rol)
     initState
   }
 
@@ -208,19 +186,6 @@ class UserActor extends AquariumActor
    */
   def replayWalletEntries(initState: UserState, events: List[WalletEntry],
                           from: Long, to: Long): UserState = {
-//    var cred = initState.credits
-//    events
-//      .filter(e => e.occurredMillis >= from && e.occurredMillis < to)
-//      .foreach {
-//        w =>
-//          val newVal = cred.creditAmount + w.value
-//          cred = cred.copy(data = newVal)
-//    }
-//    if (!events.isEmpty) {
-//      val snapTime = events.map{e => e.occurredMillis}.max
-//      cred = cred.copy(snapshotTime = snapTime)
-//    }
-//    initState.copy(credits = cred)
     initState
   }