All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.eightlives.friendlyssl.service.ChallengeTokenStore Maven / Gradle / Ivy

package net.eightlives.friendlyssl.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
public class ChallengeTokenStore {

    private static final Logger LOG = LoggerFactory.getLogger(ChallengeTokenStore.class);

    private final Map tokensToContent = new HashMap<>();

    /**
     * Return map of tokens mapped to their associated content.
     *
     * @return the tokens to content map.
     */
    public Map getTokens() {
        return tokensToContent;
    }

    /**
     * Associate a token with content.
     *
     * @param token   token with which to associate {@code content}
     * @param content content to associate to {@code token}
     */
    public void setToken(String token, String content) {
        LOG.debug("Token " + token + " with content " + content + " added to token store");
        tokensToContent.put(token, content);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy