Package jenkins.util
Class FullDuplexHttpService
- java.lang.Object
-
- jenkins.util.FullDuplexHttpService
-
- Direct Known Subclasses:
FullDuplexHttpChannel
public abstract class FullDuplexHttpService extends Object
Server-side counterpart toFullDuplexHttpStream
.To use, bind this to an endpoint with
RootAction
(you will also need aCrumbExclusion
).- Since:
- 2.54
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FullDuplexHttpService.Response
HTTP response that allows a client to use this service.
-
Field Summary
Fields Modifier and Type Field Description static long
CONNECTION_TIMEOUT
Controls the time out of waiting for the 2nd HTTP request to arrive.static boolean
DIY_CHUNKING
Set to true if the servlet container doesn't support chunked encoding.protected UUID
uuid
-
Constructor Summary
Constructors Modifier Constructor Description protected
FullDuplexHttpService(UUID uuid)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
download(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
This is where we send the data to the client.protected abstract void
run(InputStream upload, OutputStream download)
void
upload(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
This is where we receive inputs from the client.
-
-
-
Field Detail
-
DIY_CHUNKING
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean DIY_CHUNKING
Set to true if the servlet container doesn't support chunked encoding.
-
CONNECTION_TIMEOUT
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static long CONNECTION_TIMEOUT
Controls the time out of waiting for the 2nd HTTP request to arrive.
-
uuid
protected final UUID uuid
-
-
Constructor Detail
-
FullDuplexHttpService
protected FullDuplexHttpService(UUID uuid)
-
-
Method Detail
-
download
public void download(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws InterruptedException, IOException
This is where we send the data to the client.If this connection is lost, we'll abort the channel.
- Throws:
InterruptedException
IOException
-
run
protected abstract void run(InputStream upload, OutputStream download) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
upload
public void upload(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws InterruptedException, IOException
This is where we receive inputs from the client.- Throws:
InterruptedException
IOException
-
-