Class DiscoveredResource
- java.lang.Object
-
- org.springframework.cloud.client.hypermedia.DiscoveredResource
-
- All Implemented Interfaces:
RemoteResource
public class DiscoveredResource extends Object implements RemoteResource
A REST resource that is defined by a service reference and a traversal operation within that service.- Author:
- Oliver Gierke
-
-
Constructor Summary
Constructors Constructor Description DiscoveredResource(ServiceInstanceProvider provider, TraversalDefinition traversal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.hateoas.Link
getLink()
Returns theLink
to the resource if it is available, or null if it is gone (i.e.ServiceInstanceProvider
getProvider()
org.springframework.web.client.RestOperations
getRestOperations()
TraversalDefinition
getTraversal()
void
setLink(org.springframework.hateoas.Link link)
void
setRestOperations(org.springframework.web.client.RestOperations restOperations)
Configures theRestOperations
to use to execute the traversal and verifying HEAD calls.void
verifyOrDiscover()
Verifies the link to the current.
-
-
-
Constructor Detail
-
DiscoveredResource
public DiscoveredResource(ServiceInstanceProvider provider, TraversalDefinition traversal)
-
-
Method Detail
-
getProvider
public ServiceInstanceProvider getProvider()
-
getTraversal
public TraversalDefinition getTraversal()
-
getRestOperations
public org.springframework.web.client.RestOperations getRestOperations()
-
setRestOperations
public void setRestOperations(org.springframework.web.client.RestOperations restOperations)
Configures theRestOperations
to use to execute the traversal and verifying HEAD calls.- Parameters:
restOperations
- Can be null; resorts to a defaultRestTemplate
in that case.
-
getLink
public org.springframework.hateoas.Link getLink()
Description copied from interface:RemoteResource
Returns theLink
to the resource if it is available, or null if it is gone (i.e. it either is generally unavailable or can't be discovered).- Specified by:
getLink
in interfaceRemoteResource
- Returns:
- a link to the resource.
-
setLink
public void setLink(org.springframework.hateoas.Link link)
-
verifyOrDiscover
public void verifyOrDiscover()
Verifies the link to the current.- Specified by:
verifyOrDiscover
in interfaceRemoteResource
-
-