@Path(value="testServices") public class TestServerWebServices extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOCAL_SPAN_TAG_KEY
The key of a simulated span tag.
|
static String |
LOCAL_SPAN_TAG_VALUE
The value of a simulated span tag.
|
static String |
PARAM_ASYNC
Query parameter whether to use async requests.
|
static String |
PARAM_FAIL_NEST
Query parameter whether to fail the nested call.
|
static String |
PARAM_NEST_BREADTH
Query parameter for the breadth of nesting.
|
static String |
PARAM_NEST_DEPTH
Query parameter for the number of nested calls.
|
static String |
PARAM_UNIQUE_ID
Query parameter that's a unique ID propagated down nested calls.
|
static String |
REST_ANNOTATION_EXCEPTION
Web service endpoint to test a Traced annotation with an exception.
|
static String |
REST_ANNOTATIONS
Web service endpoint to test Traced annotations.
|
static String |
REST_ASYNC_LOCAL_SPAN
Async web service endpoint that creates local span.
|
static String |
REST_ERROR
Web service endpoint that will return HTTP 500.
|
static String |
REST_EXCEPTION
Web service that throws an unhandled exception and return HTTP 500.
|
static String |
REST_LOCAL_SPAN
Web service endpoint that creates local span.
|
static String |
REST_NESTED
Web service endpoint that will call itself some number of times.
|
static String |
REST_NOT_TRACED
Web service endpoint that's not traced.
|
static String |
REST_OPERATION_NAME
Web service endpoint with an explicit operation name.
|
static String |
REST_SIMPLE_TEST
Web service endpoint for the simpleTest call.
|
static String |
REST_SKIP_SIMPLE
Web service endpoint which should not be traced
|
static String |
REST_TEST_SERVICE_PATH
The path to this set of web services.
|
Constructor and Description |
---|
TestServerWebServices() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
annotationException()
Web service endpoint to test a Traced annotation with an exception.
|
javax.ws.rs.core.Response |
annotations()
Web service endpoint to test Traced annotations.
|
void |
asyncLocalSpan(javax.ws.rs.container.AsyncResponse asyncResponse)
Async endpoint which creates local span.
|
javax.ws.rs.core.Response |
error()
Returns HTTP 500 error.
|
javax.ws.rs.core.Response |
exception()
Returns HTTP 500 error.
|
String |
getRequestPath(String servicePath,
String endpointPath,
Map<String,Object> requestParameters)
Create the full URL for the web service request.
|
javax.ws.rs.core.Response |
localSpan()
Endpoint which creates local span.
|
javax.ws.rs.core.Response |
nested(int nestDepth,
int nestBreadth,
String uniqueID,
boolean failNest,
boolean async)
Web service call that calls itself
nestDepth - 1 times. |
javax.ws.rs.core.Response |
notTraced()
Shouldn't create a span.
|
javax.ws.rs.core.Response |
operationName()
Traced with an explicit operation name.
|
javax.ws.rs.core.Response |
simpleTest()
Simple JAXRS endpoint.
|
javax.ws.rs.core.Response |
skipSimple()
Endpoint which creates local span.
|
public static final String REST_TEST_SERVICE_PATH
public static final String REST_SIMPLE_TEST
public static final String REST_LOCAL_SPAN
public static final String REST_SKIP_SIMPLE
public static final String REST_ASYNC_LOCAL_SPAN
public static final String REST_ERROR
public static final String REST_EXCEPTION
public static final String REST_ANNOTATIONS
public static final String REST_ANNOTATION_EXCEPTION
public static final String PARAM_UNIQUE_ID
public static final String PARAM_FAIL_NEST
public static final String PARAM_ASYNC
public static final String REST_NESTED
public static final String PARAM_NEST_DEPTH
public static final String PARAM_NEST_BREADTH
public static final String LOCAL_SPAN_TAG_KEY
public static final String LOCAL_SPAN_TAG_VALUE
public static final String REST_NOT_TRACED
public static final String REST_OPERATION_NAME
@GET @Path(value="simpleTest") @Produces(value="text/plain") public javax.ws.rs.core.Response simpleTest()
@GET @Path(value="localSpan") @Produces(value="text/plain") public javax.ws.rs.core.Response localSpan()
@GET @Path(value="asyncLocalSpan") @Produces(value="text/plain") public void asyncLocalSpan(@Suspended javax.ws.rs.container.AsyncResponse asyncResponse)
asyncResponse
- holds state of the asynchronous processing@GET @Path(value="error") @Produces(value="text/plain") public javax.ws.rs.core.Response error()
@GET @Path(value="exception") @Produces(value="text/plain") public javax.ws.rs.core.Response exception()
@GET @Path(value="annotations") @Produces(value="text/plain") public javax.ws.rs.core.Response annotations()
@GET @Path(value="annotationException") @Produces(value="text/plain") public javax.ws.rs.core.Response annotationException()
@Traced(value=false) @GET @Path(value="notTraced") @Produces(value="text/plain") public javax.ws.rs.core.Response notTraced()
@Traced(operationName="operationName") @GET @Path(value="operationName") @Produces(value="text/plain") public javax.ws.rs.core.Response operationName()
@GET @Path(value="nested") @Produces(value="text/plain") public javax.ws.rs.core.Response nested(@QueryParam(value="nestDepth") int nestDepth, @QueryParam(value="nestBreadth") int nestBreadth, @QueryParam(value="data") String uniqueID, @QueryParam(value="failNest") boolean failNest, @QueryParam(value="async") boolean async) throws InterruptedException, ExecutionException
nestDepth
- 1 times.
A nesting depth of zero (0) causes an immediate return.
A nesting depth greater than zero causes a call to the nesting service
with the depth reduced by one (1).
The nestBreadth
controls how many concurrent, nested calls are
made on the first level of nesting.nestDepth
- The depth of nesting to use when implementing the request.nestBreadth
- The breadth of nested calls.uniqueID
- Unique ID propagated down nested calls.failNest
- True if nested response should be an errorasync
- Whether the nested request is executed asynchronously.ExecutionException
- Error executing nested web service.InterruptedException
- Error executing nested web service.@GET @Path(value="skipSimple") @Produces(value="text/plain") public javax.ws.rs.core.Response skipSimple()
public String getRequestPath(String servicePath, String endpointPath, Map<String,Object> requestParameters)
servicePath
- Service path component.endpointPath
- The final component of the path.requestParameters
- Query parameters.Copyright © 2020 Eclipse Foundation. All rights reserved.