Skip to content

Commit d251c33

Browse files
authored
Merge pull request #67 from caskdata/merge-release
Merge release
2 parents 668ed53 + 2df27eb commit d251c33

File tree

6 files changed

+32
-1
lines changed

6 files changed

+32
-1
lines changed

src/main/java/co/cask/http/BodyProducer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public abstract class BodyProducer {
3232
* won't be set and {@code Transfer-Encoding: chunked} will be used.
3333
* </p>
3434
* By default, {@code -1L} is returned.
35+
*
36+
* @return the size of the content in bytes
3537
*/
3638
public long getContentLength() {
3739
return -1L;
@@ -41,6 +43,7 @@ public long getContentLength() {
4143
* Returns a {@link ByteBuf} representing the next chunk of bytes to send. If the returned
4244
* {@link ByteBuf} is an empty buffer, it signals the end of the streaming.
4345
*
46+
* @return the next chunk of bytes to send
4447
* @throws Exception if there is any error
4548
*/
4649
public abstract ByteBuf nextChunk() throws Exception;

src/main/java/co/cask/http/HttpResponder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public interface HttpResponder {
9595
* using the {@link ChunkResponder} returned.
9696
*
9797
* @param status the status code to respond with
98+
* @return chunk responder for sending the response
9899
*/
99100
ChunkResponder sendChunkStart(HttpResponseStatus status);
100101

@@ -104,6 +105,7 @@ public interface HttpResponder {
104105
*
105106
* @param status the status code to respond with
106107
* @param headers additional headers to send with the response.
108+
* @return chunk responder for sending the response
107109
*/
108110
ChunkResponder sendChunkStart(HttpResponseStatus status, HttpHeaders headers);
109111

src/main/java/co/cask/http/NettyHttpService.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ private NettyHttpService(String serviceName,
144144
* Creates a {@link Builder} for creating new instance of {@link NettyHttpService}.
145145
*
146146
* @param serviceName name of the http service. The name will be used to name threads created for the service.
147+
* @return builder for creating a NettyHttpService
147148
*/
148149
public static Builder builder(String serviceName) {
149150
return new Builder(serviceName);
@@ -625,26 +626,44 @@ public Builder setHost(String host) {
625626
return this;
626627
}
627628

629+
/**
630+
* Set the HTTP chunk limit.
631+
*
632+
* @param value the chunk limit
633+
* @return instance of {@code Builder}.
634+
*/
628635
public Builder setHttpChunkLimit(int value) {
629636
this.httpChunkLimit = value;
630637
return this;
631638
}
632639

633640
/**
634641
* Enable SSL by using the provided SSL information.
642+
*
643+
* @param sslConfig the SSL configuration
644+
* @return instance of {@code Builder}.
635645
*/
636646
public Builder enableSSL(SSLConfig sslConfig) {
637647
return enableSSL(new SSLHandlerFactory(sslConfig));
638648
}
639649

640650
/**
641651
* Enable SSL by using the given {@link SSLHandlerFactory} to create {@link SslHandler}.
652+
*
653+
* @param sslHandlerFactory the factory for creating SslHandlers
654+
* @return instance of {@code Builder}.
642655
*/
643656
public Builder enableSSL(SSLHandlerFactory sslHandlerFactory) {
644657
this.sslHandlerFactory = sslHandlerFactory;
645658
return this;
646659
}
647660

661+
/**
662+
* Set the {@link ExceptionHandler} for the service.
663+
*
664+
* @param exceptionHandler the exception handler to use
665+
* @return instance of {@code Builder}.
666+
*/
648667
public Builder setExceptionHandler(ExceptionHandler exceptionHandler) {
649668
if (exceptionHandler == null) {
650669
throw new IllegalArgumentException("exceptionHandler cannot be null");

src/main/java/co/cask/http/SSLConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public String getTrustKeyStorePassword() {
7373
}
7474

7575
/**
76+
* Creates a builder for the SSLConfig.
77+
*
78+
* @param keyStore the keystore
79+
* @param keyStorePassword the password for the keystore
7680
* @return instance of {@code Builder}
7781
*/
7882
public static Builder builder(File keyStore, String keyStorePassword) {

src/main/java/co/cask/http/SSLHandlerFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ private static KeyStore getKeyStore(File keyStore, String keyStorePassword) thro
7878
}
7979

8080
/**
81+
* Creates an SslHandler
82+
*
83+
* @param bufferAllocator the buffer allocator
8184
* @return instance of {@code SslHandler}
8285
*/
8386
public SslHandler create(ByteBufAllocator bufferAllocator) {

src/main/java/co/cask/http/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* {@code NettyHttpService} sets up the necessary pipeline and manages starting, stopping,
2020
* state-management of the web service.
2121
*
22-
* <p/>
22+
* <p>
2323
* In-order to handle http requests, {@code HttpHandler} must be implemented. The methods
2424
* in the classes implemented from {@code HttpHandler} must be annotated with Jersey annotations to
2525
* specify http uri paths and http methods.

0 commit comments

Comments
 (0)