public class LocalConnector extends AbstractConnector
HttpTester.Request request = HttpTester.newRequest(); request.setURI("/some/resource"); HttpTester.Response response = HttpTester.parseResponse(HttpTester.from(localConnector.getResponse(request.generate())));
Modifier and Type | Class and Description |
---|---|
class |
LocalConnector.LocalEndPoint
Local EndPoint
|
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
Graceful.Shutdown
LOG
Constructor and Description |
---|
LocalConnector(Server server) |
LocalConnector(Server server,
ConnectionFactory connectionFactory) |
LocalConnector(Server server,
ConnectionFactory connectionFactory,
SslContextFactory sslContextFactory) |
LocalConnector(Server server,
java.util.concurrent.Executor executor,
Scheduler scheduler,
ByteBufferPool pool,
int acceptors,
ConnectionFactory... factories) |
LocalConnector(Server server,
SslContextFactory sslContextFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
accept(int acceptorID) |
LocalConnector.LocalEndPoint |
connect() |
LocalConnector.LocalEndPoint |
executeRequest(java.lang.String rawRequest)
Execute a request and return the EndPoint through which
multiple responses can be received or more input provided.
|
java.nio.ByteBuffer |
getResponse(java.nio.ByteBuffer requestsBuffer)
Get a single response using a parser to search for the end of the message.
|
java.nio.ByteBuffer |
getResponse(java.nio.ByteBuffer requestBuffer,
boolean head,
long time,
java.util.concurrent.TimeUnit unit)
Get a single response using a parser to search for the end of the message.
|
java.nio.ByteBuffer |
getResponse(java.nio.ByteBuffer requestBuffer,
long time,
java.util.concurrent.TimeUnit unit)
Get a single response using a parser to search for the end of the message.
|
java.lang.String |
getResponse(java.lang.String rawRequest)
Get a single response using a parser to search for the end of the message.
|
java.lang.String |
getResponse(java.lang.String rawRequest,
boolean head,
long time,
java.util.concurrent.TimeUnit unit)
Get a single response using a parser to search for the end of the message.
|
java.lang.String |
getResponse(java.lang.String rawRequest,
long time,
java.util.concurrent.TimeUnit unit)
Get a single response using a parser to search for the end of the message.
|
java.nio.ByteBuffer |
getResponses(java.nio.ByteBuffer requestsBuffer)
Deprecated.
|
java.nio.ByteBuffer |
getResponses(java.nio.ByteBuffer requestsBuffer,
long idleFor,
java.util.concurrent.TimeUnit units)
Deprecated.
|
java.lang.String |
getResponses(java.lang.String requests)
Deprecated.
|
java.lang.String |
getResponses(java.lang.String requests,
long idleFor,
java.util.concurrent.TimeUnit units)
Deprecated.
|
java.lang.Object |
getTransport() |
addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, doStart, doStop, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, handleAcceptFailure, interruptAcceptors, isAccepting, isShutdown, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setName, shutdown, toString
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stop
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanage
dump, dump, dump, dumpObject, dumpObjects, dumpSelf
public LocalConnector(Server server, java.util.concurrent.Executor executor, Scheduler scheduler, ByteBufferPool pool, int acceptors, ConnectionFactory... factories)
public LocalConnector(Server server)
public LocalConnector(Server server, SslContextFactory sslContextFactory)
public LocalConnector(Server server, ConnectionFactory connectionFactory)
public LocalConnector(Server server, ConnectionFactory connectionFactory, SslContextFactory sslContextFactory)
public java.lang.Object getTransport()
@Deprecated public java.lang.String getResponses(java.lang.String requests) throws java.lang.Exception
getResponse(String)
This methods waits until the connection is closed or is idle for 5s before returning the responses.
Use getResponse(String)
for an alternative that does not wait for idle.
requests
- the requestsjava.lang.Exception
- if the requests fail@Deprecated public java.lang.String getResponses(java.lang.String requests, long idleFor, java.util.concurrent.TimeUnit units) throws java.lang.Exception
getResponse(String, boolean, long, TimeUnit)
This methods waits until the connection is closed or an idle period before returning the responses.
Use getResponse(String)
for an alternative that does not wait for idle.
requests
- the requestsidleFor
- The time the response stream must be idle for before returningunits
- The units of idleForjava.lang.Exception
- if the requests fail@Deprecated public java.nio.ByteBuffer getResponses(java.nio.ByteBuffer requestsBuffer) throws java.lang.Exception
getResponse(ByteBuffer)
This methods waits until the connection is closed or is idle for 5s before returning the responses.
Use getResponse(ByteBuffer)
for an alternative that does not wait for idle.
requestsBuffer
- the requestsjava.lang.Exception
- if the requests fail@Deprecated public java.nio.ByteBuffer getResponses(java.nio.ByteBuffer requestsBuffer, long idleFor, java.util.concurrent.TimeUnit units) throws java.lang.Exception
getResponse(ByteBuffer, boolean, long, TimeUnit)
This methods waits until the connection is closed or an idle period before returning the responses.
requestsBuffer
- the requestsidleFor
- The time the response stream must be idle for before returningunits
- The units of idleForjava.lang.Exception
- if the requests failpublic LocalConnector.LocalEndPoint executeRequest(java.lang.String rawRequest)
rawRequest
- the requestpublic LocalConnector.LocalEndPoint connect()
protected void accept(int acceptorID) throws java.io.IOException, java.lang.InterruptedException
accept
in class AbstractConnector
java.io.IOException
java.lang.InterruptedException
public java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestsBuffer) throws java.lang.Exception
requestsBuffer
- The request to sendjava.lang.Exception
- If there is a problempublic java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestBuffer, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
requestBuffer
- The request to sendtime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problempublic java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestBuffer, boolean head, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
requestBuffer
- The request to sendhead
- True if the response is for a head requesttime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problempublic java.lang.String getResponse(java.lang.String rawRequest) throws java.lang.Exception
rawRequest
- The request to sendjava.lang.Exception
- If there is a problempublic java.lang.String getResponse(java.lang.String rawRequest, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
rawRequest
- The request to sendtime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problempublic java.lang.String getResponse(java.lang.String rawRequest, boolean head, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
rawRequest
- The request to sendhead
- True if the response is for a head requesttime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problemCopyright © 1995–2023 Webtide. All rights reserved.