2 * Copyright (c) 2013 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.controller.sal.demo;
11 import java.net.URISyntaxException;
12 import java.util.Date;
14 import org.opendaylight.controller.yang.common.QName;
15 import org.opendaylight.controller.yang.data.api.Node;
16 import org.opendaylight.controller.yang.data.util.Nodes;
19 public class DemoUtils {
21 public static final URI namespace = uri("urn:cisco:prototype:sal:demo");
22 public static final Date revision = new Date();
24 public static final QName alertNotification = qName("alert");
25 public static final QName changeNotification = qName("change");
27 public static final QName contentNodeName = qName("content");
29 public static URI uri(String str) {
32 } catch (URISyntaxException e) {
33 throw new IllegalArgumentException(e);
37 public static QName qName(String str) {
38 return new QName(namespace, revision, str);
41 public static Node<?> contentNode(String content) {
42 return Nodes.leafNode(contentNodeName, content);