DATAREST-835 - Search resources returning a single resource now get and consider ETag and Last-Modified headers.

We now interpret If-None-Match and If-Modified-Since headers on requests to resources backed by query methods returning a single instance only. This allows clients to optimize GET requests to those resources to save bandwidth.
This commit is contained in:
Oliver Gierke
2016-06-10 23:22:07 +02:00
parent 42378ab34d
commit aa7eec4683
11 changed files with 361 additions and 72 deletions

View File

@@ -0,0 +1,28 @@
/*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.rest.core.util;
/**
* Mimics Java 8's Supplier interface to allow deferring a computation.
*
* @author Oliver Gierke
* @since 2.6
* @soundtrack KRS-One - Sound Of Da Police (Return Of The Boom Bap)
*/
public interface Supplier<T> {
T get();
}