Class DiscoveredResource
java.lang.Object
org.springframework.cloud.client.hypermedia.DiscoveredResource
- All Implemented Interfaces:
RemoteResource
A REST resource that is defined by a service reference and a traversal operation within
that service.
- Author:
- Oliver Gierke
-
Constructor Summary
ConstructorsConstructorDescriptionDiscoveredResource
(ServiceInstanceProvider provider, TraversalDefinition traversal) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.hateoas.Link
getLink()
Returns theLink
to the resource if it is available, or null if it is gone (i.e.org.springframework.web.client.RestOperations
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
Verifies the link to the current.
-
Constructor Details
-
DiscoveredResource
-
-
Method Details
-
getProvider
-
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
-