com.alipay.api.msg.MsgConnector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alipay-sdk-java Show documentation
Show all versions of alipay-sdk-java Show documentation
Alipay openapi SDK for Java
Copyright © 2018 杭州蚂蚁金服
All rights reserved.
版权所有 (C)杭州蚂蚁金服
http://open.alipay.com
/**
* Alipay.com Inc. Copyright (c) 2004-2018 All Rights Reserved.
*/
package com.alipay.api.msg;
import com.alipay.api.internal.util.AlipayLogger;
import com.alipay.api.java_websocket.client.WebSocketClient;
import com.alipay.api.java_websocket.handshake.ServerHandshake;
import java.net.URI;
import java.util.Map;
/**
* @author liuqun.lq
* @version $Id: WebSocketConnector.java, v 0.1 2018年08月31日 17:28 liuqun.lq Exp $
*/
public class MsgConnector extends WebSocketClient {
private AlipayMsgClient alipayMsgClient;
public MsgConnector(URI serverUri, Map httpHeaders,
AlipayMsgClient alipayMsgClient, String charset) {
super(serverUri, httpHeaders, charset);
this.alipayMsgClient = alipayMsgClient;
}
public void onOpen(ServerHandshake handshakedata) {
AlipayLogger.logBizDebug("conn open");
}
public void onMessage(String message) {
alipayMsgClient.onMessage(message);
}
public void onClose(int code, String reason, boolean remote) {
AlipayLogger.logBizDebug("conn close");
}
public void onError(Exception ex) {
AlipayLogger.logBizError(ex);
}
}