com.webpieces.http2engine.impl.client.Level2ClientParsing Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http2-engine Show documentation
Show all versions of http2-engine Show documentation
A re-usable asynchronous HTTP/2 parser
package com.webpieces.http2engine.impl.client;
import org.webpieces.util.futures.XFuture;
import com.webpieces.hpack.api.HpackParser;
import com.webpieces.http2.api.dto.highlevel.Http2Push;
import com.webpieces.http2.api.dto.highlevel.Http2Response;
import com.webpieces.http2.api.dto.lowlevel.lib.Http2Msg;
import com.webpieces.http2engine.api.client.Http2Config;
import com.webpieces.http2engine.impl.shared.Level2ParsingAndRemoteSettings;
import com.webpieces.http2engine.impl.shared.Level7MarshalAndPing;
public class Level2ClientParsing extends Level2ParsingAndRemoteSettings {
private Level3ClntIncomingSynchro clientSyncro;
public Level2ClientParsing(
String key,
Level3ClntIncomingSynchro syncro,
Level3ClntOutgoingSyncro outSyncro,
Level7MarshalAndPing notifyListener,
HpackParser lowLevelParser,
Http2Config config
) {
super(key, syncro, outSyncro, notifyListener, lowLevelParser, config);
clientSyncro = syncro;
}
@Override
protected XFuture processSpecific(Http2Msg msg) {
if(msg instanceof Http2Response) {
return clientSyncro.sendResponseToApp((Http2Response) msg);
} else if(msg instanceof Http2Push) {
return clientSyncro.sendPushToApp((Http2Push) msg);
} else
throw new IllegalArgumentException("Unknown HttpMsg type. msg="+msg+" type="+msg.getClass());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy