Class ServerScopeProvider

  • All Implemented Interfaces:
    ScopeProvider
    Direct Known Subclasses:
    SecurityServerScopeProvider

    @Singleton
    @Priority(4200)
    @ConstrainedTo(SERVER)
    class ServerScopeProvider
    extends CommonScopeProvider
    Server-side implementation of scope provider. In addition to base implementation this class provides entity-filtering scopes by examining matched resource method and sub-resource locators. This examination comes into play only in case if entity-filtering scopes cannot be found in entity annotations or application configuration.
    • Field Detail

      • uriInfoProvider

        @Inject
        private javax.inject.Provider<ExtendedUriInfo> uriInfoProvider
      • uriToContexts

        private final java.util.concurrent.ConcurrentMap<java.lang.String,​java.util.Set<java.lang.String>> uriToContexts
    • Constructor Detail

      • ServerScopeProvider

        @Inject
        public ServerScopeProvider​(javax.ws.rs.core.Configuration config,
                                   InjectionManager injectionManager)
        Create new server scope provider with injected configuration and jersey injection manager.
    • Method Detail

      • getFilteringScopes

        public java.util.Set<java.lang.String> getFilteringScopes​(java.lang.annotation.Annotation[] entityAnnotations,
                                                                  boolean defaultIfNotFound)
        Description copied from interface: ScopeProvider
        Get entity-filtering scopes to be used to process an entity.
        Specified by:
        getFilteringScopes in interface ScopeProvider
        Overrides:
        getFilteringScopes in class CommonScopeProvider
        Parameters:
        entityAnnotations - entity annotations provided with entity when creating request/response.
        defaultIfNotFound - flag determining whether the default entity-filtering scope should be returned if no other scope can be obtained.
        Returns:
        non-null entity-filtering scopes.
      • getFilteringScopes

        protected java.util.Set<java.lang.String> getFilteringScopes​(java.lang.reflect.Method resourceMethod,
                                                                     java.lang.Class<?> resourceClass)
        Get entity-filtering scopes from examining annotations present on resource method and resource class.
        Parameters:
        resourceMethod - matched resource method to be examined.
        resourceClass - matched resource class to be examined.
        Returns:
        entity-filtering scopes or an empty set if the scopes cannot be obtained.