using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace QM.Exchange.Adapters.MiddleDB
{
public class MiddleDBAdapter
{
///
/// 数据表名
///
private string _tableName { get; set; }
///
/// 主键字段名
///
private string PkColumnName = "ID_KEY";
///
/// 读取标志字段
///
private string ReadFlagColumn = "R_FLAG";
///
/// 过期时间(小时)
///
private int OverdueTime = 12;
public MiddleDBAdapter(string tableName)
{
_tableName = tableName;
}
///
/// 监控数据变化
///
public void Monitor()
{
//监控是否有未读数据
//向业务系统推送数据
}
///
/// 推送数据
///
public void PushData()
{
//获取未读数据
//生成消息ID
//向消息表写入数据+消息ID
//向消息队列发送消息ID
//标记已读
}
///
/// 获取未读数据
///
///
public DataTable GetData()
{
return null;
}
///
/// 向消息化数据表写入数据
///
///
public void WriteMqTable(DataTable table)
{
//将未读数据写入T_IO_MQDATA
}
///
/// 向消息队列发送消息ID
///
public void SendMq(string msgID)
{
string topicID = "";
//通过接口表与主题关联获取消息主题
//向消息队列发送消息ID
using (QMBDP.ActiveMQClient.MQProducer producer = new QMBDP.ActiveMQClient.MQProducer(topicID))
{
producer.SendTextMessage(msgID);
}
}
///
/// 将未读数据标记为已读
///
///
public void SignRead(DataTable table)
{
}
///
/// 删除过期的已读数据
///
public void DeleteHistory()
{
}
}
}