}
}
- private[this] lazy val _userEventStoreM: Maybe[IMEventStore] = {
+ private[this] lazy val _imEventStoreM: Maybe[IMEventStore] = {
props.get(Keys.user_event_store_class) map { className ⇒
val instance = newInstance[IMEventStore](className)
logger.info("Overriding IMEventStore provisioning. Implementation given by: %s".format(instance.getClass))
}
}
- def userEventStore = {
- _userEventStoreM match {
+ def imEventStore = {
+ _imEventStoreM match {
case Just(es) ⇒ es
- case _ ⇒ storeProvider.userEventStore
+ case _ ⇒ storeProvider.imEventStore
}
}
createBlankState
//Rebuild state from user events
- val usersDB = _configurator.storeProvider.userEventStore
+ val usersDB = _configurator.storeProvider.imEventStore
val userEvents = usersDB.findIMEventsByUserId(_userId)
val numUserEvents = userEvents.size
_userState = replayIMEvents(_userState, userEvents, from, to)
}
override def exists(event: IMEvent) =
- _configurator.userEventStore.findIMEventById(event.id).isJust
+ _configurator.imEventStore.findIMEventById(event.id).isJust
override def persist(event: IMEvent, initialPayload: Array[Byte]) = {
Maybe {
LocalFSEventStore.storeIMEvent(_configurator, event, initialPayload)
} match {
case Just(_) ⇒
- _configurator.userEventStore.storeIMEvent(event) match {
+ _configurator.imEventStore.storeIMEvent(event) match {
case Just(x) => true
case x: Failed =>
logger.error("Could not save user event: %s".format(event))
_configurator.props.getBoolean(Configurator.Keys.save_unparsed_event_im) match {
case Just(true) ⇒
- val recordIDM = _configurator.userEventStore.storeUnparsed(json)
+ val recordIDM = _configurator.imEventStore.storeUnparsed(json)
logger.info("Saved unparsed {}", recordIDM)
case _ ⇒
}
def userStateStore: UserStateStore
def resourceEventStore: ResourceEventStore
def walletEntryStore: WalletEntryStore
- def userEventStore: IMEventStore
+ def imEventStore: IMEventStore
def policyStore: PolicyStore
}
\ No newline at end of file
def walletEntryStore = this
- def userEventStore = this
+ def imEventStore = this
def policyStore = this
//- StoreProvider
def userStateStore = new MongoDBStore(this._mongo, this._database, this._username, this._password)
def resourceEventStore = new MongoDBStore(this._mongo, this._database, this._username, this._password)
def walletEntryStore = new MongoDBStore(this._mongo, this._database, this._username, this._password)
- def userEventStore = new MongoDBStore(this._mongo, this._database, this._username, this._password)
+ def imEventStore = new MongoDBStore(this._mongo, this._database, this._username, this._password)
def policyStore = new MongoDBStore(this._mongo, this._database, this._username, this._password)
}
\ No newline at end of file