Class NettyHttpServer
- java.lang.Object
-
- de.dytanic.cloudnet.driver.network.netty.NettySSLServer
-
- de.dytanic.cloudnet.driver.network.netty.http.NettyHttpServer
-
- All Implemented Interfaces:
IHttpComponent<IHttpServer>,IHttpServer,java.lang.AutoCloseable
@Internal public final class NettyHttpServer extends NettySSLServer implements IHttpServer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNettyHttpServer.HttpHandlerEntry
-
Field Summary
Fields Modifier and Type Field Description protected io.netty.channel.EventLoopGroupbossGroupprotected java.util.Map<java.lang.Integer,de.dytanic.cloudnet.common.collection.Pair<HostAndPort,io.netty.channel.ChannelFuture>>channelFuturesprotected java.util.List<NettyHttpServer.HttpHandlerEntry>registeredHandlersprotected io.netty.channel.EventLoopGroupworkerGroup-
Fields inherited from class de.dytanic.cloudnet.driver.network.netty.NettySSLServer
sslConfiguration, sslContext
-
-
Constructor Summary
Constructors Constructor Description NettyHttpServer()NettyHttpServer(SSLConfiguration sslConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddListener(int port)booleanaddListener(HostAndPort hostAndPort)IHttpServerclearHandlers()voidclose()java.util.Collection<IHttpHandler>getHttpHandlers()booleanisSslEnabled()IHttpServerregisterHandler(java.lang.String path, int priority, IHttpHandler... handlers)IHttpServerregisterHandler(java.lang.String path, IHttpHandler... handlers)IHttpServerregisterHandler(java.lang.String path, java.lang.Integer port, int priority, IHttpHandler... handlers)IHttpServerremoveHandler(IHttpHandler handler)IHttpServerremoveHandler(java.lang.Class<? extends IHttpHandler> handler)IHttpServerremoveHandler(java.lang.ClassLoader classLoader)-
Methods inherited from class de.dytanic.cloudnet.driver.network.netty.NettySSLServer
init
-
-
-
-
Field Detail
-
registeredHandlers
protected final java.util.List<NettyHttpServer.HttpHandlerEntry> registeredHandlers
-
channelFutures
protected final java.util.Map<java.lang.Integer,de.dytanic.cloudnet.common.collection.Pair<HostAndPort,io.netty.channel.ChannelFuture>> channelFutures
-
bossGroup
protected final io.netty.channel.EventLoopGroup bossGroup
-
workerGroup
protected final io.netty.channel.EventLoopGroup workerGroup
-
-
Constructor Detail
-
NettyHttpServer
public NettyHttpServer() throws java.lang.Exception- Throws:
java.lang.Exception
-
NettyHttpServer
public NettyHttpServer(SSLConfiguration sslConfiguration) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
isSslEnabled
public boolean isSslEnabled()
- Specified by:
isSslEnabledin interfaceIHttpComponent<IHttpServer>
-
addListener
public boolean addListener(int port)
- Specified by:
addListenerin interfaceIHttpServer
-
addListener
public boolean addListener(HostAndPort hostAndPort)
- Specified by:
addListenerin interfaceIHttpServer
-
registerHandler
public IHttpServer registerHandler(java.lang.String path, IHttpHandler... handlers)
- Specified by:
registerHandlerin interfaceIHttpComponent<IHttpServer>
-
registerHandler
public IHttpServer registerHandler(java.lang.String path, int priority, IHttpHandler... handlers)
- Specified by:
registerHandlerin interfaceIHttpComponent<IHttpServer>
-
registerHandler
public IHttpServer registerHandler(java.lang.String path, java.lang.Integer port, int priority, IHttpHandler... handlers)
- Specified by:
registerHandlerin interfaceIHttpComponent<IHttpServer>
-
removeHandler
public IHttpServer removeHandler(IHttpHandler handler)
- Specified by:
removeHandlerin interfaceIHttpComponent<IHttpServer>
-
removeHandler
public IHttpServer removeHandler(java.lang.Class<? extends IHttpHandler> handler)
- Specified by:
removeHandlerin interfaceIHttpComponent<IHttpServer>
-
removeHandler
public IHttpServer removeHandler(java.lang.ClassLoader classLoader)
- Specified by:
removeHandlerin interfaceIHttpComponent<IHttpServer>
-
getHttpHandlers
public java.util.Collection<IHttpHandler> getHttpHandlers()
- Specified by:
getHttpHandlersin interfaceIHttpComponent<IHttpServer>
-
clearHandlers
public IHttpServer clearHandlers()
- Specified by:
clearHandlersin interfaceIHttpComponent<IHttpServer>
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-