Class AuthorizerNoop

java.lang.Object
thredds.servlet.restrict.AuthorizerNoop
All Implemented Interfaces:
Authorizer

public class AuthorizerNoop extends Object implements Authorizer
No-op implementation of Authorizer. Always returns authorize=true.
Since:
Dec 28, 2009
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    authorize(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, String role)
    Decide is this request is authorized in the named role.
    void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
    Process this request.
    void
    Set the role source, if there is one.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AuthorizerNoop

      public AuthorizerNoop()
  • Method Details

    • setRoleSource

      public void setRoleSource(RoleSource roleSource)
      Description copied from interface: Authorizer
      Set the role source, if there is one. If not, assume no role authentication is needed. use RoleSource.hasRole() to test for role.
      Specified by:
      setRoleSource in interface Authorizer
      Parameters:
      roleSource - tells whether a user has the named role.
    • authorize

      public boolean authorize(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, String role) throws IOException, jakarta.servlet.ServletException
      Description copied from interface: Authorizer
      Decide is this request is authorized in the named role. This method must be thread-safe.
      Specified by:
      authorize in interface Authorizer
      Parameters:
      req - the request
      res - the response
      role - need this role
      Returns:
      true if user is authenticated. if false, must set res.setStatus().
      Throws:
      IOException - I/O error, eg network
      jakarta.servlet.ServletException - other errors
    • doGet

      public void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws jakarta.servlet.ServletException, IOException
      Description copied from interface: Authorizer
      Process this request. May be a no-op.
      Specified by:
      doGet in interface Authorizer
      Parameters:
      req - the request
      res - the response
      Throws:
      jakarta.servlet.ServletException - other errors
      IOException - I/O error, eg network