Search in sources :

Example 16 with ChannelResponse

use of org.fisco.bcos.channel.dto.ChannelResponse in project web3sdk by FISCO-BCOS.

the class PushCallback2 method onPush.

@Override
public void onPush(ChannelPush push) {
    DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    logger.debug("push:" + push.getContent());
    System.out.println(df.format(LocalDateTime.now()) + "server:push:" + push.getContent());
    ChannelResponse response = new ChannelResponse();
    response.setContent("receive request seq:" + String.valueOf(push.getMessageID()));
    response.setErrorCode(0);
    push.sendResponse(response);
}
Also used : ChannelResponse(org.fisco.bcos.channel.dto.ChannelResponse) DateTimeFormatter(java.time.format.DateTimeFormatter)

Aggregations

ChannelResponse (org.fisco.bcos.channel.dto.ChannelResponse)16 ChannelRequest (org.fisco.bcos.channel.dto.ChannelRequest)6 IOException (java.io.IOException)5 DateTimeFormatter (java.time.format.DateTimeFormatter)5 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 KeyStoreException (java.security.KeyStoreException)4 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)4 NoSuchProviderException (java.security.NoSuchProviderException)4 CertificateException (java.security.cert.CertificateException)4 InvalidKeySpecException (java.security.spec.InvalidKeySpecException)4 Service (org.fisco.bcos.channel.client.Service)4 TransactionException (org.fisco.bcos.web3j.protocol.exceptions.TransactionException)4 ApplicationContext (org.springframework.context.ApplicationContext)4 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)4 ByteBuf (io.netty.buffer.ByteBuf)2 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)2 SocketChannel (io.netty.channel.socket.SocketChannel)2 ChannelMessage2 (org.fisco.bcos.channel.dto.ChannelMessage2)2 EventLogPushCallback (org.fisco.bcos.channel.event.filter.EventLogPushCallback)2