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.restful.utils;
11 import java.net.URISyntaxException;
12 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
13 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
14 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.common.QNameModule;
19 * Constants for RestconfDataService
22 public final class RestconfDataServiceConstant {
24 public static final String CONTENT = "content";
25 public static final QName NETCONF_BASE_QNAME;
28 NETCONF_BASE_QNAME = QName.create(
29 QNameModule.create(new URI(PutData.NETCONF_BASE), null), PutData.NETCONF_BASE_PAYLOAD_NAME);
30 } catch (final URISyntaxException e) {
31 final String errMsg = "It wasn't possible to create instance of URI class with " + PutData.NETCONF_BASE
33 throw new RestconfDocumentedException(errMsg, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED);
37 private RestconfDataServiceConstant() {
38 throw new UnsupportedOperationException("Util class.");
42 * Constants for read data
45 public final class ReadData {
47 public static final String CONFIG = "config";
48 public static final String NONCONFIG = "nonconfig";
49 public static final String ALL = "all";
50 public static final String READ_TYPE_TX = "READ";
53 throw new UnsupportedOperationException("Util class.");
58 * Constants for data to put
61 public final class PutData {
62 public static final String NETCONF_BASE = "urn:ietf:params:xml:ns:netconf:base:1.0";
63 public static final String NETCONF_BASE_PAYLOAD_NAME = "data";
64 public static final String PUT_TX_TYPE = "PUT";
67 throw new UnsupportedOperationException("Util class.");
72 * Constants for data to post
75 public final class PostData {
76 public static final String POST_TX_TYPE = "POST";
79 throw new UnsupportedOperationException("Util class.");
84 * Constants for data to delete
87 public final class DeleteData {
88 public static final String DELETE_TX_TYPE = "DELETE";
90 private DeleteData() {
91 throw new UnsupportedOperationException("Util class.");
96 * Constants for data to yang patch
99 public final class PatchData {
100 public static final String PATCH_TX_TYPE = "PATCH";
102 private PatchData() {
103 throw new UnsupportedOperationException("Util class.");