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.LinkgetLink()Returns theLinkto the resource if it is available, or null if it is gone (i.e.ServiceInstanceProvidergetProvider()org.springframework.web.client.RestOperationsgetRestOperations()TraversalDefinitiongetTraversal()voidsetLink(org.springframework.hateoas.Link link)voidsetRestOperations(org.springframework.web.client.RestOperations restOperations)Configures theRestOperationsto use to execute the traversal and verifying HEAD calls.voidverifyOrDiscover()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 theRestOperationsto use to execute the traversal and verifying HEAD calls.- Parameters:
restOperations- Can be null; resorts to a defaultRestTemplatein that case.
-
getLink
public org.springframework.hateoas.Link getLink()
Description copied from interface:RemoteResourceReturns theLinkto 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:
getLinkin 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:
verifyOrDiscoverin interfaceRemoteResource
-
-