@Provider public class IntegerDiscoveryContext extends Object implements DiscoveryContext<Integer>, javax.ws.rs.ext.ContextResolver<DiscoveryContext<Integer>>
DiscoveryContext
that uses an int as the
payloadConstructor and Description |
---|
IntegerDiscoveryContext(ServiceDiscovery<Integer> serviceDiscovery,
ProviderStrategy<Integer> providerStrategy,
int instanceRefreshMs) |
Modifier and Type | Method and Description |
---|---|
DiscoveryContext<Integer> |
getContext(Class<?> type) |
int |
getInstanceRefreshMs()
Return the threshold in milliseconds to consider a registration stale
|
ProviderStrategy<Integer> |
getProviderStrategy()
Return the provider strategy to use for
DiscoveryResource.getAny(String) |
ServiceDiscovery<Integer> |
getServiceDiscovery()
Return the service singleton
|
void |
marshallJson(com.fasterxml.jackson.databind.node.ObjectNode node,
String fieldName,
Integer payload)
Serialize your payload
|
Integer |
unMarshallJson(com.fasterxml.jackson.databind.JsonNode node)
Deserialize your payload
|
public IntegerDiscoveryContext(ServiceDiscovery<Integer> serviceDiscovery, ProviderStrategy<Integer> providerStrategy, int instanceRefreshMs)
public ProviderStrategy<Integer> getProviderStrategy()
DiscoveryContext
DiscoveryResource.getAny(String)
getProviderStrategy
in interface DiscoveryContext<Integer>
public int getInstanceRefreshMs()
DiscoveryContext
getInstanceRefreshMs
in interface DiscoveryContext<Integer>
public ServiceDiscovery<Integer> getServiceDiscovery()
DiscoveryContext
getServiceDiscovery
in interface DiscoveryContext<Integer>
public void marshallJson(com.fasterxml.jackson.databind.node.ObjectNode node, String fieldName, Integer payload) throws Exception
DiscoveryContext
marshallJson
in interface DiscoveryContext<Integer>
node
- the node to serialize intofieldName
- field name to usepayload
- the payload value (can be null)Exception
- any errorspublic Integer unMarshallJson(com.fasterxml.jackson.databind.JsonNode node) throws Exception
DiscoveryContext
unMarshallJson
in interface DiscoveryContext<Integer>
node
- the node that has the payloadException
- any errorspublic DiscoveryContext<Integer> getContext(Class<?> type)
getContext
in interface javax.ws.rs.ext.ContextResolver<DiscoveryContext<Integer>>
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.