Class SecurityLevel

java.lang.Object
io.helidon.security.SecurityLevel

public class SecurityLevel extends Object
Security level stores annotations bound to the specific class and method. The first level represents EndpointConfig.AnnotationScope.APPLICATION level annotations. Other levels are representations of resource, sub-resource and method used on path to get to the target method.
  • Method Details

    • create

      public static SecurityLevel.SecurityLevelBuilder create(String className)
      Creates builder for security levels based on class name.
      Parameters:
      className - class name
      Returns:
      new builder
    • create

      public static SecurityLevel.SecurityLevelBuilder create(SecurityLevel copyFrom)
      Creates builder for security levels based on previously created security level.
      Parameters:
      copyFrom - existing security level
      Returns:
      new builder
    • filterAnnotations

      public <T extends Annotation> List<T> filterAnnotations(Class<T> annotationType, EndpointConfig.AnnotationScope scope)
      Filters out all annotations of the specific type in the specific scope.
      Type Parameters:
      T - annotation type
      Parameters:
      annotationType - type of the annotation
      scope - desired scope
      Returns:
      list of annotations
    • combineAnnotations

      public <T extends Annotation> List<T> combineAnnotations(Class<T> annotationType, EndpointConfig.AnnotationScope... scopes)
      Combines all the annotations of the specific type across all the requested scopes.
      Type Parameters:
      T - annotation type
      Parameters:
      annotationType - type of the annotation
      scopes - desired scopes
      Returns:
      list of annotations
    • allAnnotations

      public Map<Class<? extends Annotation>,List<Annotation>> allAnnotations()
      Returns class level and method level annotations together in one Map.
      Returns:
      map with class and method level annotations
    • getClassName

      public String getClassName()
      Returns the name of the class which this level represents.
      Returns:
      class name
    • getMethodName

      public String getMethodName()
      Returns the name of the method which this level represents.
      Returns:
      method name
    • getClassLevelAnnotations

      public Map<Class<? extends Annotation>,List<Annotation>> getClassLevelAnnotations()
      Returns class level annotations.
      Returns:
      map of annotations
    • getMethodLevelAnnotations

      public Map<Class<? extends Annotation>,List<Annotation>> getMethodLevelAnnotations()
      Returns method level annotations.
      Returns:
      map of annotations
    • toString

      public String toString()
      Overrides:
      toString in class Object