Class FollowLink

  • All Implemented Interfaces:
    HalClientAction, io.wcm.caravan.pipeline.JsonPipelineAction

    @ProviderType
    public final class FollowLink
    extends Object
    Action to load a HAL link and replace the current resource by the loaded one.
    • Constructor Detail

      • FollowLink

        public FollowLink​(String serviceId,
                          String relation,
                          int index,
                          Map<String,​Object> parameters)
        Parameters:
        serviceId - Service ID
        relation - Link relation to embed
        index - Index of the link to embed
        parameters - URI parameters
      • FollowLink

        public FollowLink​(ServiceIdExtractor serviceId,
                          String relation,
                          int index,
                          Map<String,​Object> parameters)
        Parameters:
        serviceId - function to extract Service ID from a given request URL
        relation - Link relation to embed
        index - Index of the link to embed
        parameters - URI parameters
      • FollowLink

        public FollowLink​(ServiceIdExtractor serviceId,
                          String relation,
                          String name,
                          Map<String,​Object> parameters)
        Parameters:
        serviceId - function to extract Service ID from a given request URL
        relation - Link relation to embed
        name - of the link to embed
        parameters - URI parameters
    • Method Detail

      • getId

        public String getId()
      • withHttpMethod

        public HalClientAction withHttpMethod​(String httpMethodToUse)
        Parameters:
        httpMethodToUse - the HTTP method to use when loading the link
        Returns:
        this
      • execute

        public rx.Observable<io.wcm.caravan.pipeline.JsonPipelineOutput> execute​(io.wcm.caravan.pipeline.JsonPipelineOutput previousStepOutput,
                                                                                 io.wcm.caravan.pipeline.JsonPipelineContext context)
      • setCacheStrategy

        public HalClientAction setCacheStrategy​(io.wcm.caravan.pipeline.cache.CacheStrategy value)
        Specified by:
        setCacheStrategy in interface HalClientAction
        Parameters:
        value - Caching strategy
        Returns:
        This HAL client action
      • setExceptionHandlers

        public HalClientAction setExceptionHandlers​(List<io.wcm.caravan.pipeline.JsonPipelineExceptionHandler> value)
        Specified by:
        setExceptionHandlers in interface HalClientAction
        Parameters:
        value - Exception Handlers
        Returns:
        This HAL client action
      • getCacheStrategy

        public io.wcm.caravan.pipeline.cache.CacheStrategy getCacheStrategy()
        Returns:
        Returns the cacheStrategy.
      • getExceptionHandlers

        public List<io.wcm.caravan.pipeline.JsonPipelineExceptionHandler> getExceptionHandlers()
        Returns:
        Returns the exceptionHandlers.
      • getLogger

        public org.slf4j.Logger getLogger()
        Returns:
        Current Logger
      • hasLogger

        public boolean hasLogger()
        Returns:
        True if has a logger
      • getHttpHeaders

        public com.google.common.collect.Multimap<String,​String> getHttpHeaders()
        Returns:
        Returns the httpHeaders.