Java Code Examples for org.springframework.cache.interceptor.SimpleKey#EMPTY

The following examples show how to use org.springframework.cache.interceptor.SimpleKey#EMPTY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AwsCachingConfig.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
@Override
public Object generateKey(Object target, Method method, Object... params) {
    if (params.length == 1) {
        AwsCredentialView param = (AwsCredentialView) params[0];
        return param.getCredentialCrn() != null ? param.getCredentialCrn() : SimpleKey.EMPTY;
    }
    return SimpleKey.EMPTY;
}
 
Example 2
Source File: AwsCredentialCachingConfig.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
@Override
public Object generateKey(Object target, Method method, Object... params) {
    if (params.length == 1) {
        AwsCredentialView param = (AwsCredentialView) params[0];
        if (param.getRoleArn() != null) {
            return param.getRoleArn();
        } else if (param.getAccessKey() != null) {
            return param.getAccessKey();
        }
    }
    return SimpleKey.EMPTY;
}
 
Example 3
Source File: CachingConfig.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
@Override
public Object generate(Object target, Method method, Object... params) {
    if (params.length == 1) {
        if (params[0] == null) {
            return SimpleKey.EMPTY;
        }
        CacheDefinition cacheDefinition = classCacheDefinitionMap.get(params[0].getClass());
        if (cacheDefinition != null) {
            return cacheDefinition.generateKey(target, method, params);
        }
    }
    return SimpleKeyGenerator.generateKey(params);
}
 
Example 4
Source File: CachingConfig.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
@Override
public Object generate(Object target, Method method, Object... params) {
    if (params.length == 1) {
        if (params[0] == null) {
            return SimpleKey.EMPTY;
        }
        CacheDefinition cacheDefinition = classCacheDefinitionMap.get(params[0].getClass());
        if (cacheDefinition != null) {
            return cacheDefinition.generateKey(target, method, params);
        }
    }
    return SimpleKeyGenerator.generateKey(params);
}
 
Example 5
Source File: CachingConfig.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
@Override
public Object generate(Object target, Method method, Object... params) {
    if (params.length == 1) {
        if (params[0] == null) {
            return SimpleKey.EMPTY;
        }
        CacheDefinition cacheDefinition = classCacheDefinitionMap.get(params[0].getClass());
        if (cacheDefinition != null) {
            return cacheDefinition.generateKey(target, method, params);
        }
    }
    return SimpleKeyGenerator.generateKey(params);
}