Class AuthenticationExceptionToLabelConverter

java.lang.Object
de.hybris.platform.cockpit.security.AuthenticationExceptionToLabelConverter
All Implemented Interfaces:
Converter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>, org.springframework.core.convert.converter.Converter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>

public class AuthenticationExceptionToLabelConverter extends Object implements Converter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>
Converts the AuthenticationException to a localized label key to be displayed on the login form. Use configurable authenticationExceptionMessageMapping to match labels with authentication exception class.
  • Constructor Details

    • AuthenticationExceptionToLabelConverter

      public AuthenticationExceptionToLabelConverter()
  • Method Details

    • convert

      public org.zkoss.zul.Label convert(org.springframework.security.core.AuthenticationException source) throws ConversionException
      Description copied from interface: Converter
      Converts the source object, creating a new instance of the destination type
      Specified by:
      convert in interface Converter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>
      Parameters:
      source - the source object
      Returns:
      the converted object
      Throws:
      ConversionException - if an error occurs
    • getDefaultLabel

      protected String getDefaultLabel()
    • convert

      public org.zkoss.zul.Label convert(org.springframework.security.core.AuthenticationException source, org.zkoss.zul.Label prototype) throws ConversionException
      Description copied from interface: Converter
      Convert the source object by filling the prototype
      Specified by:
      convert in interface Converter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>
      Parameters:
      source - the source object
      prototype - the prototype to fill
      Returns:
      the converted object, identical to the prototype
      Throws:
      ConversionException - if an error occurs
    • getAuthenticationExceptionMessageMapping

      protected Map<Class,String> getAuthenticationExceptionMessageMapping()
      Returns:
      the authenticationExceptionMessageMapping
    • setAuthenticationExceptionMessageMapping

      public void setAuthenticationExceptionMessageMapping(Map<Class,String> authenticationExceptionMessageMapping)
      Parameters:
      authenticationExceptionMessageMapping - the authenticationExceptionMessageMapping to set
    • setDefaultLabel

      public void setDefaultLabel(String defaultLabel)
      Parameters:
      defaultLabel - the defaultLabel to set
    • getWarningExceptions

      protected List<Class> getWarningExceptions()
      Returns:
      the warningExceptions
    • setWarningExceptions

      public void setWarningExceptions(List<Class> warningExceptions)
      Parameters:
      warningExceptions - the warningExceptions to set