2009-09-03 11:02:21 +02:00
|
|
|
package se.scalablesolutions.akka.state
|
2009-08-12 17:01:11 +05:30
|
|
|
|
|
|
|
|
// abstracts persistence storage
|
2009-09-03 11:02:21 +02:00
|
|
|
trait Storage
|
2009-08-12 17:01:11 +05:30
|
|
|
|
|
|
|
|
// for Maps
|
|
|
|
|
trait MapStorage extends Storage {
|
|
|
|
|
def insertMapStorageEntriesFor(name: String, entries: List[Tuple2[AnyRef, AnyRef]])
|
|
|
|
|
def insertMapStorageEntryFor(name: String, key: AnyRef, value: AnyRef)
|
|
|
|
|
def removeMapStorageFor(name: String)
|
|
|
|
|
def removeMapStorageFor(name: String, key: AnyRef)
|
|
|
|
|
def getMapStorageEntryFor(name: String, key: AnyRef): Option[AnyRef]
|
|
|
|
|
def getMapStorageSizeFor(name: String): Int
|
|
|
|
|
def getMapStorageFor(name: String): List[Tuple2[AnyRef, AnyRef]]
|
2009-09-03 11:02:21 +02:00
|
|
|
def getMapStorageRangeFor(name: String, start: Option[AnyRef], finish: Option[AnyRef], count: Int): List[Tuple2[AnyRef, AnyRef]]
|
2009-08-12 17:01:11 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// for vectors
|
|
|
|
|
trait VectorStorage extends Storage {
|
|
|
|
|
def insertVectorStorageEntryFor(name: String, element: AnyRef)
|
|
|
|
|
def insertVectorStorageEntriesFor(name: String, elements: List[AnyRef])
|
|
|
|
|
def getVectorStorageEntryFor(name: String, index: Int): AnyRef
|
|
|
|
|
def getVectorStorageRangeFor(name: String, start: Option[Int], finish: Option[Int], count: Int): List[AnyRef]
|
|
|
|
|
def getVectorStorageSizeFor(name: String): Int
|
|
|
|
|
}
|
2009-08-14 16:05:35 +05:30
|
|
|
|
|
|
|
|
// for Ref
|
|
|
|
|
trait RefStorage extends Storage {
|
|
|
|
|
def insertRefStorageFor(name: String, element: AnyRef)
|
|
|
|
|
def getRefStorageFor(name: String): Option[AnyRef]
|
|
|
|
|
}
|