(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Provided by AmazingMongoFramework | |
case class MongoConfig(hostname: String, port: Int) | |
case class MongoConfigBuilder(hostname: Option[String] = Some("localhost"), port: Option[Int] = Some(27017)) { | |
def withHostname(hostname: String) = copy(hostname = Some(hostname)) | |
def withPort(port: Int) = copy(port = Some(port)) | |
def build() = { | |
// do some validation here.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait AggregateType { | |
val description: String | |
val classType: Class[_ <: Actor] | |
} | |
object DomainModel { | |
def apply(name: String)(aggregateTypes: AggregateType*) = { | |
new DomainModel(name, aggregateTypes) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.ListBuffer | |
import akka.actor.{Actor,ActorRef} | |
import akka.actor.Actor._ | |
import akka.routing.{ Listeners, Listen } | |
//Represents a domain event | |
trait Event | |
//A builder to create domain entities | |
trait EntityBuilder[Entity] { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Global extends WithFilters(AccessLogFilter) { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object AccessLogFilter extends EssentialFilter { | |
val dateTimeFormat = ISODateTimeFormat.ordinalDateTimeNoMillis() | |
def apply(next: EssentialAction) = new EssentialAction { | |
def apply(rh: RequestHeader) = { | |
val startTime = System.currentTimeMillis() | |
def logTime(result: PlainResult): Result = { | |
val event = Json.obj( |