org.apache.myfaces.extensions.cdi.core.api.security
Class AccessDeniedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.lang.SecurityException
                  extended by org.apache.myfaces.extensions.cdi.core.api.security.AccessDeniedException
All Implemented Interfaces:
Serializable

public class AccessDeniedException
extends SecurityException

Exception occurs in case of a security-violation. It's aware of the reason for the violation as well as the error-view which should be used to display the restriction.

See Also:
Serialized Form

Constructor Summary
AccessDeniedException(Set<SecurityViolation> violations, Class<? extends ViewConfig> errorView)
          Constructor for creating the exception for the given violations and error-view
 
Method Summary
 Class<? extends ViewConfig> getErrorView()
          Optional page which should be used as error-page
 Set<SecurityViolation> getViolations()
          All SecurityViolation which were found by a AccessDecisionVoter
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessDeniedException

public AccessDeniedException(Set<SecurityViolation> violations,
                             Class<? extends ViewConfig> errorView)
Constructor for creating the exception for the given violations and error-view

Parameters:
violations - current violations
errorView - optional inline error-view
Method Detail

getViolations

public Set<SecurityViolation> getViolations()
All SecurityViolation which were found by a AccessDecisionVoter

Returns:
all security-violations

getErrorView

public Class<? extends ViewConfig> getErrorView()
Optional page which should be used as error-page

Returns:
type-safe view-config which is mapped to an error-view. Returning null would force the navigation to the default error-view.


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.