org.eclipse.microprofile.opentracing.tck.application

## Class TestServerWebServices

- java.lang.Object
- - org.eclipse.microprofile.opentracing.tck.application.TestServerWebServices

    @Path(value="testServices")
    public class TestServerWebServices
    extends Object

Test JAXRS web services.

### Field Summary

Fields
`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 Summary

Constructors
Constructor and Description
`TestServerWebServices()`

### Method Summary

All Methods Instance Methods Concrete Methods
`jakarta.ws.rs.core.Response` `annotationException()` Web service endpoint to test a Traced annotation with an exception.
`jakarta.ws.rs.core.Response` `annotations()` Web service endpoint to test Traced annotations.
`void` `asyncLocalSpan(jakarta.ws.rs.container.AsyncResponse asyncResponse)` Async endpoint which creates local span.
`jakarta.ws.rs.core.Response` `error()` Returns HTTP 500 error.
`jakarta.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.
`jakarta.ws.rs.core.Response` `localSpan()` Endpoint which creates local span.
`jakarta.ws.rs.core.Response` `nested(int nestDepth, int nestBreadth, String uniqueID, boolean failNest, boolean async)` Web service call that calls itself `nestDepth` - 1 times.
`jakarta.ws.rs.core.Response` `notTraced()` Shouldn't create a span.
`jakarta.ws.rs.core.Response` `operationName()` Traced with an explicit operation name.
`jakarta.ws.rs.core.Response` `simpleTest()` Simple JAXRS endpoint.
`jakarta.ws.rs.core.Response` `skipSimple()` Endpoint which creates local span.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### REST_TEST_SERVICE_PATH

    public static final String REST_TEST_SERVICE_PATH

The path to this set of web services.

See Also:
  Constant Field Values

#### REST_SIMPLE_TEST

    public static final String REST_SIMPLE_TEST

Web service endpoint for the simpleTest call.

See Also:
  Constant Field Values

#### REST_LOCAL_SPAN

    public static final String REST_LOCAL_SPAN

Web service endpoint that creates local span.

See Also:
  Constant Field Values

#### REST_SKIP_SIMPLE

    public static final String REST_SKIP_SIMPLE

Web service endpoint which should not be traced

See Also:
  Constant Field Values

#### REST_ASYNC_LOCAL_SPAN

    public static final String REST_ASYNC_LOCAL_SPAN

Async web service endpoint that creates local span.

See Also:
  Constant Field Values

#### REST_ERROR

    public static final String REST_ERROR

Web service endpoint that will return HTTP 500.

See Also:
  Constant Field Values

#### REST_EXCEPTION

    public static final String REST_EXCEPTION

Web service that throws an unhandled exception and return HTTP 500.

See Also:
  Constant Field Values

#### REST_ANNOTATIONS

    public static final String REST_ANNOTATIONS

Web service endpoint to test Traced annotations.

See Also:
  Constant Field Values

#### REST_ANNOTATION_EXCEPTION

    public static final String REST_ANNOTATION_EXCEPTION

Web service endpoint to test a Traced annotation with an exception.

See Also:
  Constant Field Values

#### PARAM_UNIQUE_ID

    public static final String PARAM_UNIQUE_ID

Query parameter that's a unique ID propagated down nested calls.

See Also:
  Constant Field Values

#### PARAM_FAIL_NEST

    public static final String PARAM_FAIL_NEST

Query parameter whether to fail the nested call.

See Also:
  Constant Field Values

#### PARAM_ASYNC

    public static final String PARAM_ASYNC

Query parameter whether to use async requests.

See Also:
  Constant Field Values

#### REST_NESTED

    public static final String REST_NESTED

Web service endpoint that will call itself some number of times.

See Also:
  Constant Field Values

#### PARAM_NEST_DEPTH

    public static final String PARAM_NEST_DEPTH

Query parameter for the number of nested calls.

See Also:
  Constant Field Values

#### PARAM_NEST_BREADTH

    public static final String PARAM_NEST_BREADTH

Query parameter for the breadth of nesting.

See Also:
  Constant Field Values

#### LOCAL_SPAN_TAG_KEY

    public static final String LOCAL_SPAN_TAG_KEY

The key of a simulated span tag.

See Also:
  Constant Field Values

#### LOCAL_SPAN_TAG_VALUE

    public static final String LOCAL_SPAN_TAG_VALUE

The value of a simulated span tag.

See Also:
  Constant Field Values

#### REST_NOT_TRACED

    public static final String REST_NOT_TRACED

Web service endpoint that's not traced.

See Also:
  Constant Field Values

#### REST_OPERATION_NAME

    public static final String REST_OPERATION_NAME

Web service endpoint with an explicit operation name.

See Also:
  Constant Field Values

### Constructor Detail

#### TestServerWebServices

    public TestServerWebServices()

### Method Detail

#### simpleTest

    @GET
     @Path(value="simpleTest")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response simpleTest()

Simple JAXRS endpoint.

Returns:
  OK response

#### localSpan

    @GET
     @Path(value="localSpan")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response localSpan()

Endpoint which creates local span.

Returns:
  OK response

#### asyncLocalSpan

    @GET
     @Path(value="asyncLocalSpan")
     @Produces(value="text/plain")
    public void asyncLocalSpan(@Suspended
                                                                                                  jakarta.ws.rs.container.AsyncResponse asyncResponse)

Async endpoint which creates local span.

Parameters:
  `asyncResponse` - holds state of the asynchronous processing

#### error

    @GET
     @Path(value="error")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response error()

Returns HTTP 500 error.

Returns:
  error response

#### exception

    @GET
     @Path(value="exception")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response exception()

Returns HTTP 500 error.

Returns:
  Response Never returned because an exception is thrown.

#### annotations

    @GET
     @Path(value="annotations")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response annotations()

Web service endpoint to test Traced annotations.

Returns:
  HTTP 200 OK.

#### annotationException

    @GET
     @Path(value="annotationException")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response annotationException()

Web service endpoint to test a Traced annotation with an exception.

Returns:
  HTTP 200 OK.

#### notTraced

    @Traced(value=false)
     @GET
     @Path(value="notTraced")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response notTraced()

Shouldn't create a span.

Returns:
  OK response

#### operationName

    @Traced(operationName="operationName")
     @GET
     @Path(value="operationName")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response operationName()

Traced with an explicit operation name.

Returns:
  OK response

#### nested

    @GET
     @Path(value="nested")
     @Produces(value="text/plain")
    public jakarta.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

Web service call that calls itself `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.

Parameters:
  `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 error
  `async` - Whether the nested request is executed asynchronously.
Returns:
  OK response
Throws:
  `ExecutionException` - Error executing nested web service.
  `InterruptedException` - Error executing nested web service.

#### skipSimple

    @GET
     @Path(value="skipSimple")
     @Produces(value="text/plain")
    public jakarta.ws.rs.core.Response skipSimple()

Endpoint which creates local span.

Returns:
  OK response

#### getRequestPath

    public String getRequestPath(String servicePath,
                                 String endpointPath,
                                 Map<String,Object> requestParameters)

Create the full URL for the web service request.

Parameters:
  `servicePath` - Service path component.
  `endpointPath` - The final component of the path.
  `requestParameters` - Query parameters.
Returns:
  Full URL for the web service request.