*/
package org.onap.so.aaisimulator.service.providers;
-import static org.onap.so.aaisimulator.utils.Constants.PROJECT_CACHE;
+import static org.onap.so.aaisimulator.utils.CacheName.PROJECT_CACHE;
import static org.onap.so.aaisimulator.utils.Constants.SERVICE_RESOURCE_TYPE;
import java.util.Optional;
import org.onap.aai.domain.yang.Project;
@Override
public void putProject(final String projectName, final Project project) {
LOGGER.info("Adding project: {} with name to cache", project, projectName);
- final Cache cache = getCache(PROJECT_CACHE);
+ final Cache cache = getCache(PROJECT_CACHE.getName());
cache.put(projectName, project);
}
@Override
public Optional<Project> getProject(final String projectName) {
LOGGER.info("getting project from cache using key: {}", projectName);
- final Cache cache = getCache(PROJECT_CACHE);
+ final Cache cache = getCache(PROJECT_CACHE.getName());
final Project value = cache.get(projectName, Project.class);
if (value != null) {
return Optional.of(value);
@Override
public boolean putProjectRelationShip(final String projectName, final Relationship relationship) {
- final Cache cache = getCache(PROJECT_CACHE);
+ final Cache cache = getCache(PROJECT_CACHE.getName());
final Project value = cache.get(projectName, Project.class);
if (value != null) {
RelationshipList relationshipList = value.getRelationshipList();
@Override
public void clearAll() {
- clearCahce(PROJECT_CACHE);
+ clearCahce(PROJECT_CACHE.getName());
}
}