diff options
Diffstat (limited to 'sdnr/wt/common-yang/test-yang')
6 files changed, 239 insertions, 0 deletions
diff --git a/sdnr/wt/common-yang/test-yang/pom.xml b/sdnr/wt/common-yang/test-yang/pom.xml new file mode 100644 index 000000000..df82f22a9 --- /dev/null +++ b/sdnr/wt/common-yang/test-yang/pom.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ ============LICENSE_START======================================================= + ~ ONAP : ccsdk features + ~ ================================================================================ + ~ Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. + ~ All rights reserved. + ~ ================================================================================ + ~ Update Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + ~ ================================================================================ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~ ============LICENSE_END======================================================= + ~ + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.onap.ccsdk.parent</groupId> + <artifactId>binding-parent</artifactId> + <version>2.5.4-SNAPSHOT</version> + <relativePath/> + </parent> + + <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> + <artifactId>sdnr-wt-test-yang</artifactId> + <version>1.5.1-SNAPSHOT</version> + <packaging>bundle</packaging> + + <name>ccsdk-features :: ${project.artifactId}</name> + <licenses> + <license> + <name>Apache License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0</url> + </license> + </licenses> + + <dependencies> + <dependency> + <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId> + <artifactId>rfc6991-ietf-yang-types</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId> + <artifactId>rfc6991-ietf-inet-types</artifactId> + </dependency> + </dependencies> + +</project> diff --git a/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java new file mode 100644 index 000000000..3d859e8b5 --- /dev/null +++ b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java @@ -0,0 +1,25 @@ +package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715; +import java.lang.String; +import java.lang.UnsupportedOperationException; +import javax.annotation.processing.Generated; + +/** + * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation. + * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32). + * + * The reason behind putting it under src/main/java is: + * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent + * loss of user code. + * + */ +@Generated("mdsal-binding-generator") +public class HostBuilder { + private HostBuilder() { + //Exists only to defeat instantiation. + } + + public static Host getDefaultInstance(String defaultValue) { + throw new UnsupportedOperationException("Not yet implemented"); + } + +} diff --git a/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java new file mode 100644 index 000000000..62771f669 --- /dev/null +++ b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java @@ -0,0 +1,25 @@ +package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715; +import java.lang.String; +import java.lang.UnsupportedOperationException; +import javax.annotation.processing.Generated; + +/** + * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation. + * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32). + * + * The reason behind putting it under src/main/java is: + * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent + * loss of user code. + * + */ +@Generated("mdsal-binding-generator") +public class IpAddressBuilder { + private IpAddressBuilder() { + //Exists only to defeat instantiation. + } + + public static IpAddress getDefaultInstance(String defaultValue) { + throw new UnsupportedOperationException("Not yet implemented"); + } + +} diff --git a/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java new file mode 100644 index 000000000..d7b295263 --- /dev/null +++ b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java @@ -0,0 +1,25 @@ +package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715; +import java.lang.String; +import java.lang.UnsupportedOperationException; +import javax.annotation.processing.Generated; + +/** + * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation. + * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32). + * + * The reason behind putting it under src/main/java is: + * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent + * loss of user code. + * + */ +@Generated("mdsal-binding-generator") +public class IpAddressNoZoneBuilder { + private IpAddressNoZoneBuilder() { + //Exists only to defeat instantiation. + } + + public static IpAddressNoZone getDefaultInstance(String defaultValue) { + throw new UnsupportedOperationException("Not yet implemented"); + } + +} diff --git a/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java new file mode 100644 index 000000000..d5fff3db4 --- /dev/null +++ b/sdnr/wt/common-yang/test-yang/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java @@ -0,0 +1,25 @@ +package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715; +import java.lang.String; +import java.lang.UnsupportedOperationException; +import javax.annotation.processing.Generated; + +/** + * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation. + * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32). + * + * The reason behind putting it under src/main/java is: + * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent + * loss of user code. + * + */ +@Generated("mdsal-binding-generator") +public class IpPrefixBuilder { + private IpPrefixBuilder() { + //Exists only to defeat instantiation. + } + + public static IpPrefix getDefaultInstance(String defaultValue) { + throw new UnsupportedOperationException("Not yet implemented"); + } + +} diff --git a/sdnr/wt/common-yang/test-yang/src/main/yang/test-yang-utils.yang b/sdnr/wt/common-yang/test-yang/src/main/yang/test-yang-utils.yang new file mode 100644 index 000000000..eb62a859a --- /dev/null +++ b/sdnr/wt/common-yang/test-yang/src/main/yang/test-yang-utils.yang @@ -0,0 +1,79 @@ +module test-yang-utils { + + yang-version 1.1; + namespace "urn:test:yang:utils"; + prefix tesyangutils; + + import ietf-yang-types { + prefix yang; + reference + "RFC 6991: Common YANG Data Types."; + } + + import ietf-inet-types { + prefix inet; + } + + typedef AddressType { + type enumeration { + enum OFFICE { + description + "Office Address"; + } + enum HOME { + description + "Home Address"; + } + } + } + + identity item-code { + description + "Base identity"; + } + + typedef item-code { + type identityref { + base item-code; + } + description + "Item code - Could be bar code, QR code or any other code to uniquely identify an item"; + } + + grouping address-location-entity { + leaf id { + type string; + description + "Unique ID of the address"; + } + leaf address-type { + type AddressType; + description + "Type of Address"; + } + leaf delivery-date-time { + type yang:date-and-time; + description + "Package delivery date and time"; + } + leaf delivery-url { + type inet:uri; + description + "Delivery URL"; + } + list item-list { + key "item-key"; + leaf item-key { + type item-code; + } + description + "Unique code of the ordered item"; + } + } + + container address-location { + description + "builder"; + uses address-location-entity; + } +}
\ No newline at end of file |