Skip to content

Commit

Permalink
Re apply only relevant changes form commit ae1f6ef
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas NESMON (@NicoNes) <[email protected]>
  • Loading branch information
NicoNes committed Aug 30, 2023
1 parent 4d57393 commit e4c1371
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@
* (e. g. 443, 8443, or someting completely different). The actual configuration needs to be queried after
* bootstrapping, otherwise callers would be unaware of the actual chosen port. If the client's certificate is invalid
* or cannot be validated, the server will reject the connection.
* </p>
* <p>
* This example uses some basic <em>external</em> JSSE configuration:
* </p>
* <p>
* <ul>
* <li>{@code javax.net.ssl.keyStore=~/.keystore} - HTTPS: Path to a keystore holding an X.509 certificate for
* {@code CN=localhost}</li>
* <li>{@code javax.net.ssl.keyStorePassword=...} - HTTPS: Password of that keystore</li>
* <li>Client Authentication: The default truststore ({@code $JAVA_HOME/lib/security/cacerts}) must hold the root
* certificate of the CA and all intermediate certificates used for signing the client's certificate.</li>
* </ul>
* </p>
*
* @author Markus KARG ([email protected])
* @since 3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@
* {@code https://localhost/} on an implementation-specific default IP port (e. g. 443, 8443, or someting completely
* different). The actual configuration needs to be queried after bootstrapping, otherwise callers would be unaware of
* the actual chosen port.
* </p>
* <p>
* This example uses some basic <em>external</em> JSSE configuration:
* </p>
* <p>
* <ul>
* <li>{@code javax.net.ssl.keyStore=~/.keystore} - HTTPS: Path to a keystore holding an X.509 certificate for
* {@code CN=localhost}</li>
* <li>{@code javax.net.ssl.keyStorePassword=...} - HTTPS: Password of that keystore</li>
* </ul>
* </p>
*
* @author Markus KARG ([email protected])
* @since 3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.ServiceUnavailableException;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.sse.OutboundSseEvent;
Expand Down Expand Up @@ -136,7 +135,7 @@ public String processCommand(String command) {
@Produces(MediaType.SERVER_SENT_EVENTS)
public void itemEvents(
@HeaderParam(HttpHeaders.LAST_EVENT_ID_HEADER) @DefaultValue("-1") int lastEventId,
@Context SseEventSink serverSink) {
SseEventSink serverSink) {

if (lastEventId >= 0) {
LOGGER.info("Received last event id :" + lastEventId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.sse.Sse;
import jakarta.ws.rs.sse.SseEventSink;
Expand All @@ -48,7 +47,7 @@ public ServerSentEventsResource(Sse sse) {

@GET
@Produces(MediaType.SERVER_SENT_EVENTS)
public void getMessageQueue(@Context SseEventSink sseEventSink) {
public void getMessageQueue(SseEventSink sseEventSink) {
synchronized (outputLock) {
if (this.eventSink != null) {
throw new IllegalStateException("Server sink already served.");
Expand Down Expand Up @@ -78,8 +77,7 @@ public void close() throws IOException {
@POST
@Path("domains/{id}")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void startDomain(@PathParam("id") final String id,
@Context SseEventSink sseEventSink) {
public void startDomain(@PathParam("id") final String id, SseEventSink sseEventSink) {

executorService.submit(() -> {
try {
Expand Down
4 changes: 3 additions & 1 deletion jaxrs-api/src/main/java/jakarta/ws/rs/core/HttpHeaders.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
import java.util.Map;
import java.util.function.Predicate;

import jakarta.ws.rs.client.Entity;

/**
* An injectable interface that provides access to HTTP header information. All methods throw
* {@link java.lang.IllegalStateException} if called outside the scope of a request (e.g. from a provider constructor).
*
* @author Paul Sandoz
* @author Marc Hadley
* @see Context
* @see Entity
* @since 1.0
*/
public interface HttpHeaders {
Expand Down

0 comments on commit e4c1371

Please sign in to comment.