Permalink
Browse files

Use simple incrementing request ids instead of UUIDs.

  • Loading branch information...
1 parent cc99799 commit ed4913c367a14bb89e6f058098f91a636b2bcf80 @stephenh committed Apr 25, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/main/scala/fakesdb/actions/Action.scala
View
12 src/main/scala/fakesdb/actions/Action.scala
@@ -1,23 +1,27 @@
package fakesdb.actions
import scala.xml.NodeSeq
-import java.util.UUID
import fakesdb._
abstract class Action(data: Data) {
def handle(params: Params): NodeSeq
protected def responseMetaData() = {
- <ResponseMetadata><RequestId>{requiestId}</RequestId><BoxUsage>0</BoxUsage></ResponseMetadata>
+ <ResponseMetadata><RequestId>{requestId}</RequestId><BoxUsage>0</BoxUsage></ResponseMetadata>
}
protected def parseDomain(params: Params): Domain = {
val domainName = params.getOrElse("DomainName", error("No domain name"))
return data.getDomain(domainName).getOrElse(error("Invalid domain name "+domainName))
}
- protected def namespace = "http://sdb.amazonaws.com/doc/2009-04-15/"
- val requiestId = UUID.randomUUID()
+ val namespace = "http://sdb.amazonaws.com/doc/2009-04-15/"
+ val requestId = Action.requestCounter.incrementAndGet()
+
+}
+
+object Action {
+ private val requestCounter = new java.util.concurrent.atomic.AtomicInteger()
}

0 comments on commit ed4913c

Please sign in to comment.