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

org.jboss.resteasy.reactive.server.handlers.CacheControlHandler Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package org.jboss.resteasy.reactive.server.handlers;

import jakarta.ws.rs.core.HttpHeaders;

import org.jboss.resteasy.reactive.common.util.ExtendedCacheControl;
import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext;
import org.jboss.resteasy.reactive.server.spi.ServerRestHandler;

public class CacheControlHandler implements ServerRestHandler {

    // make mutable to allow for bytecode serialization
    private ExtendedCacheControl cacheControl;

    public CacheControlHandler() {
    }

    public ExtendedCacheControl getCacheControl() {
        return cacheControl;
    }

    public void setCacheControl(ExtendedCacheControl cacheControl) {
        this.cacheControl = cacheControl;
    }

    @Override
    public void handle(ResteasyReactiveRequestContext requestContext) throws Exception {
        requestContext.getResponse().get().getHeaders().putSingle(HttpHeaders.CACHE_CONTROL, cacheControl);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy