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

com.twelvemonkeys.servlet.cache.ClientCacheRequest Maven / Gradle / Ivy

package com.twelvemonkeys.servlet.cache;

import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * ClientCacheRequest
 *
 * @author Harald Kuhr
 * @author last modified by $Author: haku $
 * @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/cache/ClientCacheRequest.java#1 $
 */
public final class ClientCacheRequest extends AbstractCacheRequest {
    private Map> mParameters;
    private Map> mHeaders;

    public ClientCacheRequest(final URI pRequestURI,final Map> pParameters, final Map> pHeaders) {
        super(pRequestURI, "GET"); // TODO: Consider supporting more than get? At least HEAD and OPTIONS...
        mParameters = normalizeMap(pParameters);
        mHeaders = normalizeMap(pHeaders);
    }

    private  Map normalizeMap(Map pMap) {
        return pMap == null ? Collections.emptyMap() : Collections.unmodifiableMap(pMap);
    }

    public Map> getParameters() {
        return mParameters;
    }

    public Map> getHeaders() {
        return mHeaders;
    }

    public String getServerName() {
        return getRequestURI().getAuthority();
    }

    public int getServerPort() {
        return getRequestURI().getPort();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy