All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alipay.api.msg.MsgConnector Maven / Gradle / Ivy

Go to download

Alipay openapi SDK for Java Copyright © 2018 杭州蚂蚁金服 All rights reserved. 版权所有 (C)杭州蚂蚁金服 http://open.alipay.com

There is a newer version: 4.39.218.ALL
Show newest version
/**
 * 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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy