2 * Copyright (c) 2016 Cisco Systems, Inc. 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.nb.rfc8040.rests.utils;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.collect.Maps;
13 import java.util.Arrays;
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.opendaylight.yangtools.yang.common.QName;
18 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
21 * Constants for RestconfDataService.
24 public final class RestconfDataServiceConstant {
25 public static final QName NETCONF_BASE_QNAME = SchemaContext.NAME;
27 private RestconfDataServiceConstant() {
28 throw new UnsupportedOperationException("Util class.");
32 * Constants for read data.
35 public static final class ReadData {
37 public static final String CONTENT = "content";
38 public static final String DEPTH = "depth";
39 public static final String FIELDS = "fields";
42 public static final String CONFIG = "config";
43 public static final String ALL = "all";
44 public static final String NONCONFIG = "nonconfig";
47 public static final String UNBOUNDED = "unbounded";
48 public static final int MIN_DEPTH = 1;
49 public static final int MAX_DEPTH = 65535;
51 public static final String READ_TYPE_TX = "READ";
52 public static final String WITH_DEFAULTS = "with-defaults";
53 public static final String REPORT_ALL_DEFAULT_VALUE = "report-all";
54 public static final String REPORT_ALL_TAGGED_DEFAULT_VALUE = "report-all-tagged";
57 throw new UnsupportedOperationException("Util class.");
62 * Common for PostData and PutData.
64 public static final class PostPutQueryParameters {
65 public static final String INSERT = "insert";
66 public static final String POINT = "point";
69 * Insert values, as per <a href="https://tools.ietf.org/html/rfc8040#section-4.8.5">RFC8040 section 4.8.5</a>.
73 * Insert the new data as the new first entry.
77 * Insert the new data as the new last entry.
81 * Insert the new data before the insertion point, as specified by the value of the "point" parameter.
85 * Insert the new data after the insertion point, as specified by the value of the "point" parameter.
89 private static final Map<String, Insert> VALUES = Maps.uniqueIndex(Arrays.asList(values()), Insert::value);
91 private @NonNull String value;
93 Insert(final @NonNull String value) {
97 public @NonNull String value() {
101 public static @Nullable Insert forValue(final String value) {
102 return VALUES.get(requireNonNull(value));
106 private PostPutQueryParameters() {