Class DiscoveryResource<T>
java.lang.Object
org.apache.curator.x.discovery.server.rest.DiscoveryResource<T>
The JAX-RS web service. Due to how most JAX-RS implementations are written, you must create a concrete class that extends this using your payload type. The concrete class should have the base path that you'd like to use.
Because the JAX-RS implementation can create a new instance of the resource for every request, your concrete class must use a context resolver to access the DiscoveryContext. Or, if you are using an IoC framework, you can access it that way.
Here's a version that has no payload (i.e. a Void payload):
@Path("/") public class MyResource extends DiscoveryResource<Void> { public MyResource(@Context ContextResolver<DiscoveryContext<Void>> resolver) { // note: this may not work with all JAX-RS implementations super(resolver.getContext(DiscoveryContext.class)); } }
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
javax.ws.rs.core.Response
javax.ws.rs.core.Response
javax.ws.rs.core.Response
javax.ws.rs.core.Response
getDeprecated
(String name, String id) Deprecated.javax.ws.rs.core.Response
putService
(ServiceInstance<T> instance, String name, String id) javax.ws.rs.core.Response
removeService
(String name, String id)
-
Constructor Details
-
DiscoveryResource
-
-
Method Details
-
putService
-
removeService
-
getDeprecated
Deprecated. -
get
-
getAllNames
public javax.ws.rs.core.Response getAllNames() -
getAll
-
getAny
-