Class 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 Detail

      • 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 AnnotationList<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 AnnotationList<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