Class ClientAuthorizers


  • public class ClientAuthorizers
    extends java.lang.Object
    Utility class containing ClientAuthorizer implementations.
    Since:
    2 Feb 2011
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static ClientAuthorizer FALSE
      Authorizer which always denies access, with INFO logging either way.
      private static java.util.logging.Logger logger_  
      private static ClientAuthorizer swingAuth_
      Authorizer which queries the user via a popup dialogue, with INFO logging either way.
      static ClientAuthorizer TRUE
      Authorizer which always permits access, with WARNING logging either way.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ClientAuthorizers()  
    • Field Detail

      • FALSE

        public static final ClientAuthorizer FALSE
        Authorizer which always denies access, with INFO logging either way.
      • TRUE

        public static final ClientAuthorizer TRUE
        Authorizer which always permits access, with WARNING logging either way.
      • swingAuth_

        private static ClientAuthorizer swingAuth_
        Authorizer which queries the user via a popup dialogue, with INFO logging either way.
      • logger_

        private static final java.util.logging.Logger logger_
    • Constructor Detail

      • ClientAuthorizers

        private ClientAuthorizers()
    • Method Detail

      • createFixedClientAuthorizer

        public static ClientAuthorizer createFixedClientAuthorizer​(boolean policy)
        Returns a new authorizer instance which always produces the same authorization status.
        Parameters:
        policy - value to return from the authorize method
        Returns:
        new authorizer
      • createLoggingClientAuthorizer

        public static ClientAuthorizer createLoggingClientAuthorizer​(ClientAuthorizer auth,
                                                                     java.util.logging.Level acceptLevel,
                                                                     java.util.logging.Level refuseLevel)
        Returns a new authorizer instance based on an existing one which logs authorization results through the logging system.
        Parameters:
        auth - base authorizer
        acceptLevel - logging level at which auth acceptances are logged
        refuseLevel - logging level at which auth refusals are logged
        Returns:
        new authorizer