Interface EntityViewAccessProvider

  • All Known Subinterfaces:
    AccessFormats, AccessViews, RequestHandler

    public interface EntityViewAccessProvider
    Represents a bean which is capable of handling access for an EntityView, this replaces the HttpServletAccessProvider as all entity URLs are now being parsed so more information can be provided through the EntityView

    This interface would be typically implemented from a tool (webapp) context, and registered with the EntityViewAccessProviderManager in a context loader listener

    If the implementation throws a SecurityException during the course of this method, the access will be directed to a login page or authentication method before being redirected back to the implementation method
    If you want to control the requests which make it through to this by format type you can optionally implement AccessFormats
    Author:
    Aaron Zeckoski (aaron@caret.cam.ac.uk)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void handleAccess​(EntityView view, HttpServletRequest req, HttpServletResponse res)
      Make and return the data responses for this type of data provider for a specific entity view and entity reference (contained within the entity view), use the request to get any additional sent in information you may need or want and use the response to hold the output you generate

      NOTE: If you decide that you cannot handle this access request for any reason you can either throw an EntityException to specify why OR throw a general Exception, both will kill the request entirely but the general exception will pass through the system while the EntityException will produce a handled result
    • Method Detail

      • handleAccess

        void handleAccess​(EntityView view,
                          HttpServletRequest req,
                          HttpServletResponse res)
        Make and return the data responses for this type of data provider for a specific entity view and entity reference (contained within the entity view), use the request to get any additional sent in information you may need or want and use the response to hold the output you generate

        NOTE: If you decide that you cannot handle this access request for any reason you can either throw an EntityException to specify why OR throw a general Exception, both will kill the request entirely but the general exception will pass through the system while the EntityException will produce a handled result
        Parameters:
        view - an entity view, should contain all the information related to the incoming entity URL
        req - the servlet request (available in case you need to get anything out of it)
        res - the servlet response, put the correct data response into the outputstream
        Throws:
        FormatUnsupportedException - if the format requested in the view is not supported
        EntityException - if there is a request processing/handling failure