Class EventVoter<T>

java.lang.Object
org.springframework.statemachine.security.EventVoter<T>
Type Parameters:
T - the message type
All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter<org.springframework.messaging.Message<T>>

public class EventVoter<T> extends Object implements org.springframework.security.access.AccessDecisionVoter<org.springframework.messaging.Message<T>>
Votes if any ConfigAttribute.getAttribute() starts with a prefix indicating that it is an event. The default prefix is EVENT, but it may be overridden to any value. It may also be set to empty, which means that essentially any attribute will be voted on. As described further below, the effect of an empty prefix may not be quite desirable.

All comparisons and prefixes are case sensitive.

Author:
Janne Valkealahti
  • Field Summary

    Fields inherited from interface org.springframework.security.access.AccessDecisionVoter

    ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the event prefix.
    boolean
    supports(Class<?> clazz)
     
    boolean
    supports(org.springframework.security.access.ConfigAttribute attribute)
     
    int
    vote(org.springframework.security.core.Authentication authentication, org.springframework.messaging.Message<T> event, Collection<org.springframework.security.access.ConfigAttribute> attributes)
     

    Methods inherited from class java.lang.Object

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

    • EventVoter

      public EventVoter()
  • Method Details

    • supports

      public boolean supports(org.springframework.security.access.ConfigAttribute attribute)
      Specified by:
      supports in interface org.springframework.security.access.AccessDecisionVoter<T>
    • supports

      public boolean supports(Class<?> clazz)
      Specified by:
      supports in interface org.springframework.security.access.AccessDecisionVoter<T>
    • vote

      public int vote(org.springframework.security.core.Authentication authentication, org.springframework.messaging.Message<T> event, Collection<org.springframework.security.access.ConfigAttribute> attributes)
      Specified by:
      vote in interface org.springframework.security.access.AccessDecisionVoter<T>
    • getEventPrefix

      public String getEventPrefix()
      Gets the event prefix.
      Returns:
      the event prefix