Package org.hcjf.io.net.http.proxy
Class HttpProxy
- java.lang.Object
-
- org.hcjf.io.net.NetServiceConsumer<S,D>
-
- org.hcjf.io.net.NetServer<HttpSession,HttpPackage>
-
- org.hcjf.io.net.http.HttpServer
-
- org.hcjf.io.net.http.proxy.HttpProxy
-
- All Implemented Interfaces:
ServiceConsumer
public class HttpProxy extends HttpServer
Http proxy implementation- Author:
- javaito
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hcjf.io.net.http.HttpServer
HttpServer.AccessControl, HttpServer.ContextMatcher
-
Nested classes/interfaces inherited from class org.hcjf.io.net.NetServiceConsumer
NetServiceConsumer.DecoupledAction
-
-
Method Summary
Modifier and Type Method Description voidaddContext(Context context)This kind of http server not support custom context because there are only one context to take the incoming request and redirect the traffic using the storage rules.voidaddRule(HttpProxyRule rule)Adds a rule to redirect incoming requests.protected HttpServer.ContextMatcherfindContext(java.lang.String contextName)All the times return the same internal context.-
Methods inherited from class org.hcjf.io.net.http.HttpServer
addAccessControl, checkSession, create, createSession, decode, destroySession, encode, getSessionManager, isCreationTimeoutAvailable, onCheckSessionError, onContextNotFound, onDisconnect, onNotCheckedSession, onRead, onStart, onStop, onUnresponsiveContext, onWrite, setSessionManager
-
Methods inherited from class org.hcjf.io.net.NetServer
isDisconnectAndRemove, isMultiSession, start, stop
-
Methods inherited from class org.hcjf.io.net.NetServiceConsumer
addDecoupledAction, decoupleIoAction, disconnect, getName, getPort, getProtocol, getService, getShutdownFrame, getShutdownPackage, getSocketOptions, getSSLEngine, getWriteWaitForTimeout, isDecoupledIoAction, onConnect, onConnect, onDisconnect, onRead, onWrite, setService, setWriteWaitForTimeout, write, write
-
-
-
-
Method Detail
-
addRule
public final void addRule(HttpProxyRule rule)
Adds a rule to redirect incoming requests.- Parameters:
rule- Http proxy rule.- Throws:
java.lang.NullPointerException- if the rule parameter is null.
-
addContext
public final void addContext(Context context)
This kind of http server not support custom context because there are only one context to take the incoming request and redirect the traffic using the storage rules.- Overrides:
addContextin classHttpServer- Parameters:
context- Http context.- Throws:
java.lang.UnsupportedOperationException- all calls
-
findContext
protected final HttpServer.ContextMatcher findContext(java.lang.String contextName)
All the times return the same internal context.- Overrides:
findContextin classHttpServer- Parameters:
contextName- This parameter is ignored.- Returns:
- Always returns the unique internal context
-
-