- def jsonStringToDBObject(json: String): DBObject = {
- JSON.parse(json) match {
- case dbObject: DBObject ⇒
- dbObject
- case _ ⇒
- throw new StoreException("Could not transform %s -> %s".format(json.getClass, classOf[DBObject].getName))
- }
+ def jsonStringToDBObject(jsonString: String): DBObject = {
+ StdConverters.StdConverters.convertEx[DBObject](jsonString)
+ }
+
+ final def isLocalIMEvent(event: IMEventModel) = event match {
+ case _: MongoDBIMEvent ⇒ true
+ case _ ⇒ false
+ }
+
+ final def createIMEventFromJson(json: String) = {
+ MongoDBIMEvent.fromJson(json)
+ }
+
+ final def createIMEventFromOther(event: IMEventModel) = {
+ MongoDBIMEvent.fromOther(event)
+ }
+
+ final def createIMEventFromJsonBytes(jsonBytes: Array[Byte]) = {
+ MongoDBIMEvent.fromJsonBytes(jsonBytes)