Interface ShareService


  • @ConsumerType
    public interface ShareService
    The Share Service allows for implementations of for various Sharing. Implement this interface to provide your own sharing mechanism.

    Asset Share Commons comes with an EmailShareImpl implementation that uses the ACS AEM Commons Email service to send share e-mails.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean accepts​(org.apache.sling.api.SlingHttpServletRequest request)  
      void share​(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, org.apache.sling.api.resource.ValueMap shareParameters)
      Share method to use in the context of a request; Typically a Servlet will call this method on the appropriate ShareService implementation.
    • Method Detail

      • accepts

        boolean accepts​(org.apache.sling.api.SlingHttpServletRequest request)
        Parameters:
        request - the request that provides context of which Asset Share instance the request is coming to.
        Returns:
        true if the share service should process the request.
      • share

        void share​(org.apache.sling.api.SlingHttpServletRequest request,
                   org.apache.sling.api.SlingHttpServletResponse response,
                   org.apache.sling.api.resource.ValueMap shareParameters)
            throws ShareException
        Share method to use in the context of a request; Typically a Servlet will call this method on the appropriate ShareService implementation.
        Parameters:
        request - the request that provides context of which Asset Share instance the request is coming to.
        response - the response
        shareParameters - a <String, Object> map or parameters; This is initially constructed from the request.getParameterMap() but can be augmented in the ShareService implementationa s needed.
        Throws:
        ShareException - is thrown if an error occurs with sharing (required share params are missing) or with the sharing initiation itself.