Commit b0af5a1a authored by Yong Liu's avatar Yong Liu
Browse files

refs #3019, add Etag modification.

parent e8648480
......@@ -8,16 +8,18 @@ import com.nesstar.rest.filters.CubeEntityTagFilter;
import com.nesstar.rest.request_objects.CubeRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
public final class ETag {
public static final String HEADER_NAME = "ETag";
private final String hash;
private ETag(final String tag) {
hash = tag;
}
public String getValue() {
return hash;
}
......@@ -38,7 +40,7 @@ public final class ETag {
public int hashCode() {
return hash.hashCode();
}
public static ETag createETag(final ETagGenerator generator) {
final String checksum = generator.generateETagFromData();
return new ETag(checksum);
......@@ -77,8 +79,8 @@ public final class ETag {
return ETag.createETag(new ETagGenerator(data));
}
public static ETag generateEtagForCube(final CubeRequest cubeRequest, final String url, final String cubeId) {
ETagData data = CubeEntityTagFilter.generateETagData(cubeRequest, url, cubeId);
public static ETag generateEtagForCube(final CubeClassVariables classVariables, final String url, final String cubeId) {
ETagData data = CubeEntityTagFilter.generateETagData(classVariables, url, cubeId);
return createETag(new ETagGenerator(data));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment