예제 #1
0
OccupantSeq BackupManagerI::get(const RoomIdPtr& rid, const Ice::Current&) {
	MCE_DEBUG("call BackupManagerI::get");
	if (rid) {
		Ice::Long hashcode = StrUtil::hashcode(roomIdToString(rid));
		RoomInfoPtr ri = ServiceI::instance().locateObject<RoomInfoPtr>(ROOM_INFO, hashcode);
		if (ri) {
			MCE_DEBUG("BackupManagerI::get   --> return size:"<< ri->get(rid).size());
			return ri->get(rid);
		}
	}
	return OccupantSeq();

}
예제 #2
0
void BackupManagerI::put(const OccupantPtr& o, const Ice::Current&) {
	MCE_DEBUG("BackupManagerI::put");
	if (o && o->rJid && o->rJid->rid) {
		MCE_DEBUG("BackupManagerI::put --> rjid:"<< roomJidToString(o->rJid));
		Ice::Long hashcode = StrUtil::hashcode(roomIdToString(o->rJid->rid));
		RoomInfoPtr ri = ServiceI::instance().locateObject<RoomInfoPtr>(ROOM_INFO, hashcode);
		MCE_DEBUG("BackupManagerI::put --> hashcode:"<< hashcode << " ri.size:"<<ri->get(o->rJid->rid).size());
		if (ri) {
			ri->put(o);
		}
		_addUpdateSqlObj(o);
	}
}