WIP Resource event handling
[aquarium] / src / main / scala / gr / grnet / aquarium / store / UserStateStore.scala
index a9cbe14..00832ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
 
 package gr.grnet.aquarium.store
 
-import gr.grnet.aquarium.user.UserState
-import com.ckkloverdos.maybe.Maybe
+import gr.grnet.aquarium.computation.state.UserState
+import gr.grnet.aquarium.computation.BillingMonthInfo
 
 /**
- * A store for user state.
+ * A store for user state snapshots.
  *
- * This is used to hold snapshots of [[gr.grnet.aquarium.user.UserState]]
+ * This is used to hold snapshots of [[gr.grnet.aquarium.computation.state.UserState]].
  *
  * @author Christos KK Loverdos <loverdos@gmail.com>
  */
 
 trait UserStateStore {
-  def storeUserState(userState: UserState): Maybe[RecordID]
-  def findUserStateByUserId(userId: String): Maybe[UserState]
-  def deleteUserState(userId: String): Unit
+
+  /**
+   * Stores a user state.
+   */
+  def insertUserState(userState: UserState): UserState
+
+  /**
+   * Finds a state by user ID
+   */
+  def findUserStateByUserID(userID: String): Option[UserState]
+
+  /**
+   * Finds the most up-to-date user state for the particular billing period.
+   */
+  def findLatestUserStateForFullMonthBilling(userID: String, bmi: BillingMonthInfo): Option[UserState]
 }
\ No newline at end of file