org.zodiac.cache.config.HttpCacheableInfo Maven / Gradle / Ivy
The newest version!
package org.zodiac.cache.config;
import java.util.Arrays;
import java.util.List;
import org.springframework.http.HttpMethod;
import org.zodiac.commons.util.Colls;
import org.zodiac.sdk.toolkit.util.collection.CollUtil;
public class HttpCacheableInfo {
public static final String DEFAULT_STATIC_PATH_PATTERN = "/**";
/*开启cache。*/
private boolean enabled = true;
private String cacheName = "platformHttpCache";
/*允许缓存的HTTP请求,方法。默认针对 HEAD 和 GET 请求。*/
private List allowedMethods = Arrays.asList(HttpMethod.HEAD, HttpMethod.GET);
/*默认拦截/***/
private final List includePatterns = CollUtil.list(DEFAULT_STATIC_PATH_PATTERN);
/*默认排除静态文件目录。*/
private final List excludePatterns = CollUtil.list();
public HttpCacheableInfo() {
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getCacheName() {
return cacheName;
}
public List getAllowedMethods() {
return allowedMethods;
}
public void setAllowedMethods(List allowedMethods) {
this.allowedMethods = allowedMethods;
}
public void setCacheName(String cacheName) {
this.cacheName = cacheName;
}
public List getIncludePatterns() {
return includePatterns;
}
public List getExcludePatterns() {
return excludePatterns;
}
}