package com.mercury.chat.client;

import java.util.List;
import java.util.Properties;

import com.mercury.chat.common.ConnectionListener;
import com.mercury.chat.common.MessageListener;
import com.mercury.chat.common.OrderSummary;
import com.mercury.chat.common.ProductSummary;
import com.mercury.chat.common.exception.ChatException;
import com.mercury.chat.common.struct.protocol.Message;
import com.mercury.chat.user.entity.ChatMessage;


public interface ChatClient {
	
	void login(String userName, String password, Properties properties) throws ChatException;
	
	void logout();
	
	boolean isConnected();
	
	void sendMessage(Message message) throws ChatException;
	
	void addMessageListener(MessageListener messageListener);
	
	void removeListener(MessageListener messageListener);
	
	void setConnectionListener(ConnectionListener connectionListener);
	
	List<ChatMessage> loadHisChatMessage(long shopId, String userId, int offset, int batchSize);
	
	ProductSummary loadProductSummary(long productId);
	
	OrderSummary loadOrderSummary(long orderId);
	
	Connection connect(String host, int port);

}

@@ -592,16 +592,28 @@
 ogout();
+//%E9%80%80%E5%87%BA%E7%99%BB%E5%BD%95%EF%BC%9F%E9%80%80%E5%87%BA%E7%B3%BB%E7%BB%9F%EF%BC%9F
 %0D%0A%09%0D%0A%09bo
@@ -892,16 +892,210 @@
 r);%0D%0A%09%0D%0A
+%09/**%0D%0A%09 * load historical chat message from db/redis/other storer%0D%0A%09 * @param shopId%0D%0A%09 * @param userId chat userId, not shop userId%0D%0A%09 * @param offset%0D%0A%09 * @param batchSize%0D%0A%09 * @return%0D%0A%09 */%0D%0A
 %09List%3CCh

add some comments