Class SecurityHandlersManager


  • public class SecurityHandlersManager
    extends java.lang.Object
    This class manages security handlers for the application. It follows the singleton pattern. To be usable, security managers must be registered in it. Security managers are retrieved by the application when necessary.
    Version:
    $Revision: 1.3 $
    Author:
    Benoit Guillon (benoit.guillon@snv.jussieu.fr)
    • Method Detail

      • registerHandler

        public void registerHandler​(java.lang.String filterName,
                                    java.lang.Class securityHandlerClass,
                                    java.lang.Class protectionPolicyClass)
                             throws BadSecurityHandlerException
        register a security handler. If the security handler was already registered an exception is thrown. If another handler was previously registered for the same filter name or for the same policy name, an exception is thrown
        Parameters:
        filterName - The name of the filter.
        securityHandlerClass - Security Handler class to register.
        protectionPolicyClass - Protection Policy class to register.
        Throws:
        BadSecurityHandlerException - If there is an error registering the security handler.
      • getInstance

        public static SecurityHandlersManager getInstance()
        Get the singleton instance.
        Returns:
        The SecurityHandlersManager.
      • getSecurityHandler

        public SecurityHandler getSecurityHandler​(java.lang.String filterName)
                                           throws BadSecurityHandlerException
        Retrieve the appropriate SecurityHandler for a the given filter name. The filter name is an entry of the encryption dictionary of an encrypted document.
        Parameters:
        filterName - The filter name.
        Returns:
        The appropriate SecurityHandler if it exists.
        Throws:
        BadSecurityHandlerException - If the security handler does not exist.