Created
June 4, 2020 16:10
-
-
Save xstefank/e334dc2f4f398df2a0f8ac11ce6477e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.narayana.lra.arquillian.resource; | |
import org.eclipse.microprofile.lra.annotation.ws.rs.LRA; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.HeaderParam; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.core.Response; | |
import java.net.URI; | |
public class LRAParticipant { | |
@LRA(LRA.Type.MANDATORY) | |
@GET | |
@Path("/lra1") | |
public Response lra1(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId, | |
@HeaderParam(LRA.LRA_HTTP_PARENT_CONTEXT_HEADER) URI parentId) { | |
if (parentId != null) { | |
return Response.status(412).entity("nested LRA not supported").build(); | |
} | |
... | |
} | |
@LRA(LRA.Type.MANDATORY) | |
@GET | |
@Path("/lra2") | |
public Response lra2(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId, | |
@HeaderParam(LRA.LRA_HTTP_PARENT_CONTEXT_HEADER) URI parentId) { | |
if (parentId != null) { | |
return Response.status(412).entity("nested LRA not supported").build(); | |
} | |
... | |
} | |
@LRA(LRA.Type.MANDATORY) | |
@GET | |
@Path("/lra3") | |
public Response lra3(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId, | |
@HeaderParam(LRA.LRA_HTTP_PARENT_CONTEXT_HEADER) URI parentId) { | |
if (parentId != null) { | |
return Response.status(412).entity("nested LRA not supported").build(); | |
} | |
... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.narayana.lra.arquillian.resource; | |
import org.eclipse.microprofile.lra.annotation.ws.rs.LRA; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.HeaderParam; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.core.Response; | |
import java.net.URI; | |
@LRA(supportNested=false) | |
public class LRAParticipant2 { | |
@LRA(LRA.Type.MANDATORY) | |
@GET | |
@Path("/lra1") | |
public Response lra1(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId) { | |
... | |
} | |
@LRA(LRA.Type.MANDATORY) | |
@GET | |
@Path("/lra2") | |
public Response lra2(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId) { | |
... | |
} | |
@LRA(LRA.Type.MANDATORY) | |
@GET | |
@Path("/lra3") | |
public Response lra3(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment