- 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 representsEndpointConfig.AnnotationScope.APPLICATION
level annotations. Other levels are representations of resource, sub-resource and method used on path to get to the target method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SecurityLevel.SecurityLevelBuilder
Builder forSecurityLevel
class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Class<? extends Annotation>,List<Annotation>>
allAnnotations()
Returns class level and method level annotations together in oneMap
.<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.static SecurityLevel.SecurityLevelBuilder
create(SecurityLevel copyFrom)
Creates builder for security levels based on previously created security level.static SecurityLevel.SecurityLevelBuilder
create(String className)
Creates builder for security levels based on class name.<T extends Annotation>
List<T>filterAnnotations(Class<T> annotationType, EndpointConfig.AnnotationScope scope)
Filters out all annotations of the specific type in the specific scope.Map<Class<? extends Annotation>,List<Annotation>>
getClassLevelAnnotations()
Returns class level annotations.String
getClassName()
Returns the name of the class which this level represents.Map<Class<? extends Annotation>,List<Annotation>>
getMethodLevelAnnotations()
Returns method level annotations.String
getMethodName()
Returns the name of the method which this level represents.String
toString()
-
-
-
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 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 annotationscope
- 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 annotationscopes
- desired scopes- Returns:
- list of annotations
-
allAnnotations
public Map<Class<? extends Annotation>,List<Annotation>> allAnnotations()
Returns class level and method level annotations together in oneMap
.- 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
-
-