Package com.atlassian.jira.permission
Class DefaultPermissionSchemeAttributeManager
java.lang.Object
com.atlassian.jira.permission.DefaultPermissionSchemeAttributeManager
- All Implemented Interfaces:
InitializingComponent,PermissionSchemeAttributeManager
@ParametersAreNonnullByDefault
public class DefaultPermissionSchemeAttributeManager
extends Object
implements PermissionSchemeAttributeManager, InitializingComponent
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.permission.PermissionSchemeAttributeManager
PermissionSchemeAttributeManager.AttributeKeys -
Constructor Summary
ConstructorsConstructorDescriptionDefaultPermissionSchemeAttributeManager(QueryDslAccessor queryDslAccessor, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.voidclearAttributes(Long schemeId) Deletes all attributes from the permission scheme.voiddeleteAttributes(Long schemeId, Collection<String> keys) Deletes attributes with the defined keys from the permission scheme.getAttribute(Long schemeId, String key) Retrieves attribute value.getAttributes(Long schemeId) Retrieves all attributes for the given permission scheme (including default attributes).Default attributes are meant to exist even if there's no such attribute stored.voidonClearCacheEvent(ClearCacheEvent event) voidsetAttribute(Long schemeId, String key, String value) Upserts an attribute for the given scheme.voidupdateAttributes(Long schemeId, Map<String, String> attributes) Updates ALL attributes for the permission scheme.
-
Constructor Details
-
DefaultPermissionSchemeAttributeManager
public DefaultPermissionSchemeAttributeManager(QueryDslAccessor queryDslAccessor, com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
getAttributes
Description copied from interface:PermissionSchemeAttributeManagerRetrieves all attributes for the given permission scheme (including default attributes).- Specified by:
getAttributesin interfacePermissionSchemeAttributeManager- Parameters:
schemeId- permission scheme id- Returns:
Map<String, String>of attributes' keys and values for the given permission scheme
-
getAttribute
Description copied from interface:PermissionSchemeAttributeManagerRetrieves attribute value.- Specified by:
getAttributein interfacePermissionSchemeAttributeManager- Parameters:
schemeId- permission scheme idkey- attribute key- Returns:
Optional<String>containing attribute value if it exists or default value if specified
Optional<String>#empty()if an attribute with the given key was not found for the given scheme and doesn't have specified default value
-
setAttribute
Description copied from interface:PermissionSchemeAttributeManagerUpserts an attribute for the given scheme.- Specified by:
setAttributein interfacePermissionSchemeAttributeManager- Parameters:
schemeId- permission scheme idkey- attribute keyvalue- attribute value
-
updateAttributes
Description copied from interface:PermissionSchemeAttributeManagerUpdates ALL attributes for the permission scheme.- Specified by:
updateAttributesin interfacePermissionSchemeAttributeManager- Parameters:
schemeId- permission scheme idattributes-Map<String, String>of all attributes the defined scheme should have, e.g. if this map doesn't contain an existing attribute, it would be deleted
-
deleteAttributes
Description copied from interface:PermissionSchemeAttributeManagerDeletes attributes with the defined keys from the permission scheme.- Specified by:
deleteAttributesin interfacePermissionSchemeAttributeManager- Parameters:
schemeId- permission scheme idkeys- aCollection<String>of attribute keys
-
clearAttributes
Description copied from interface:PermissionSchemeAttributeManagerDeletes all attributes from the permission scheme.- Specified by:
clearAttributesin interfacePermissionSchemeAttributeManager- Parameters:
schemeId- permission scheme id
-
getDefaultAttributes
Description copied from interface:PermissionSchemeAttributeManagerDefault attributes are meant to exist even if there's no such attribute stored.- Specified by:
getDefaultAttributesin interfacePermissionSchemeAttributeManager- Returns:
Map<String, String>of default attributes' keys and values
-
onClearCacheEvent
-