package com.iqser.red.persistence.service.v1.external.api.impl.service;

import static com.iqser.red.service.persistence.management.v1.processor.cache.PersistenceServiceExternalApiCacheConfiguration.OTT_CACHE;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.iqser.red.persistence.service.v1.external.api.impl.model.OneTimeToken;

@Service
public class OneTimeTokenCacheService {


    @Cacheable(value = OTT_CACHE, key = "#tokenId")
    public OneTimeToken cacheOTT(String tokenId, OneTimeToken token) {
        // empty
        return token;
    }


    @Cacheable(value = OTT_CACHE, key = "#tokenId")
    public OneTimeToken getToken(String tokenId) {
        // proxy for hazelcast
        return null;
    }


    @CacheEvict(value = OTT_CACHE, key = "#tokenId")
    public void evictToken(String tokenId) {
        // empty
    }

}
