public class CacheKey extends Object
Modifier and Type | Method and Description |
---|---|
CacheKey |
append(CacheKey other,
Object... objects)
Appends the given CacheKey to this instance.
|
CacheKey |
append(Object object,
Object... objects)
Appends the given Objects to this instance.
|
boolean |
equals(Object o) |
ArrayList<Object> |
getComponents() |
com.google.common.base.Optional<String> |
getTenantId() |
com.google.common.base.Optional<String> |
getUserName() |
int |
hashCode() |
static CacheKey |
newGlobalKey() |
static CacheKey |
newGlobalKey(CacheKey cacheKey)
Converts the given CacheKey to a globally visible CacheKey.
|
static CacheKey |
newTenantIsolatedKey() |
static CacheKey |
newTenantIsolatedKey(CacheKey cacheKey) |
static CacheKey |
newTenantIsolatedKey(CacheKey cacheKey,
String tenantId)
Converts the given CacheKey to a tenant-isolated CacheKey.
|
static CacheKey |
newTenantIsolatedKey(String tenantId) |
static CacheKey |
newUserIsolatedKey() |
static CacheKey |
newUserIsolatedKey(CacheKey cacheKey) |
static CacheKey |
newUserIsolatedKey(CacheKey cacheKey,
String userName) |
static CacheKey |
newUserIsolatedKey(CacheKey cacheKey,
String tenantId,
String userName)
Converts the given CacheKey to a tenant-isolated CacheKey.
|
static CacheKey |
newUserIsolatedKey(String userName) |
static CacheKey |
newUserIsolatedKey(String tenantId,
String userName) |
static CacheKey |
newUserOrTenantIsolatedKey()
Returns a tenant- and user-isolated cache key.
|
static CacheKey |
newUserOrTenantIsolatedKey(CacheKey cacheKey)
Returns a tenant- and user-isolated cache key.
|
String |
toString() |
public com.google.common.base.Optional<String> getTenantId()
public com.google.common.base.Optional<String> getUserName()
public CacheKey append(CacheKey other, Object... objects) throws UnmergeableCacheKeyException
IllegalArgumentException
- If the given CacheKey is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.public CacheKey append(@Nullable Object object, Object... objects)
Object.equals(Object)
and
Object.hashCode()
are used.public static CacheKey newGlobalKey(CacheKey cacheKey) throws IllegalArgumentException, UnmergeableCacheKeyException
cacheKey
- Cache key that is appended to the newly constructed key.IllegalArgumentException
- If the given CacheKey is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.public static CacheKey newGlobalKey()
public static CacheKey newTenantIsolatedKey(String tenantId) throws IllegalArgumentException
IllegalArgumentException
- If the given tenant is null.public static CacheKey newTenantIsolatedKey() throws TenantNotFoundException
TenantNotFoundException
- If the tenant is not known. This typically occurs when trying to access the tenant within code that
is running outside any tenant context, e.g., within a background task.newTenantIsolatedKey(String)
public static CacheKey newTenantIsolatedKey(CacheKey cacheKey, String tenantId) throws IllegalArgumentException, UnmergeableCacheKeyException
cacheKey
- Cache key that is appended to the newly constructed key.IllegalArgumentException
- If the given CacheKey or tenant is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.public static CacheKey newTenantIsolatedKey(CacheKey cacheKey) throws IllegalArgumentException, UnmergeableCacheKeyException
cacheKey
- Cache key that is appended to the newly constructed key.IllegalArgumentException
- If the given CacheKey is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.newTenantIsolatedKey(CacheKey, String)
public static CacheKey newUserIsolatedKey(String tenantId, String userName) throws IllegalArgumentException
IllegalArgumentException
- If the given tenant or user is null.public static CacheKey newUserIsolatedKey(String userName) throws IllegalArgumentException, TenantNotFoundException
IllegalArgumentException
- If the given user is null.TenantNotFoundException
- If the tenant is not known. This typically occurs when trying to access the tenant within code that
is running outside any tenant context, e.g., within a background task.newUserIsolatedKey(String, String)
public static CacheKey newUserIsolatedKey() throws TenantNotFoundException, UserNotAuthenticatedException
TenantNotFoundException
- If the tenant is not known. This typically occurs when trying to access the tenant within code that
is running outside any tenant context, e.g., within a background task.UserNotAuthenticatedException
- If the user is not authenticated.newUserIsolatedKey(String, String)
public static CacheKey newUserIsolatedKey(CacheKey cacheKey, String tenantId, String userName) throws IllegalArgumentException, UnmergeableCacheKeyException
cacheKey
- Cache key that is appended to the newly constructed key.IllegalArgumentException
- If the given CacheKey, tenant, or user is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.public static CacheKey newUserIsolatedKey(CacheKey cacheKey, String userName) throws IllegalArgumentException, UnmergeableCacheKeyException, TenantNotFoundException
cacheKey
- Cache key that is appended to the newly constructed key.IllegalArgumentException
- If the given CacheKey or user is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.TenantNotFoundException
- If the tenant is not known. This typically occurs when trying to access the tenant within code that
is running outside any tenant context, e.g., within a background task.newUserIsolatedKey(CacheKey, String, String)
public static CacheKey newUserIsolatedKey(CacheKey cacheKey) throws IllegalArgumentException, UnmergeableCacheKeyException, TenantNotFoundException, UserNotAuthenticatedException
cacheKey
- Cache key that is appended to the newly constructed key.IllegalArgumentException
- If the given CacheKey is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.TenantNotFoundException
- If the tenant is not known. This typically occurs when trying to access the tenant within code that
is running outside any tenant context, e.g., within a background task.UserNotAuthenticatedException
- If the user is not authenticated.newUserIsolatedKey(CacheKey, String, String)
public static CacheKey newUserOrTenantIsolatedKey() throws TenantNotFoundException
TenantNotFoundException
- If the tenant is not known. This typically occurs when trying to access the tenant within code that
is running outside any tenant context, e.g., within a background task.public static CacheKey newUserOrTenantIsolatedKey(CacheKey cacheKey) throws IllegalArgumentException, UnmergeableCacheKeyException, TenantNotFoundException
cacheKey
- Cache key that is appended to the newly constructed key.IllegalArgumentException
- If the given CacheKey is null.UnmergeableCacheKeyException
- If the tenant or user in the isolation level of the given CacheKey is different from the respective
tenant or user in this CacheKey.TenantNotFoundException
- If the tenant is not known. This typically occurs when trying to access the tenant within code that
is running outside any tenant context, e.g., within a background task.newUserOrTenantIsolatedKey()
@Generated(value="lombok") public boolean equals(Object o)
@Generated(value="lombok") public int hashCode()
@Generated(value="lombok") public String toString()
@Generated(value="lombok") public ArrayList<Object> getComponents()
Copyright © 2017 SAP SE. All rights reserved.