2009-09-10 01:33:01 +02:00
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2009 Scalable Solutions.
|
|
|
|
|
*/
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2009-09-10 01:33:01 +02:00
|
|
|
// for Vectors
|
2009-08-12 17:01:11 +05:30
|
|
|
trait VectorStorage extends Storage {
|
|
|
|
|
def insertVectorStorageEntryFor(name: String, element: AnyRef)
|
|
|
|
|
def insertVectorStorageEntriesFor(name: String, elements: List[AnyRef])
|
2009-09-10 01:33:01 +02:00
|
|
|
def updateVectorStorageEntryFor(name: String, index: Int, elem: AnyRef)
|
2009-08-12 17:01:11 +05:30
|
|
|
def getVectorStorageEntryFor(name: String, index: Int): AnyRef
|
2009-09-10 01:33:01 +02:00
|
|
|
def getVectorStorageRangeFor(name: String, start: Option[Int], finish: Option[Int], count: Int): RandomAccessSeq[AnyRef]
|
2009-08-12 17:01:11 +05:30
|
|
|
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]
|
|
|
|
|
}
|