Class EndpointInvocation

java.lang.Object
com.vaadin.hilla.auth.EndpointInvocation
All Implemented Interfaces:
org.aopalliance.intercept.Invocation, org.aopalliance.intercept.Joinpoint, org.aopalliance.intercept.MethodInvocation

public class EndpointInvocation extends Object implements org.aopalliance.intercept.MethodInvocation
Describes an attempt to call an endpoint method.

Instances are used as the subject of the Spring Security authorization events that are published when the access to an endpoint method is denied, so that listeners of AuthorizationDeniedEvent can handle endpoint calls the same way as method security invocations.

This is a description of an invocation that never happened, not a resumable invocation: the arguments are never included, as they are not deserialized before the access check is done, and proceed() is not supported.

  • Constructor Details

    • EndpointInvocation

      public EndpointInvocation(String endpointName, Object endpointObject, Method method)
      Creates a new instance.
      Parameters:
      endpointName - the name of the endpoint, not null
      endpointObject - the endpoint object the method belongs to, not null
      method - the endpoint method, not null
  • Method Details

    • getEndpointName

      public String getEndpointName()
      Gets the name of the endpoint the call was addressed to.
      Returns:
      the endpoint name
    • getMethodName

      public String getMethodName()
      Gets the name of the endpoint method the call was addressed to.
      Returns:
      the endpoint method name
    • getMethod

      public Method getMethod()
      Specified by:
      getMethod in interface org.aopalliance.intercept.MethodInvocation
    • getArguments

      public Object[] getArguments()
      Gets the method arguments, always empty.

      The request payload is deliberately not exposed: the access check is done before the payload is deserialized.

      Specified by:
      getArguments in interface org.aopalliance.intercept.Invocation
      Returns:
      an empty array
    • getThis

      public Object getThis()
      Specified by:
      getThis in interface org.aopalliance.intercept.Joinpoint
    • getStaticPart

      public AccessibleObject getStaticPart()
      Specified by:
      getStaticPart in interface org.aopalliance.intercept.Joinpoint
    • proceed

      public Object proceed()
      Not supported, as this describes a call that was never made.
      Specified by:
      proceed in interface org.aopalliance.intercept.Joinpoint
      Throws:
      UnsupportedOperationException - always
    • toString

      public String toString()
      Overrides:
      toString in class Object