2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.server.api;
10 import java.time.Instant;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.eclipse.jdt.annotation.Nullable;
15 * Metadata maintained by a {@link RestconfServer} for configuration resources.
17 public interface ConfigurationMetadata {
19 * The value of {@code ETag} HTTP header, as specified by
20 * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.5.2">RFC8040 Entity-Tag</a>.
22 * @param value the value, must not be {@link String#isBlank() blank}
23 * @param weak {@code true} if this tag is weak, {@code false} if this tag is strong
26 record EntityTag(String value, boolean weak) {
28 if (value.isBlank()) {
29 throw new IllegalArgumentException("Value must not be blank");
35 * The {@code ETag} HTTP header, if supported by the server.
37 * @return An {@link EntityTag} or {@code null} if not supported.
39 @Nullable EntityTag entityTag();
42 * The {@code Last-Modified} HTTP header, if maintained by the server.
44 * @return An {@link Instant} or {@code null} if not maintained.
46 @Nullable Instant lastModified();