Class DefaultPolicyAspectProcessor

    • Constructor Detail

      • DefaultPolicyAspectProcessor

        public DefaultPolicyAspectProcessor​(PolicyEvaluator policyEvaluator)
    • Method Detail

      • setOverrides

        @Autowired
        public void setOverrides​(@Nullable
                                 List<PolicyOverride> injected)
      • validate

        public Object validate​(org.aspectj.lang.ProceedingJoinPoint joinPoint,
                               Object aspect)
                        throws Throwable
        Description copied from interface: PolicyAspectProcessor
        Validate the Policy annotated method call
        Specified by:
        validate in interface PolicyAspectProcessor
        Parameters:
        joinPoint - metadata about the method call
        aspect - the instance of the Aspect annotate class driving this call
        Returns:
        the result of the call
        Throws:
        Throwable - any exception
      • narrowType

        protected OperationType narrowType​(PolicyInformation policy,
                                           ContextInfo contextInfo)
        Figure out the OperationType to use, given the policy and contextInfo.
        • If there is only one operationType described in Policy:
          • If it's not UNKNOWN, use it
          • If there's not contextInfo, return UNKNOWN
          • Otherwise, return the operation type on the contextInfo
        • Otherwise, find and use the first match of contextInfo operationType in those defined by Policy, or the first OperationType in the policy defined list if no match is found
        Parameters:
        policy - The policy annotation on the method that optionally defines one or more OperationTypes
        contextInfo - The optional contextInfo that describes an overall operationType for the context of the request
        Returns:
        The final OperationType to use for the policy validation
      • notify

        protected void notify​(PolicyResponse policyResponse)
        Raise an exception for a failed PolicyResponse
        Parameters:
        policyResponse - Failed response