2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.sal.demo;
\r
10 import java.net.URI;
\r
11 import java.net.URISyntaxException;
\r
12 import java.util.Date;
\r
14 import org.opendaylight.controller.data.util.Nodes;
\r
15 import org.opendaylight.controller.yang.common.QName;
\r
16 import org.opendaylight.controller.yang.data.api.Node;
\r
19 public class DemoUtils {
\r
21 public static final URI namespace = uri("urn:cisco:prototype:sal:demo");
\r
22 public static final Date revision = new Date();
\r
24 public static final QName alertNotification = qName("alert");
\r
25 public static final QName changeNotification = qName("change");
\r
27 public static final QName contentNodeName = qName("content");
\r
29 public static URI uri(String str) {
\r
31 return new URI(str);
\r
32 } catch (URISyntaxException e) {
\r
33 throw new IllegalArgumentException(e);
\r
37 public static QName qName(String str) {
\r
38 return new QName(namespace, revision, str);
\r
41 public static Node<?> contentNode(String content) {
\r
42 return Nodes.leafNode(contentNodeName, content);
\r