Remove "/" sign in AbstractRestconfStreamRegistry
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / server / api / ConfigurationMetadata.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.restconf.server.api;
9
10 import java.time.Instant;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.eclipse.jdt.annotation.Nullable;
13
14 /**
15  * Metadata maintained by a {@link RestconfServer} for configuration resources.
16  */
17 public interface ConfigurationMetadata {
18     /**
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>.
21      *
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
24      */
25     @NonNullByDefault
26     record EntityTag(String value, boolean weak) {
27         public EntityTag {
28             if (value.isBlank()) {
29                 throw new IllegalArgumentException("Value must not be blank");
30             }
31         }
32     }
33
34     /**
35      * The {@code ETag} HTTP header, if supported by the server.
36      *
37      * @return An {@link EntityTag} or {@code null} if not supported.
38      */
39     @Nullable EntityTag entityTag();
40
41     /**
42      * The {@code Last-Modified} HTTP header, if maintained by the server.
43      *
44      * @return An {@link Instant} or {@code null} if not maintained.
45      */
46     @Nullable Instant lastModified();
47 }