@ParametersAreNonnullByDefault public class DefaultPermissionSchemeAttributeManager extends Object implements PermissionSchemeAttributeManager
PermissionSchemeAttributeManager.AttributeKeys
Constructor and Description |
---|
DefaultPermissionSchemeAttributeManager(QueryDslAccessor queryDslAccessor,
com.atlassian.cache.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
void |
clearAttributes(Long schemeId)
Deletes all attributes from the permission scheme.
|
void |
deleteAttributes(Long schemeId,
Collection<String> keys)
Deletes attributes with the defined keys from the permission scheme.
|
Optional<String> |
getAttribute(Long schemeId,
String key)
Retrieves attribute value.
|
Map<String,String> |
getAttributes(Long schemeId)
Retrieves all attributes for the given permission scheme (including default attributes).
|
Map<String,String> |
getDefaultAttributes()
Default attributes are meant to exist even if there's no such attribute stored.
|
void |
onClearCacheEvent(ClearCacheEvent event) |
void |
setAttribute(Long schemeId,
String key,
String value)
Upserts an attribute for the given scheme.
|
void |
updateAttributes(Long schemeId,
Map<String,String> attributes)
Updates ALL attributes for the permission scheme.
|
public DefaultPermissionSchemeAttributeManager(QueryDslAccessor queryDslAccessor, com.atlassian.cache.CacheManager cacheManager)
public Map<String,String> getAttributes(Long schemeId)
PermissionSchemeAttributeManager
getAttributes
in interface PermissionSchemeAttributeManager
schemeId
- permission scheme idMap<String, String>
of attributes' keys and values for the given permission schemepublic Optional<String> getAttribute(Long schemeId, String key)
PermissionSchemeAttributeManager
getAttribute
in interface PermissionSchemeAttributeManager
schemeId
- permission scheme idkey
- attribute keyOptional<String>
containing attribute value if it exists or default value if specifiedOptional<String>#empty()
if an attribute with the given key was not found for the given scheme
and doesn't have specified default valuepublic void setAttribute(Long schemeId, String key, String value)
PermissionSchemeAttributeManager
setAttribute
in interface PermissionSchemeAttributeManager
schemeId
- permission scheme idkey
- attribute keyvalue
- attribute valuepublic void updateAttributes(Long schemeId, Map<String,String> attributes)
PermissionSchemeAttributeManager
updateAttributes
in interface PermissionSchemeAttributeManager
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 deletedpublic void deleteAttributes(Long schemeId, Collection<String> keys)
PermissionSchemeAttributeManager
deleteAttributes
in interface PermissionSchemeAttributeManager
schemeId
- permission scheme idkeys
- a Collection<String>
of attribute keyspublic void clearAttributes(Long schemeId)
PermissionSchemeAttributeManager
clearAttributes
in interface PermissionSchemeAttributeManager
schemeId
- permission scheme idpublic Map<String,String> getDefaultAttributes()
PermissionSchemeAttributeManager
getDefaultAttributes
in interface PermissionSchemeAttributeManager
Map<String, String>
of default attributes' keys and values@EventListener public void onClearCacheEvent(ClearCacheEvent event)
Copyright © 2002-2022 Atlassian. All Rights Reserved.