Interface CapabilityContext
- All Known Implementing Classes:
CapabilityContextImpl
@PublicApi
public interface CapabilityContext
Allows the ability to retrieve a capability set specific to the context
it is called from. Capability set is stored in ThreadLocal.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Removes whatever is currently stored in thread local@Nullable ReadOnlyCapabilitySet
Retrieves the capability set currently stored within the context, If empty the shared local (server) capabilities are returned@Nullable String
getCapabilityValue
(@NotNull String key) Convenience method.void
setCapabilitySet
(@Nullable ReadOnlyCapabilitySet capabilitySet) Stores a specific capability set within the ThreadLocal
-
Method Details
-
getCapabilitySet
Retrieves the capability set currently stored within the context, If empty the shared local (server) capabilities are returned- Returns:
- ReadOnlyCapabilitySet
-
setCapabilitySet
Stores a specific capability set within the ThreadLocal- Parameters:
capabilitySet
-
-
clearCapabilitySet
void clearCapabilitySet()Removes whatever is currently stored in thread local -
getCapabilityValue
Convenience method. Retrieves value of capability.- Parameters:
key
- capability key- Returns:
- capability value or null if there are no capabilities set or there's no capability of given key
-